# OctoPrint

> 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.

App · 15 actions. Web page: https://docs.lodol.com/docs/integrations/octoprint

## Actions

### Cancel print

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

**Inputs**: None.

**Outputs**

- `bed_target` (number): The bed's target temperature, in °C; 0 when off
- `bed_temperature` (number): The bed's temperature now, in °C
- `connected` (true/false): Whether the printer is connected to OctoPrint
- `error` (text): The printer's error, if it has one
- `estimated_print_time_seconds` (number): How long the whole file should take, from OctoPrint's analysis, in seconds
- `file_name` (text): The file being printed, or the last one chosen
- `file_path` (text): That file's path in OctoPrint, such as prints/benchy.gcode
- `finishes_at` (text): When the print should finish (ISO 8601, UTC)
- `heaters` (list): Every heater, with its temperature and target
- `nozzle_target` (number): The nozzle's target temperature, in °C; 0 when off
- `nozzle_temperature` (number): The nozzle's temperature now, in °C
- `paused` (true/false): Whether a print is paused
- `port` (text): The port it's connected on, such as /dev/ttyUSB0
- `print_time` (text): How long it has been printing, such as 1 h 5 min
- `print_time_seconds` (number): How long it has been printing, in seconds
- `printer_profile` (text): The printer profile in use
- `printing` (true/false): Whether it's printing now
- `progress_percent` (number): How much of the print is done, 0 to 100
- `ready` (true/false): Whether it's connected and free to start a print
- `started_by` (text): The OctoPrint user who started the print
- `state` (text): The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
- `summary` (text): One sentence saying all this, for a message
- `time_left` (text): The time left, such as 25 min
- `time_left_seconds` (number): OctoPrint's estimate of the time left, in seconds

**Example output**

```json
{
  "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**

- Port (`port`, text): The printer's port, such as /dev/ttyUSB0. Leave blank for OctoPrint's saved choice, or AUTO to find it.
- Baud rate (`baudrate`, text): The connection's speed, such as 115200. Leave blank for OctoPrint's saved choice, or AUTO to find it.
- Printer profile (`printer_profile`, text): The printer profile to use. Leave blank for OctoPrint's default.

**Outputs**

- `baudrate` (number): The baud rate it's connected at
- `connected` (true/false): Whether the printer is connected
- `error` (text): The error, when the connection failed
- `port` (text): The port it's on, such as /dev/ttyUSB0
- `printer_profile` (text): The printer profile's ID
- `printer_profile_name` (text): The printer profile's name
- `state` (text): The connection's state, such as Operational, Closed or Offline after error

**Example output**

```json
{
  "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_target` (number): The bed's new target in °C; -1 if it wasn't set
- `count` (number): How many heaters were set
- `heaters` (list): Each heater set, with the target it was given
- `nozzle_target` (number): The nozzle's new target in °C; -1 if it wasn't set
- `summary` (text): What was set, such as Nozzle 210 °C, Bed 60 °C

**Example output**

```json
{
  "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**

- File (`file`, text, required): 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**

- `deleted` (true/false): Whether it was deleted; false when it wasn't there
- `path` (text): The file's path

**Example output**

```json
{
  "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**

- `baudrate` (number): The baud rate it's connected at
- `connected` (true/false): Whether the printer is connected
- `error` (text): The error, when the connection failed
- `port` (text): The port it's on, such as /dev/ttyUSB0
- `printer_profile` (text): The printer profile's ID
- `printer_profile_name` (text): The printer profile's name
- `state` (text): The connection's state, such as Operational, Closed or Offline after error

**Example output**

```json
{
  "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_target` (number): The bed's target temperature, in °C; 0 when off
- `bed_temperature` (number): The bed's temperature now, in °C
- `connected` (true/false): Whether the printer is connected to OctoPrint
- `error` (text): The printer's error, if it has one
- `estimated_print_time_seconds` (number): How long the whole file should take, from OctoPrint's analysis, in seconds
- `file_name` (text): The file being printed, or the last one chosen
- `file_path` (text): That file's path in OctoPrint, such as prints/benchy.gcode
- `finishes_at` (text): When the print should finish (ISO 8601, UTC)
- `heaters` (list): Every heater, with its temperature and target
- `nozzle_target` (number): The nozzle's target temperature, in °C; 0 when off
- `nozzle_temperature` (number): The nozzle's temperature now, in °C
- `paused` (true/false): Whether a print is paused
- `port` (text): The port it's connected on, such as /dev/ttyUSB0
- `print_time` (text): How long it has been printing, such as 1 h 5 min
- `print_time_seconds` (number): How long it has been printing, in seconds
- `printer_profile` (text): The printer profile in use
- `printing` (true/false): Whether it's printing now
- `progress_percent` (number): How much of the print is done, 0 to 100
- `ready` (true/false): Whether it's connected and free to start a print
- `started_by` (text): The OctoPrint user who started the print
- `state` (text): The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
- `summary` (text): One sentence saying all this, for a message
- `time_left` (text): The time left, such as 25 min
- `time_left_seconds` (number): OctoPrint's estimate of the time left, in seconds

**Example output**

```json
{
  "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_type` (text): Its type, such as image/jpeg
- `document_ref` (text): The picture, saved in Lodol, for other steps to attach or send
- `filename` (text): Its file name, such as octoprint-snapshot-20260504-143000.jpg
- `size_bytes` (number): Its size in bytes
- `taken_at` (text): When it was taken (ISO 8601, UTC)

**Example output**

```json
{
  "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**

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

**Outputs**

- `axes` (list): The axes sent home, such as X, Y and Z
- `homed` (true/false): Whether OctoPrint took the command

**Example output**

```json
{
  "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**

- Folder (`folder`, text): The folder in OctoPrint, such as prints. Leave blank for the top.
- Search (`search`, text): Only files with these words in their name.
- Sort by (`sort`, text): The order to list them in. One of: `newest` (Newest upload first), `name`, `last_printed` (Most recently printed first). Default: `newest`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 200.

**Outputs**

- `count` (number): How many are listed
- `files` (list): The G-code files
- `folder` (text): The folder listed; empty for all of OctoPrint's files
- `total` (number): How many match, before the limit

**Example output**

```json
{
  "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_target` (number): The bed's target temperature, in °C; 0 when off
- `bed_temperature` (number): The bed's temperature now, in °C
- `connected` (true/false): Whether the printer is connected to OctoPrint
- `error` (text): The printer's error, if it has one
- `estimated_print_time_seconds` (number): How long the whole file should take, from OctoPrint's analysis, in seconds
- `file_name` (text): The file being printed, or the last one chosen
- `file_path` (text): That file's path in OctoPrint, such as prints/benchy.gcode
- `finishes_at` (text): When the print should finish (ISO 8601, UTC)
- `heaters` (list): Every heater, with its temperature and target
- `nozzle_target` (number): The nozzle's target temperature, in °C; 0 when off
- `nozzle_temperature` (number): The nozzle's temperature now, in °C
- `paused` (true/false): Whether a print is paused
- `port` (text): The port it's connected on, such as /dev/ttyUSB0
- `print_time` (text): How long it has been printing, such as 1 h 5 min
- `print_time_seconds` (number): How long it has been printing, in seconds
- `printer_profile` (text): The printer profile in use
- `printing` (true/false): Whether it's printing now
- `progress_percent` (number): How much of the print is done, 0 to 100
- `ready` (true/false): Whether it's connected and free to start a print
- `started_by` (text): The OctoPrint user who started the print
- `state` (text): The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
- `summary` (text): One sentence saying all this, for a message
- `time_left` (text): The time left, such as 25 min
- `time_left_seconds` (number): OctoPrint's estimate of the time left, in seconds

**Example output**

```json
{
  "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_target` (number): The bed's target temperature, in °C; 0 when off
- `bed_temperature` (number): The bed's temperature now, in °C
- `connected` (true/false): Whether the printer is connected to OctoPrint
- `error` (text): The printer's error, if it has one
- `estimated_print_time_seconds` (number): How long the whole file should take, from OctoPrint's analysis, in seconds
- `file_name` (text): The file being printed, or the last one chosen
- `file_path` (text): That file's path in OctoPrint, such as prints/benchy.gcode
- `finishes_at` (text): When the print should finish (ISO 8601, UTC)
- `heaters` (list): Every heater, with its temperature and target
- `nozzle_target` (number): The nozzle's target temperature, in °C; 0 when off
- `nozzle_temperature` (number): The nozzle's temperature now, in °C
- `paused` (true/false): Whether a print is paused
- `port` (text): The port it's connected on, such as /dev/ttyUSB0
- `print_time` (text): How long it has been printing, such as 1 h 5 min
- `print_time_seconds` (number): How long it has been printing, in seconds
- `printer_profile` (text): The printer profile in use
- `printing` (true/false): Whether it's printing now
- `progress_percent` (number): How much of the print is done, 0 to 100
- `ready` (true/false): Whether it's connected and free to start a print
- `started_by` (text): The OctoPrint user who started the print
- `state` (text): The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
- `summary` (text): One sentence saying all this, for a message
- `time_left` (text): The time left, such as 25 min
- `time_left_seconds` (number): OctoPrint's estimate of the time left, in seconds

**Example output**

```json
{
  "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**

- Commands (`commands`, text, required): 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**

- `commands` (list): The commands sent, one per line, comments taken off
- `count` (number): How many commands were sent
- `state` (text): The printer's state when they were sent

**Example output**

```json
{
  "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) (`nozzle`, number): The nozzle's temperature, such as 210 for PLA. 0 turns it off. From 0 to 450.
- Bed (°C) (`bed`, number): The bed's temperature, such as 60 for PLA. 0 turns it off. From 0 to 200.
- Chamber (°C) (`chamber`, number): The heated chamber's temperature, for printers that have one. 0 turns it off. From 0 to 120.
- Extruder (`extruder`, number): Which nozzle, on a printer with more than one: 1 is the first. Leave blank for the first. From 1 to 16.

**Outputs**

- `bed_target` (number): The bed's new target in °C; -1 if it wasn't set
- `count` (number): How many heaters were set
- `heaters` (list): Each heater set, with the target it was given
- `nozzle_target` (number): The nozzle's new target in °C; -1 if it wasn't set
- `summary` (text): What was set, such as Nozzle 210 °C, Bed 60 °C

**Example output**

```json
{
  "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**

- File (`file`, text, required): 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_target` (number): The bed's target temperature, in °C; 0 when off
- `bed_temperature` (number): The bed's temperature now, in °C
- `connected` (true/false): Whether the printer is connected to OctoPrint
- `error` (text): The printer's error, if it has one
- `estimated_print_time_seconds` (number): How long the whole file should take, from OctoPrint's analysis, in seconds
- `file_name` (text): The file being printed, or the last one chosen
- `file_path` (text): That file's path in OctoPrint, such as prints/benchy.gcode
- `finishes_at` (text): When the print should finish (ISO 8601, UTC)
- `heaters` (list): Every heater, with its temperature and target
- `nozzle_target` (number): The nozzle's target temperature, in °C; 0 when off
- `nozzle_temperature` (number): The nozzle's temperature now, in °C
- `paused` (true/false): Whether a print is paused
- `port` (text): The port it's connected on, such as /dev/ttyUSB0
- `print_time` (text): How long it has been printing, such as 1 h 5 min
- `print_time_seconds` (number): How long it has been printing, in seconds
- `printer_profile` (text): The printer profile in use
- `printing` (true/false): Whether it's printing now
- `progress_percent` (number): How much of the print is done, 0 to 100
- `ready` (true/false): Whether it's connected and free to start a print
- `started_by` (text): The OctoPrint user who started the print
- `state` (text): The printer's state as OctoPrint shows it, such as Operational, Printing, Paused, Offline or Offline after error
- `summary` (text): One sentence saying all this, for a message
- `time_left` (text): The time left, such as 25 min
- `time_left_seconds` (number): OctoPrint's estimate of the time left, in seconds

**Example output**

```json
{
  "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**

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

**Outputs**

- `download_link` (text): A link to download it from OctoPrint (needs the API key)
- `folder` (text): The folder it went into; empty for the top
- `name` (text): The file's name in OctoPrint
- `path` (text): Its path in OctoPrint, for Start print and Delete file
- `printing` (true/false): Whether it started printing
- `size_bytes` (number): Its size in bytes

**Example output**

```json
{
  "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
}
```
