Jun Ren Cheong
08/21/2025, 5:01 AMMarvin
08/21/2025, 5:01 AMMarvin
08/21/2025, 5:06 AMprefect.flow-run.paused
)
- Add filters as needed (flow name, deployment, tags, etc.)
- Action
- Choose: Resume flow run
- Optional: Provide Run input (JSON) if your flow expects it when resuming
- Save
Notes
- If your flow paused with a required run input schema (e.g., you used a pause step that prompts for input), you must provide matching JSON in the action’s “Run input” or the resume will fail.
- You can optionally add a delay to the automation if you want to resume after some time rather than immediately.
API option (if you prefer programmatic control)
- Use the REST endpoint to resume a flow run. Provide the flow_run_id
and optional run_input
.
Docs: Resume flow run (REST API)
Examples
- Prefect Server (local/default):
curl -X POST \
"<http://127.0.0.1:4200/api/flow_runs/<FLOW_RUN_ID>/resume>" \
-H "Content-Type: application/json" \
-d '{"run_input": {"approved": true}}'
- Prefect Cloud:
curl -X POST \
"<https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>/flow_runs/<FLOW_RUN_ID>/resume>" \
-H "Authorization: Bearer <PREFECT_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"run_input": {"approved": true}}'
Follow-up
- Do you want the run to resume immediately upon pausing, after a delay, or only when certain conditions are met?
- Does your paused step require a specific run_input
? If so, share the schema or an example and I can help you configure the action JSON.Jun Ren Cheong
08/21/2025, 5:08 AMMarvin
08/21/2025, 5:08 AMMarvin
08/21/2025, 5:10 AMprefect.flow-run.paused
event). In the UI, the only optional field you’ll typically provide is the “Run input” JSON if your paused step expects input.
If you ever need to resume a different flow run (not the one that triggered the automation), use a generic HTTP/Webhook action and call the REST API yourself with the desired `flow_run_id`:
- REST docs: Resume flow run (REST API)
Example (Cloud):
curl -X POST \
"<https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>/flow_runs/<FLOW_RUN_ID>/resume>" \
-H "Authorization: Bearer <PREFECT_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"run_input": {"approved": true}}'
Jun Ren Cheong
08/21/2025, 5:14 AMMarvin
08/21/2025, 5:15 AMMarvin
08/21/2025, 5:18 AMflow_run_id
in the action.
- Prefect 3 doesn’t support creating automations via a YAML-importing CLI command. You create them in the UI or via the REST API (JSON). You can author the payload in YAML if you want, then convert to JSON for the API call.
Below is an example “shape” of the automation as YAML, followed by the exact JSON you can POST to the API. The YAML is illustrative; the API accepts JSON.
Example YAML (illustrative)
name: Resume paused flow runs
enabled: true
description: Automatically resume any flow run when it enters Paused
trigger:
type: event
# Listen for flow runs entering the Paused state
match:
- event: prefect.flow-run.paused
# Optional: add narrowing filters (flow name, deployment name, tags, etc.)
# filters:
# flow_names: ["my-flow"]
# deployment_names: ["my-deployment"]
actions:
- type: resume_flow_run
# Optional input if your pause step expects it
run_input:
approved: true
Equivalent JSON to create via REST
{
"name": "Resume paused flow runs",
"enabled": true,
"description": "Automatically resume any flow run when it enters Paused",
"trigger": {
"type": "event",
"match": [
{ "event": "prefect.flow-run.paused" }
]
// Optionally add filters here if you want to scope to certain flows/deployments/tags
},
"actions": [
{
"type": "resume_flow_run",
"run_input": { "approved": true }
}
]
}
API endpoints
- Prefect Cloud:
- POST https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>/automations
- Prefect Server (local/default):
- POST http://127.0.0.1:4200/api/automations
Docs
- Create automation (REST)
- Resume flow run (REST)
Example curl (Cloud)
curl -X POST \
"<https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>/automations>" \
-H "Authorization: Bearer <PREFECT_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Resume paused flow runs",
"enabled": true,
"trigger": {
"type": "event",
"match": [{ "event": "prefect.flow-run.paused" }]
},
"actions": [
{
"type": "resume_flow_run",
"run_input": { "approved": true }
}
]
}'
Note on CLI: there is no prefect automation create --from-file
in Prefect 3.x; prefect automation
currently supports listing, inspecting, enabling/pausing, and deleting existing automations.
If you want to scope this automation to only certain flows/deployments or add a delay before resuming, tell me the criteria and I’ll tailor the payload.