Monitoring runs
Every pathway run exposes an automationStatus. Poll it to decide when to retry, raise an alert, or move on to the next step.
Status values
Section titled “Status values”| Status | Terminal? | Meaning |
|---|---|---|
queued | No | Default. Created but not started (awaiting play or autoStart) |
scheduled | No | Started, waiting for an automation worker |
running | No | Work is actively executing |
paused | No | Paused via API or UI |
completed | Yes | Required work finished successfully |
errored | Yes | A node failed (see error on the run) |
canceled | Yes | Ended by the caller (API or UI) |
stopped | Yes | Ended by MedFlow without completing |
Details: Automation status.
Single run
Section titled “Single run”curl "https://api-staging.medflow.care/v1/runs/RUN_ID" \
-H "Authorization: Bearer $MEDFLOW_API_KEY"Requires runs:read.
Polling guidance
Section titled “Polling guidance”- Poll every 2 to 5 seconds while
running. - Back off to 15 to 30 seconds while
queued,scheduled, orpaused. - Stop when status is terminal.
- Use
If-None-Match/ETagwhen present.
Cancel, pause, resume
Section titled “Cancel, pause, resume”curl -X POST "https://api-staging.medflow.care/v1/runs/RUN_ID/cancel" \
-H "Authorization: Bearer $MEDFLOW_API_KEY"
curl -X POST "https://api-staging.medflow.care/v1/runs/RUN_ID/pause" \
-H "Authorization: Bearer $MEDFLOW_API_KEY"
curl -X POST "https://api-staging.medflow.care/v1/runs/RUN_ID/resume" \
-H "Authorization: Bearer $MEDFLOW_API_KEY"Requires runs:write. Each call is audited with your API key id.
Aggregate counts
Section titled “Aggregate counts”curl "https://api-staging.medflow.care/v1/triggers/TRIGGER_ID/status" \
-H "Authorization: Bearer $MEDFLOW_API_KEY"Aggregate counts are scoped to a trigger. Useful for monitoring and health checks without listing every run.
See Runs reference.