# Prefect

> Run your Prefect pipelines: run deployments with parameters, follow and wait for flow runs, cancel, retry and resume them, read their logs, pause deployments, set Variables, and start a workflow when a flow run fails, completes or starts late.

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

## Actions

### Cancel flow run

Cancel a flow run, as Prefect's Cancel button does: one waiting to start is cancelled at once, and the worker stops one that's running. A run that has finished is left as it is.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.

**Outputs**

- `changed` (true/false): Whether it changed; false if there was nothing to do
- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "changed": true,
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 133.518,
  "end_time": "",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": false,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 1,
  "start_time": "2026-01-31T06:00:04.112Z",
  "state": "Cancelling",
  "state_message": "Cancelled from Lodol",
  "state_type": "CANCELLING",
  "tags": [
    "finance"
  ],
  "work_pool": "default-pool"
}
```

### Delete Variable

Delete a Prefect Variable. One that isn't there is left as it is.

**Inputs**

- Variable (`name`, text, required): The Variable's name, as Prefect lists it under Variables: lowercase letters, numbers, dashes and underscores.

**Outputs**

- `deleted` (true/false): Whether it was deleted; false if there was none
- `name` (text): The Variable's name

**Example output**

```json
{
  "deleted": true,
  "name": "last_loaded_date"
}
```

### Get flow run

Get a flow run's state, parameters and times, with the message its state carries, such as the error it failed on.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.

**Outputs**

- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 133.518,
  "end_time": "2026-01-31T06:02:17.630Z",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": true,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 1,
  "start_time": "2026-01-31T06:00:04.112Z",
  "state": "Completed",
  "state_message": "",
  "state_type": "COMPLETED",
  "tags": [
    "finance"
  ],
  "work_pool": "default-pool"
}
```

### Get flow run logs

Get a flow run's log, its last lines oldest first, with the last error it logged.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.
- Lowest level (`min_level`, text): Leave out lines below this level. Defaults to every line. One of: `debug`, `info`, `warning`, `error`, `critical`. Default: `debug`.
- How many lines (`limit`, number): The most lines to get, the last ones, 1 to 1000. Defaults to 200. From 1 to 1000.

**Outputs**

- `count` (number): How many lines there are
- `error` (text): The last line of the last error logged; empty if none
- `flow_run_id` (text): The flow run's ID
- `lines` (list): The log lines, oldest first
- `link` (text): A link to the run in Prefect
- `log` (text): The lines as text, one a line
- `truncated` (true/false): Whether there may be earlier lines that were left out

**Example output**

```json
{
  "count": 2,
  "error": "KeyError: 'date'",
  "flow_run_id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "lines": [
    {
      "level": "INFO",
      "logger": "prefect.flow_runs",
      "message": "Beginning flow run 'venerable-beluga' for flow 'etl'",
      "task_run_id": "",
      "timestamp": "2026-01-31T06:00:04.200Z"
    },
    {
      "level": "ERROR",
      "logger": "prefect.flow_runs",
      "message": "Finished in state Failed\nKeyError: 'date'",
      "task_run_id": "",
      "timestamp": "2026-01-31T06:02:17.600Z"
    }
  ],
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "log": "2026-01-31T06:00:04.200Z INFO prefect.flow_runs: Beginning flow run 'venerable-beluga' for flow 'etl'\n2026-01-31T06:02:17.600Z ERROR prefect.flow_runs: Finished in state Failed\nKeyError: 'date'",
  "truncated": false
}
```

### Get Variable

Get a Prefect Variable's value.

**Inputs**

- Variable (`name`, text, required): The Variable's name, as Prefect lists it under Variables: lowercase letters, numbers, dashes and underscores.

**Outputs**

- `name` (text): The Variable's name
- `tags` (list): Its tags
- `updated` (text): When it was last changed (ISO 8601)
- `value` (object): Its value: text, a number, a switch, a list or an object
- `value_text` (text): Its value as text: text as it is, anything else as JSON

**Example output**

```json
{
  "name": "last_loaded_date",
  "tags": [],
  "updated": "2026-01-31T06:02:17Z",
  "value": "2026-01-30",
  "value_text": "2026-01-30"
}
```

### List deployments

List deployments by name, with whether each is paused, its schedules, its default parameters and its work pool.

**Inputs**

- Name contains (`search`, text): Only deployments whose name, or whose flow's name, has these letters, such as daily.
- Tags (`tags`, list): Only ones with all of these tags.
- Paused (`paused`, text): Every deployment, only active ones or only paused ones. One of: `any`, `active`, `paused`. Default: `any`.
- Work pool (`work_pool`, text): Only deployments whose runs go to this work pool.
- How many (`limit`, number): The most deployments to list, 1 to 200. Defaults to 25. From 1 to 200.

**Outputs**

- `count` (number): How many are listed
- `deployments` (list): The deployments, by name

**Example output**

```json
{
  "count": 1,
  "deployments": [
    {
      "description": "Loads yesterday's orders",
      "flow_name": "etl",
      "full_name": "etl/daily",
      "id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
      "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/deployments/deployment/14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
      "name": "daily",
      "parameters": {
        "date": null,
        "full_refresh": false
      },
      "paused": false,
      "schedules": [
        "cron 0 6 * * * (UTC)"
      ],
      "status": "READY",
      "tags": [
        "finance"
      ],
      "updated": "2026-01-30T17:21:09Z",
      "work_pool": "default-pool",
      "work_queue": "default"
    }
  ]
}
```

### List flow runs

List recent flow runs, the latest first, of every deployment or one, by state, tag and since when. Runs scheduled for later are listed only when you pick the Scheduled state.

**Inputs**

- Deployment (`deployment`, text): Only runs of this deployment. Leave blank for every run.
- States (`states`, list): Only runs in one of these states. Leave empty for all. A late run is Scheduled. One or more of: `SCHEDULED`, `PENDING`, `RUNNING`, `PAUSED`, `COMPLETED`, `FAILED`, `CRASHED`, `CANCELLING`, `CANCELLED`.
- Tags (`tags`, list): Only ones with all of these tags.
- Since (`since`, date and time): Only runs due to start at or after this time.
- How many (`limit`, number): The most runs to list, 1 to 200. Defaults to 25. From 1 to 200.

**Outputs**

- `count` (number): How many are listed
- `flow_runs` (list): The flow runs, the latest first

**Example output**

```json
{
  "count": 2,
  "flow_runs": [
    {
      "created": "2026-01-31T05:59:58.004Z",
      "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
      "deployment_name": "etl/daily",
      "duration_seconds": 133.518,
      "end_time": "2026-01-31T06:02:17.630Z",
      "expected_start_time": "2026-01-31T06:00:00Z",
      "finished": true,
      "flow_name": "etl",
      "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
      "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
      "name": "venerable-beluga",
      "parameters": {
        "date": "2026-01-30",
        "full_refresh": false
      },
      "run_count": 1,
      "start_time": "2026-01-31T06:00:04.112Z",
      "state": "Completed",
      "state_message": "",
      "state_type": "COMPLETED",
      "tags": [
        "finance"
      ],
      "work_pool": "default-pool"
    },
    {
      "created": "2026-01-31T05:59:58.004Z",
      "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
      "deployment_name": "etl/daily",
      "duration_seconds": 133.518,
      "end_time": "2026-01-31T06:02:17.630Z",
      "expected_start_time": "2026-01-31T06:00:00Z",
      "finished": true,
      "flow_name": "etl",
      "id": "3a2ec596-9d2c-4ee6-9ca3-316f0a38f6a6",
      "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/3a2ec596-9d2c-4ee6-9ca3-316f0a38f6a6",
      "name": "loutish-starling",
      "parameters": {
        "date": "2026-01-30",
        "full_refresh": false
      },
      "run_count": 1,
      "start_time": "2026-01-31T06:00:04.112Z",
      "state": "Failed",
      "state_message": "Flow run encountered an exception: KeyError: 'date'",
      "state_type": "FAILED",
      "tags": [
        "finance"
      ],
      "work_pool": "default-pool"
    }
  ]
}
```

### List work pools

List work pools, with whether a worker is polling each (Ready) and whether it's paused.

**Inputs**

- How many (`limit`, number): The most work pools to list, 1 to 200. Defaults to 25. From 1 to 200.

**Outputs**

- `count` (number): How many are listed
- `work_pools` (list): The work pools, by name

**Example output**

```json
{
  "count": 1,
  "work_pools": [
    {
      "concurrency_limit": "Unlimited",
      "description": "",
      "id": "e5748bdd-06da-43d2-8eed-a75313a58ca5",
      "is_paused": false,
      "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/work-pools/work-pool/default-pool",
      "name": "default-pool",
      "status": "READY",
      "type": "process"
    }
  ]
}
```

### Pause deployment

Pause a deployment, so its schedules make no runs until it's resumed. Runs going now carry on, and it can still be run by hand.

**Inputs**

- Deployment (`deployment`, text, required): The deployment: pick one, or type its name as flow/deployment (such as etl/daily) or its ID.

**Outputs**

- `changed` (true/false): Whether it changed; false if it was already so
- `description` (text): Its description; empty if none
- `flow_name` (text): The flow it runs
- `full_name` (text): Its full name, flow/deployment, such as etl/daily
- `id` (text): The deployment's ID
- `link` (text): A link to the deployment in Prefect
- `name` (text): The deployment's name
- `parameters` (object): Its parameters, with what each is by default
- `paused` (true/false): Whether it's paused, so its schedules make no runs
- `schedules` (list): Its schedules, such as cron 0 6 * * * (UTC)
- `status` (text): READY when a worker is polling for its runs, else NOT_READY
- `tags` (list): Its tags
- `updated` (text): When it was last changed (ISO 8601)
- `work_pool` (text): The work pool its runs go to
- `work_queue` (text): The work queue its runs go to

**Example output**

```json
{
  "changed": true,
  "description": "Loads yesterday's orders",
  "flow_name": "etl",
  "full_name": "etl/daily",
  "id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/deployments/deployment/14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "name": "daily",
  "parameters": {
    "date": null,
    "full_refresh": false
  },
  "paused": true,
  "schedules": [
    "cron 0 6 * * * (UTC)"
  ],
  "status": "READY",
  "tags": [
    "finance"
  ],
  "updated": "2026-01-30T17:21:09Z",
  "work_pool": "default-pool",
  "work_queue": "default"
}
```

### Resume deployment

Resume a paused deployment, so its schedules make runs again.

**Inputs**

- Deployment (`deployment`, text, required): The deployment: pick one, or type its name as flow/deployment (such as etl/daily) or its ID.

**Outputs**

- `changed` (true/false): Whether it changed; false if it was already so
- `description` (text): Its description; empty if none
- `flow_name` (text): The flow it runs
- `full_name` (text): Its full name, flow/deployment, such as etl/daily
- `id` (text): The deployment's ID
- `link` (text): A link to the deployment in Prefect
- `name` (text): The deployment's name
- `parameters` (object): Its parameters, with what each is by default
- `paused` (true/false): Whether it's paused, so its schedules make no runs
- `schedules` (list): Its schedules, such as cron 0 6 * * * (UTC)
- `status` (text): READY when a worker is polling for its runs, else NOT_READY
- `tags` (list): Its tags
- `updated` (text): When it was last changed (ISO 8601)
- `work_pool` (text): The work pool its runs go to
- `work_queue` (text): The work queue its runs go to

**Example output**

```json
{
  "changed": true,
  "description": "Loads yesterday's orders",
  "flow_name": "etl",
  "full_name": "etl/daily",
  "id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/deployments/deployment/14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "name": "daily",
  "parameters": {
    "date": null,
    "full_refresh": false
  },
  "paused": false,
  "schedules": [
    "cron 0 6 * * * (UTC)"
  ],
  "status": "READY",
  "tags": [
    "finance"
  ],
  "updated": "2026-01-30T17:21:09Z",
  "work_pool": "default-pool",
  "work_queue": "default"
}
```

### Resume flow run

Resume a flow run that paused to wait for someone, such as for an approval. A run that isn't paused is left as it is.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.
- Input (`run_input`, object): What the run asks for when it pauses for input, such as {"approved": true}. Leave blank for a run that only waits to be resumed.

**Outputs**

- `changed` (true/false): Whether it changed; false if there was nothing to do
- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "changed": true,
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 133.518,
  "end_time": "",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": false,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 1,
  "start_time": "2026-01-31T06:00:04.112Z",
  "state": "Running",
  "state_message": "",
  "state_type": "RUNNING",
  "tags": [
    "finance"
  ],
  "work_pool": "default-pool"
}
```

### Retry flow run

Run a finished flow run of a deployment again with the same parameters, as Prefect's Retry button does, such as after fixing what made it fail.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.

**Outputs**

- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 0.0,
  "end_time": "",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": false,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 1,
  "start_time": "",
  "state": "AwaitingRetry",
  "state_message": "Retried from Lodol",
  "state_type": "SCHEDULED",
  "tags": [
    "finance"
  ],
  "work_pool": "default-pool"
}
```

### Run deployment

Start a run of a deployment with the parameters you give, now or at a set time, as Prefect's Run button does. It doesn't wait for the run: follow it with Wait for flow run or Get flow run.

**Inputs**

- Deployment (`deployment`, text, required): The deployment: pick one, or type its name as flow/deployment (such as etl/daily) or its ID.
- Parameters (`parameters`, object): What the run gets as its parameters, such as {"date": "2026-01-31"}. Leave blank for the deployment's defaults; the ones you give replace those.
- Run name (`run_name`, text): A name for the run. Leave blank for one Prefect makes up, such as venerable-beluga.
- Tags (`tags`, list): Tags to add to the run, besides the deployment's own.
- Start at (`start_at`, date and time): When to start it. Leave blank to start it now.

**Outputs**

- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 0.0,
  "end_time": "",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": false,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 0,
  "start_time": "",
  "state": "Scheduled",
  "state_message": "",
  "state_type": "SCHEDULED",
  "tags": [
    "finance"
  ],
  "work_pool": "default-pool"
}
```

### Set Variable

Set a Prefect Variable that flows read, such as a date to load from or a list of recipients, making it if there's none.

**Inputs**

- Variable (`name`, text, required): The Variable's name, as Prefect lists it under Variables: lowercase letters, numbers, dashes and underscores.
- Value (`value`, text, required): What to set it to. A JSON object or list, such as ["a", "b"], is saved as one; anything else as text.
- Tags (`tags`, list): Tags for it. Leave empty to keep the ones it has.

**Outputs**

- `created` (true/false): Whether it was made, there being none with that name
- `name` (text): The Variable's name
- `tags` (list): Its tags
- `updated` (text): When it was last changed (ISO 8601)
- `value` (object): Its value: text, a number, a switch, a list or an object
- `value_text` (text): Its value as text: text as it is, anything else as JSON

**Example output**

```json
{
  "created": false,
  "name": "last_loaded_date",
  "tags": [],
  "updated": "2026-01-31T06:02:17Z",
  "value": "2026-01-30",
  "value_text": "2026-01-30"
}
```

### Wait for flow run

Wait until a flow run finishes (completes, fails, crashes or is cancelled) or pauses for someone, up to 15 minutes, then get it. A run still going when the wait is up carries on in Prefect.

**Inputs**

- Flow run (`flow_run_id`, text, required): The flow run's ID: pick a recent run, or use the id of an earlier step, such as Run deployment's.
- Wait up to (minutes) (`max_wait_minutes`, number): How long to wait, 1 to 15 minutes. Defaults to 5. From 1 to 15.

**Outputs**

- `created` (text): When it was created (ISO 8601)
- `deployment_id` (text): The ID of the deployment it was started from; empty if none
- `deployment_name` (text): The deployment, as flow/deployment; empty if none
- `duration_seconds` (number): How long it has run, in seconds
- `end_time` (text): When it finished (ISO 8601); empty until it does
- `expected_start_time` (text): When it was due to start (ISO 8601)
- `finished` (true/false): Whether it has completed, failed, crashed or been cancelled
- `flow_name` (text): The flow it runs
- `id` (text): The flow run's ID
- `link` (text): A link to the run in Prefect
- `name` (text): The run's name, such as venerable-beluga
- `parameters` (object): The parameters it runs with
- `run_count` (number): How many times it has run, retries included
- `start_time` (text): When it started (ISO 8601); empty until it does
- `state` (text): Its state as Prefect shows it, such as Scheduled, Late, Running, Completed, Failed, Crashed or Cancelled
- `state_message` (text): What Prefect says about the state, such as the error
- `state_type` (text): Its kind of state: SCHEDULED, PENDING, RUNNING, PAUSED, COMPLETED, FAILED, CRASHED, CANCELLING or CANCELLED (a Late run is SCHEDULED)
- `tags` (list): Its tags
- `timed_out` (true/false): Whether the wait ran out before the run finished or paused
- `waited_seconds` (number): How long the step waited, in seconds
- `work_pool` (text): The work pool it runs in

**Example output**

```json
{
  "created": "2026-01-31T05:59:58.004Z",
  "deployment_id": "14dee1f4-2cdf-4402-aa03-14cf5f4470d1",
  "deployment_name": "etl/daily",
  "duration_seconds": 133.518,
  "end_time": "2026-01-31T06:02:17.630Z",
  "expected_start_time": "2026-01-31T06:00:00Z",
  "finished": true,
  "flow_name": "etl",
  "id": "8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "link": "https://app.prefect.cloud/account/9b4c7f4e-2f6b-4a52-9d7d-1f3a2c4b5d6e/workspace/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b/runs/flow-run/8a1fb3da-6472-4344-be1a-f348ac2122b5",
  "name": "venerable-beluga",
  "parameters": {
    "date": "2026-01-30",
    "full_refresh": false
  },
  "run_count": 1,
  "start_time": "2026-01-31T06:00:04.112Z",
  "state": "Completed",
  "state_message": "",
  "state_type": "COMPLETED",
  "tags": [
    "finance"
  ],
  "timed_out": false,
  "waited_seconds": 135,
  "work_pool": "default-pool"
}
```
