Automation status
Every pathway run exposes an automationStatus field. A run has one from the moment it is created. Use it to know whether work is waiting, in progress, or finished.
Two things to know up front:
automationStatusdescribes the run as a whole, never an individual step. A canceled step does not mean a canceled run.- Most runs follow one path:
queued→scheduled→running→completed. The other four values are the ways a run can pause or end early.
Values
Section titled “Values”| Value | Terminal | Meaning |
|---|---|---|
queued | No | Default status. The run has been created but not started. It waits until it is started, either automatically (autoStart), by a person, or by the start endpoint. No worker is assigned yet. |
scheduled | No | The run has been started and is waiting for an automation worker to pick it up. |
running | No | A worker is actively executing pathway steps. |
paused | No | Explicitly paused via API or UI. Resumable. |
completed | Yes | Required work finished successfully. |
errored | Yes | A node failed. Inspect error on the run. |
canceled | Yes | Ended before finishing at a caller’s request — an API cancel or a user canceling in the UI. |
stopped | Yes | Ended by MedFlow without completing, for example because the trigger was disabled or an operator halted it. |
A terminal status is final: the run will not move out of it. The API spells the value canceled, with one l.
Distinctions that matter
Section titled “Distinctions that matter”Queued vs scheduled
Section titled “Queued vs scheduled”Both are non-terminal and neither is executing, but they mean different things. queued is un-run: nobody has hit play, so nothing is scheduled to work it. scheduled means play has been hit and the run is waiting for an automation worker to claim it.
When a trigger has autoStart: true, a run moves from queued to scheduled on its own, so callers usually see scheduled or running rather than queued.
Canceled vs stopped
Section titled “Canceled vs stopped”Both are terminal and neither finished the work. canceled is caller-initiated: you called cancel, or a user canceled in the UI. stopped is MedFlow-initiated for operational reasons — the trigger was disabled, the tenant was suspended, or an operator halted the run.
Run status vs step status
Section titled “Run status vs step status”Steps have their own status, and it is separate from the run’s. A step can be canceled while the run continues normally.
When a run reaches a Decision node, a selection is made, either by a user or by an automation evaluating the run’s data. The pathway continues down the selected branch and the steps on every branch not taken are canceled. The run itself stays active and can still reach completed.
So canceled steps on unselected branches are expected, and they do not put the run into canceled or stopped.
Typical transitions
Section titled “Typical transitions”| From | To | How |
|---|---|---|
| (created) | queued | Default. The run exists but has not been started |
queued | scheduled | Started by autoStart, a person, or the start endpoint |
scheduled | running | An automation worker claims the run |
running | paused | Pause |
paused | running | Resume |
running | completed | Success |
running | errored | A node failed |
queued / scheduled / running / paused | canceled | Canceled by a caller |
queued / scheduled / running / paused | stopped | MedFlow halts the run |
Where status appears
Section titled “Where status appears”GET /v1/runs/:runId(one run)GET /v1/triggers/:triggerId/status(aggregate counts per trigger)
For polling patterns, see Monitoring runs.