Distributed Workflow Orchestration Platform  ·  View 16 of 31  ·  Runtime

Task State Machine

Every state a task can be in, every legal transition, and the three that are terminal.

Editable source SVG draw.io All views
Created
Created
PENDING
dependencies unmet
PENDING...
Dispatched
Dispatched
SCHEDULED
outbox published
SCHEDULED...
WAITING_SLOT
concurrency deferred
WAITING_SLOT...
Executing
Executing
RUNNING
lock held · renewed
RUNNING...
Handler outcome?
Handler outcome?
Lease lost
worker died
Lease lost...
Outcome
Outcome
COMPLETED
terminal
COMPLETED...
CANCELLED
terminal
CANCELLED...
TIMED_OUT
task or workflow deadline
TIMED_OUT...
Failure triage
Failure triage
Retryable class?
transient vs permanent
Retryable class?...
Attempts remaining?
maxAttempts 5
Attempts remaining?...
Terminal
Terminal
RETRY_SCHEDULED
backoff + jitter
RETRY_SCHEDULED...
DEAD_LETTERED
terminal · operator owned
DEAD_LETTERED...
deps met
deps met
at limit
at limit
slot freed
slot freed
lock acquired
lock acquired
lock expiry
lock expiry
redelivered
redelivered
success
success
cancel signal
cancel signal
failure
failure
deadline
deadline
transient
transient
permanent
permanent
yes
yes
exhausted
exhausted
if retryable
if retryable
after delay
after delay
Task State Machine — Transitions, Guards and Terminal States
Task State Machine — Transitions, Guards and Terminal States
Application we own
Application we own
Decision point
Decision point
Risk / gap
Risk / gap
synchronous
synchronous
failure / alternate
failure / alternate
event / async
event / async
v 1.0 · owner Data & AI Global Practice · date 2026-08
v 1.0 · owner Data & AI Global Practice · date 2026-08
Text is not SVG - cannot display

Decisions

  • Transitions are validated, not merely applied. An ETag-guarded write with a legality check means an out-of-order message is rejected rather than silently overwriting a later state — the difference between eventual consistency and eventual corruption.
  • COMPLETED, CANCELLED and DEAD_LETTERED are the only terminal states. TIMED_OUT and FAILED route into retry triage, because a timeout is usually a transient condition wearing a different name.
  • WAITING_SLOT is a real state rather than queue delay. Making backpressure visible in the state machine is what allows an operator to distinguish 'the platform is saturated' from 'the platform is broken'.

Guards

  • Lease lost returns a task to SCHEDULED, not to FAILED. The worker died; the task did not fail, and the attempt count is not burned.
  • A permanent error class skips the retry budget entirely and dead-letters on the first attempt. Retrying a 400 five times is five ways to be wrong slower.
  • Cancellation is checked at dispatch and again at receipt, so a cancelled execution's in-flight tasks are dropped rather than run to completion (view 18).

Assumptions

  • Every transition emits an event, so this diagram and the event log in view 12 are the same machine viewed twice.
  • Task-level and workflow-level deadlines are both configurable; the workflow deadline wins and cancels its outstanding tasks.
  • Compensation on failure is a workflow-authoring pattern, not a platform state. There is no automatic rollback, and that is a deliberate V1 boundary.