Skip to main content
Version: 2.0 prerelease

Workflow Status

You can monitor the status of the workflow by calling the running() method, which returns true if the workflow is still running and false if it has completed or failed.

while ($workflow->running());

Status Values

The status() method returns string statuses:

reserved
pending
running
waiting
cancelled
terminated
completed
failed
  • reserved means an instance id has been created but the first start command has not been accepted yet
  • pending means the run exists and has work ready to be claimed
  • running means a workflow task is actively leased to a worker
  • waiting means the run is blocked on a durable resume source such as an activity, timer, or named signal
  • cancelled means an accepted engine-level cancel command closed the current run
  • terminated means an accepted engine-level terminate command force-closed the current run
  • completed, failed, cancelled, and terminated are terminal run states

When a run uses continueAsNew(), the old run ends with status = completed and closed_reason = continued. Waterline keeps that run in the completed bucket while still surfacing the exact closed_reason so operators can see that the instance rolled forward into a newer run.

running() returns true for pending, running, and waiting.

State Machine

This is the state machine for a workflow status.

Workflow Status State Machine
Workflow Status State Machine