Skip to content

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:

  • automationStatus describes the run as a whole, never an individual step. A canceled step does not mean a canceled run.
  • Most runs follow one path: queuedscheduledrunningcompleted. The other four values are the ways a run can pause or end early.
ValueTerminalMeaning
queuedNoDefault 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.
scheduledNoThe run has been started and is waiting for an automation worker to pick it up.
runningNoA worker is actively executing pathway steps.
pausedNoExplicitly paused via API or UI. Resumable.
completedYesRequired work finished successfully.
erroredYesA node failed. Inspect error on the run.
canceledYesEnded before finishing at a caller’s request — an API cancel or a user canceling in the UI.
stoppedYesEnded 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.

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.

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.

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.

FromToHow
(created)queuedDefault. The run exists but has not been started
queuedscheduledStarted by autoStart, a person, or the start endpoint
scheduledrunningAn automation worker claims the run
runningpausedPause
pausedrunningResume
runningcompletedSuccess
runningerroredA node failed
queued / scheduled / running / pausedcanceledCanceled by a caller
queued / scheduled / running / pausedstoppedMedFlow halts the run
  • GET /v1/runs/:runId (one run)
  • GET /v1/triggers/:triggerId/status (aggregate counts per trigger)

For polling patterns, see Monitoring runs.