OctoPrint

App · 15 actions

Run your 3D printer from workflows through OctoPrint: check how a print is going, upload G-code and start printing, pause, resume or cancel, preheat and cool down, send G-code and take a webcam picture. Start a workflow when a print finishes, fails or pauses, or the printer disconnects.

Actions

ActionWhat it does
Cancel printStop the print for good.
Connect printerConnect OctoPrint to the printer, such as after it was turned on, and wait until it's ready.
Cool downTurn off every heater: the nozzles, the bed and any chamber.
Delete fileDelete a G-code file from OctoPrint, such as once it has printed.
Disconnect printerDisconnect OctoPrint from the printer, such as before turning it off.
Get printer statusFind out what the printer is doing: its state, temperatures, the file printing, how much is done and the time left, with one sentence saying it all for a message.
Get webcam snapshotTake a picture with the webcam OctoPrint uses, saved as a file to send or attach, such as to see how a print is going.
Home axesMove the print head to its home position, on every axis or some.
List filesList the G-code files in OctoPrint, with how long each should take to print, the filament it uses, and how often it has printed.
Pause printPause the print, such as to change filament.
Resume printCarry on with a paused print.
Send G-codeSend G-code commands to the printer, such as M117 to show a message on its screen.
Set temperaturesHeat the nozzle, bed or chamber to a temperature, such as to preheat before a print, or turn one off with 0.
Start printStart printing a G-code file already in OctoPrint.
Upload filePut a G-code file in OctoPrint, from an upload, an earlier step, a link or G-code written here, into a folder, and start printing it if you choose.

Cancel print

Stop the print for good. It can't be resumed; the file stays in OctoPrint to print again.

Inputs

None.

Outputs

bed_targetnumber
The bed's target temperature, in °C; 0 when off
bed_temperaturenumber
The bed's temperature now, in °C
connectedtrue/false
Whether the printer is connected to OctoPrint
errortext
The printer's error, if it has one
estimated_print_time_secondsnumber
How long the whole file should take, from OctoPrint's analysis, in seconds
file_nametext
The file being printed, or the last one chosen
file_pathtext
That file's path in OctoPrint, such as prints/benchy.gcode
finishes_attext
When the print should finish (ISO 8601, UTC)
heaterslist
Every heater, with its temperature and target
nozzle_targetnumber
The nozzle's target temperature, in °C; 0 when off
nozzle_temperaturenumber
The nozzle's temperature now, in °C
pausedtrue/false
Whether a print is paused
porttext
The port it's connected on, such as /dev/ttyUSB0
print_timetext
How long it has been printing, such as 1 h 5 min
print_time_secondsnumber
How long it has been printing, in seconds
printer_profiletext
The printer profile in use
printingtrue/false
Whether it's printing now
progress_percentnumber
How much of the print is done, 0 to 100
readytrue/false
Whether it's connected and free to start a print
started_bytext
The OctoPrint user who started the print
statetext
The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
summarytext
One sentence saying all this, for a message
time_lefttext
The time left, such as 25 min
time_left_secondsnumber
OctoPrint's estimate of the time left, in seconds
Example output
{
  "bed_target": 60.0,
  "bed_temperature": 60.1,
  "connected": true,
  "error": "",
  "estimated_print_time_seconds": 6400,
  "file_name": "benchy.gcode",
  "file_path": "prints/benchy.gcode",
  "finishes_at": "",
  "heaters": [
    {
      "actual": 209.8,
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "actual": 60.1,
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "nozzle_temperature": 209.8,
  "paused": false,
  "port": "/dev/ttyUSB0",
  "print_time": "",
  "print_time_seconds": 0,
  "printer_profile": "_default",
  "printing": false,
  "progress_percent": 0.0,
  "ready": true,
  "started_by": "",
  "state": "Operational",
  "summary": "The printer is operational. Temperatures: nozzle 209.8/210 \u00b0C, bed 60.1/60 \u00b0C.",
  "time_left": "",
  "time_left_seconds": 0
}

Connect printer

Connect OctoPrint to the printer, such as after it was turned on, and wait until it's ready. A printer already connected stays as it is.

Inputs

Portporttext
The printer's port, such as /dev/ttyUSB0. Leave blank for OctoPrint's saved choice, or AUTO to find it.
Baud ratebaudratetext
The connection's speed, such as 115200. Leave blank for OctoPrint's saved choice, or AUTO to find it.
Printer profileprinter_profiletext
The printer profile to use. Leave blank for OctoPrint's default.

Outputs

baudratenumber
The baud rate it's connected at
connectedtrue/false
Whether the printer is connected
errortext
The error, when the connection failed
porttext
The port it's on, such as /dev/ttyUSB0
printer_profiletext
The printer profile's ID
printer_profile_nametext
The printer profile's name
statetext
The connection's state, such as Operational, Closed or Offline after error
Example output
{
  "baudrate": 115200,
  "connected": true,
  "error": "",
  "port": "/dev/ttyUSB0",
  "printer_profile": "_default",
  "printer_profile_name": "Default",
  "state": "Operational"
}

Cool down

Turn off every heater: the nozzles, the bed and any chamber.

Inputs

None.

Outputs

bed_targetnumber
The bed's new target in °C; -1 if it wasn't set
countnumber
How many heaters were set
heaterslist
Each heater set, with the target it was given
nozzle_targetnumber
The nozzle's new target in °C; -1 if it wasn't set
summarytext
What was set, such as Nozzle 210 °C, Bed 60 °C
Example output
{
  "bed_target": 0.0,
  "count": 2,
  "heaters": [
    {
      "heater": "tool0",
      "name": "Nozzle",
      "target": 0.0
    },
    {
      "heater": "bed",
      "name": "Bed",
      "target": 0.0
    }
  ],
  "nozzle_target": 0.0,
  "summary": "Nozzle off, Bed off"
}

Delete file

Delete a G-code file from OctoPrint, such as once it has printed. A file that isn't there is left alone, and one printing is refused.

Inputs

FilefiletextRequired
The G-code file in OctoPrint: its path, such as prints/benchy.gcode (from Upload file or List files), or a link to it in OctoPrint.

Outputs

deletedtrue/false
Whether it was deleted; false when it wasn't there
pathtext
The file's path
Example output
{
  "deleted": true,
  "path": "prints/benchy.gcode"
}

Disconnect printer

Disconnect OctoPrint from the printer, such as before turning it off. Refused while it prints.

Inputs

None.

Outputs

baudratenumber
The baud rate it's connected at
connectedtrue/false
Whether the printer is connected
errortext
The error, when the connection failed
porttext
The port it's on, such as /dev/ttyUSB0
printer_profiletext
The printer profile's ID
printer_profile_nametext
The printer profile's name
statetext
The connection's state, such as Operational, Closed or Offline after error
Example output
{
  "baudrate": 0,
  "connected": false,
  "error": "",
  "port": "",
  "printer_profile": "_default",
  "printer_profile_name": "Default",
  "state": "Closed"
}

Get printer status

Find out what the printer is doing: its state, temperatures, the file printing, how much is done and the time left, with one sentence saying it all for a message.

Inputs

None.

Outputs

bed_targetnumber
The bed's target temperature, in °C; 0 when off
bed_temperaturenumber
The bed's temperature now, in °C
connectedtrue/false
Whether the printer is connected to OctoPrint
errortext
The printer's error, if it has one
estimated_print_time_secondsnumber
How long the whole file should take, from OctoPrint's analysis, in seconds
file_nametext
The file being printed, or the last one chosen
file_pathtext
That file's path in OctoPrint, such as prints/benchy.gcode
finishes_attext
When the print should finish (ISO 8601, UTC)
heaterslist
Every heater, with its temperature and target
nozzle_targetnumber
The nozzle's target temperature, in °C; 0 when off
nozzle_temperaturenumber
The nozzle's temperature now, in °C
pausedtrue/false
Whether a print is paused
porttext
The port it's connected on, such as /dev/ttyUSB0
print_timetext
How long it has been printing, such as 1 h 5 min
print_time_secondsnumber
How long it has been printing, in seconds
printer_profiletext
The printer profile in use
printingtrue/false
Whether it's printing now
progress_percentnumber
How much of the print is done, 0 to 100
readytrue/false
Whether it's connected and free to start a print
started_bytext
The OctoPrint user who started the print
statetext
The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
summarytext
One sentence saying all this, for a message
time_lefttext
The time left, such as 25 min
time_left_secondsnumber
OctoPrint's estimate of the time left, in seconds
Example output
{
  "bed_target": 60.0,
  "bed_temperature": 60.1,
  "connected": true,
  "error": "",
  "estimated_print_time_seconds": 6400,
  "file_name": "benchy.gcode",
  "file_path": "prints/benchy.gcode",
  "finishes_at": "2026-05-04T15:32:00Z",
  "heaters": [
    {
      "actual": 209.8,
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "actual": 60.1,
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "nozzle_temperature": 209.8,
  "paused": false,
  "port": "/dev/ttyUSB0",
  "print_time": "45 min",
  "print_time_seconds": 2710,
  "printer_profile": "_default",
  "printing": true,
  "progress_percent": 42.5,
  "ready": false,
  "started_by": "lodol",
  "state": "Printing",
  "summary": "Printing benchy.gcode: 42.5% done, 1 h 2 min left. Temperatures: nozzle 209.8/210 \u00b0C, bed 60.1/60 \u00b0C.",
  "time_left": "1 h 2 min",
  "time_left_seconds": 3720
}

Get webcam snapshot

Take a picture with the webcam OctoPrint uses, saved as a file to send or attach, such as to see how a print is going.

Inputs

None.

Outputs

content_typetext
Its type, such as image/jpeg
document_reftext
The picture, saved in Lodol, for other steps to attach or send
filenametext
Its file name, such as octoprint-snapshot-20260504-143000.jpg
size_bytesnumber
Its size in bytes
taken_attext
When it was taken (ISO 8601, UTC)
Example output
{
  "content_type": "image/jpeg",
  "document_ref": "doc_0123456789abcdef0123456789abcdef",
  "filename": "octoprint-snapshot-20260504-143000.jpg",
  "size_bytes": 48211,
  "taken_at": "2026-05-04T14:30:00Z"
}

Home axes

Move the print head to its home position, on every axis or some. The printer moves, so make sure nothing is in its way.

Inputs

Axesaxestext
Which axes to home.One of: all (All axes), xy (X and Y), z (Z only). Default: all.

Outputs

axeslist
The axes sent home, such as X, Y and Z
homedtrue/false
Whether OctoPrint took the command
Example output
{
  "axes": [
    "X",
    "Y",
    "Z"
  ],
  "homed": true
}

List files

List the G-code files in OctoPrint, with how long each should take to print, the filament it uses, and how often it has printed.

Inputs

Folderfoldertext
The folder in OctoPrint, such as prints. Leave blank for the top.
Searchsearchtext
Only files with these words in their name.
Sort bysorttext
The order to list them in.One of: newest (Newest upload first), name, last_printed (Most recently printed first). Default: newest.
How manylimitnumber
The most to list. Defaults to 25.From 1 to 200.

Outputs

countnumber
How many are listed
fileslist
The G-code files
foldertext
The folder listed; empty for all of OctoPrint's files
totalnumber
How many match, before the limit
Example output
{
  "count": 1,
  "files": [
    {
      "analysed": true,
      "depth_mm": 31.0,
      "download_link": "http://octopi.local/downloads/files/local/prints/benchy.gcode",
      "estimated_print_time": "1 h 47 min",
      "estimated_print_time_seconds": 6420,
      "filament_length_mm": 4210.5,
      "filament_volume_cm3": 10.13,
      "folder": "prints",
      "height_mm": 48.0,
      "last_print_succeeded": true,
      "last_print_time_seconds": 6512,
      "last_printed_at": "2026-05-04T14:00:00Z",
      "name": "benchy.gcode",
      "path": "prints/benchy.gcode",
      "size": "2.4 MB",
      "size_bytes": 2516582,
      "times_failed": 1,
      "times_printed": 2,
      "uploaded_at": "2026-05-04T12:10:00Z",
      "width_mm": 60.0
    }
  ],
  "folder": "",
  "total": 1
}

Pause print

Pause the print, such as to change filament. A print already paused stays paused.

Inputs

None.

Outputs

bed_targetnumber
The bed's target temperature, in °C; 0 when off
bed_temperaturenumber
The bed's temperature now, in °C
connectedtrue/false
Whether the printer is connected to OctoPrint
errortext
The printer's error, if it has one
estimated_print_time_secondsnumber
How long the whole file should take, from OctoPrint's analysis, in seconds
file_nametext
The file being printed, or the last one chosen
file_pathtext
That file's path in OctoPrint, such as prints/benchy.gcode
finishes_attext
When the print should finish (ISO 8601, UTC)
heaterslist
Every heater, with its temperature and target
nozzle_targetnumber
The nozzle's target temperature, in °C; 0 when off
nozzle_temperaturenumber
The nozzle's temperature now, in °C
pausedtrue/false
Whether a print is paused
porttext
The port it's connected on, such as /dev/ttyUSB0
print_timetext
How long it has been printing, such as 1 h 5 min
print_time_secondsnumber
How long it has been printing, in seconds
printer_profiletext
The printer profile in use
printingtrue/false
Whether it's printing now
progress_percentnumber
How much of the print is done, 0 to 100
readytrue/false
Whether it's connected and free to start a print
started_bytext
The OctoPrint user who started the print
statetext
The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
summarytext
One sentence saying all this, for a message
time_lefttext
The time left, such as 25 min
time_left_secondsnumber
OctoPrint's estimate of the time left, in seconds
Example output
{
  "bed_target": 60.0,
  "bed_temperature": 60.1,
  "connected": true,
  "error": "",
  "estimated_print_time_seconds": 6400,
  "file_name": "benchy.gcode",
  "file_path": "prints/benchy.gcode",
  "finishes_at": "2026-05-04T15:32:00Z",
  "heaters": [
    {
      "actual": 209.8,
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "actual": 60.1,
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "nozzle_temperature": 209.8,
  "paused": true,
  "port": "/dev/ttyUSB0",
  "print_time": "45 min",
  "print_time_seconds": 2710,
  "printer_profile": "_default",
  "printing": false,
  "progress_percent": 42.5,
  "ready": false,
  "started_by": "lodol",
  "state": "Paused",
  "summary": "Paused benchy.gcode: 42.5% done, 1 h 2 min left. Temperatures: nozzle 209.8/210 \u00b0C, bed 60.1/60 \u00b0C.",
  "time_left": "1 h 2 min",
  "time_left_seconds": 3720
}

Resume print

Carry on with a paused print. A print already running carries on.

Inputs

None.

Outputs

bed_targetnumber
The bed's target temperature, in °C; 0 when off
bed_temperaturenumber
The bed's temperature now, in °C
connectedtrue/false
Whether the printer is connected to OctoPrint
errortext
The printer's error, if it has one
estimated_print_time_secondsnumber
How long the whole file should take, from OctoPrint's analysis, in seconds
file_nametext
The file being printed, or the last one chosen
file_pathtext
That file's path in OctoPrint, such as prints/benchy.gcode
finishes_attext
When the print should finish (ISO 8601, UTC)
heaterslist
Every heater, with its temperature and target
nozzle_targetnumber
The nozzle's target temperature, in °C; 0 when off
nozzle_temperaturenumber
The nozzle's temperature now, in °C
pausedtrue/false
Whether a print is paused
porttext
The port it's connected on, such as /dev/ttyUSB0
print_timetext
How long it has been printing, such as 1 h 5 min
print_time_secondsnumber
How long it has been printing, in seconds
printer_profiletext
The printer profile in use
printingtrue/false
Whether it's printing now
progress_percentnumber
How much of the print is done, 0 to 100
readytrue/false
Whether it's connected and free to start a print
started_bytext
The OctoPrint user who started the print
statetext
The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
summarytext
One sentence saying all this, for a message
time_lefttext
The time left, such as 25 min
time_left_secondsnumber
OctoPrint's estimate of the time left, in seconds
Example output
{
  "bed_target": 60.0,
  "bed_temperature": 60.1,
  "connected": true,
  "error": "",
  "estimated_print_time_seconds": 6400,
  "file_name": "benchy.gcode",
  "file_path": "prints/benchy.gcode",
  "finishes_at": "2026-05-04T15:32:00Z",
  "heaters": [
    {
      "actual": 209.8,
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "actual": 60.1,
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "nozzle_temperature": 209.8,
  "paused": false,
  "port": "/dev/ttyUSB0",
  "print_time": "45 min",
  "print_time_seconds": 2710,
  "printer_profile": "_default",
  "printing": true,
  "progress_percent": 42.5,
  "ready": false,
  "started_by": "lodol",
  "state": "Printing",
  "summary": "Printing benchy.gcode: 42.5% done, 1 h 2 min left. Temperatures: nozzle 209.8/210 \u00b0C, bed 60.1/60 \u00b0C.",
  "time_left": "1 h 2 min",
  "time_left_seconds": 3720
}

Send G-code

Send G-code commands to the printer, such as M117 to show a message on its screen. Commands can move the printer and heat it, so send only ones you know.

Inputs

CommandscommandstextRequired
One G-code command per line, such as M117 Print done. Text after ; is a comment and isn't sent. At most 100 lines.

Outputs

commandslist
The commands sent, one per line, comments taken off
countnumber
How many commands were sent
statetext
The printer's state when they were sent
Example output
{
  "commands": [
    "M117 Print done",
    "M300 S440 P200"
  ],
  "count": 2,
  "state": "Operational"
}

Set temperatures

Heat the nozzle, bed or chamber to a temperature, such as to preheat before a print, or turn one off with 0. Heaters left blank keep theirs.

Inputs

Nozzle (°C)nozzlenumber
The nozzle's temperature, such as 210 for PLA. 0 turns it off.From 0 to 450.
Bed (°C)bednumber
The bed's temperature, such as 60 for PLA. 0 turns it off.From 0 to 200.
Chamber (°C)chambernumber
The heated chamber's temperature, for printers that have one. 0 turns it off.From 0 to 120.
Extruderextrudernumber
Which nozzle, on a printer with more than one: 1 is the first. Leave blank for the first.From 1 to 16.

Outputs

bed_targetnumber
The bed's new target in °C; -1 if it wasn't set
countnumber
How many heaters were set
heaterslist
Each heater set, with the target it was given
nozzle_targetnumber
The nozzle's new target in °C; -1 if it wasn't set
summarytext
What was set, such as Nozzle 210 °C, Bed 60 °C
Example output
{
  "bed_target": 60.0,
  "count": 2,
  "heaters": [
    {
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "summary": "Nozzle 210 \u00b0C, Bed 60 \u00b0C"
}

Start print

Start printing a G-code file already in OctoPrint. The printer must be connected and not printing.

Inputs

FilefiletextRequired
The G-code file in OctoPrint: its path, such as prints/benchy.gcode (from Upload file or List files), or a link to it in OctoPrint.

Outputs

bed_targetnumber
The bed's target temperature, in °C; 0 when off
bed_temperaturenumber
The bed's temperature now, in °C
connectedtrue/false
Whether the printer is connected to OctoPrint
errortext
The printer's error, if it has one
estimated_print_time_secondsnumber
How long the whole file should take, from OctoPrint's analysis, in seconds
file_nametext
The file being printed, or the last one chosen
file_pathtext
That file's path in OctoPrint, such as prints/benchy.gcode
finishes_attext
When the print should finish (ISO 8601, UTC)
heaterslist
Every heater, with its temperature and target
nozzle_targetnumber
The nozzle's target temperature, in °C; 0 when off
nozzle_temperaturenumber
The nozzle's temperature now, in °C
pausedtrue/false
Whether a print is paused
porttext
The port it's connected on, such as /dev/ttyUSB0
print_timetext
How long it has been printing, such as 1 h 5 min
print_time_secondsnumber
How long it has been printing, in seconds
printer_profiletext
The printer profile in use
printingtrue/false
Whether it's printing now
progress_percentnumber
How much of the print is done, 0 to 100
readytrue/false
Whether it's connected and free to start a print
started_bytext
The OctoPrint user who started the print
statetext
The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
summarytext
One sentence saying all this, for a message
time_lefttext
The time left, such as 25 min
time_left_secondsnumber
OctoPrint's estimate of the time left, in seconds
Example output
{
  "bed_target": 60.0,
  "bed_temperature": 60.1,
  "connected": true,
  "error": "",
  "estimated_print_time_seconds": 6400,
  "file_name": "benchy.gcode",
  "file_path": "prints/benchy.gcode",
  "finishes_at": "2026-05-04T15:32:00Z",
  "heaters": [
    {
      "actual": 209.8,
      "heater": "tool0",
      "name": "Nozzle",
      "target": 210.0
    },
    {
      "actual": 60.1,
      "heater": "bed",
      "name": "Bed",
      "target": 60.0
    }
  ],
  "nozzle_target": 210.0,
  "nozzle_temperature": 209.8,
  "paused": false,
  "port": "/dev/ttyUSB0",
  "print_time": "45 min",
  "print_time_seconds": 2710,
  "printer_profile": "_default",
  "printing": true,
  "progress_percent": 0.4,
  "ready": false,
  "started_by": "lodol",
  "state": "Printing",
  "summary": "Printing benchy.gcode: 42.5% done, 1 h 2 min left. Temperatures: nozzle 209.8/210 \u00b0C, bed 60.1/60 \u00b0C.",
  "time_left": "1 h 2 min",
  "time_left_seconds": 3720
}

Upload file

Put a G-code file in OctoPrint, from an upload, an earlier step, a link or G-code written here, into a folder, and start printing it if you choose. A file of the same name is replaced.

Inputs

Filefiletext
The G-code file (.gcode, .gco or .g): upload it, pick one from an earlier step, or paste a link. Use this or Content.
Contentcontenttext
G-code to save as a file, one command per line, such as a calibration routine. Use this or File.
Save asfilenametext
The file's name in OctoPrint, such as benchy.gcode. Needed with Content; with a file, leave blank to keep its name.
Folderfoldertext
The folder in OctoPrint, such as prints. Leave blank for the top.
Start printingstart_printingtrue/false
Start printing it as soon as it's uploaded. The printer must be connected and not printing.Default: false.

Outputs

download_linktext
A link to download it from OctoPrint (needs the API key)
foldertext
The folder it went into; empty for the top
nametext
The file's name in OctoPrint
pathtext
Its path in OctoPrint, for Start print and Delete file
printingtrue/false
Whether it started printing
size_bytesnumber
Its size in bytes
Example output
{
  "download_link": "http://octopi.local/downloads/files/local/prints/benchy.gcode",
  "folder": "prints",
  "name": "benchy.gcode",
  "path": "prints/benchy.gcode",
  "printing": true,
  "size_bytes": 2516582
}

On this page