Workflows

Workflows are the durable unit of work in Mobius. A workflow is a definition; a run is a single execution of that definition. Runs survive restarts, retries, and human review, and every state transition is checkpointed so you can replay or resume them.

The pieces

A workflow is made of:

  • Steps — discrete units of work, each handled by a worker
  • Branches — conditional paths through the workflow
  • Pauses — explicit waits for signals, timers, or human input
  • Signals — typed messages a workflow can receive while paused

A simple workflow

name: onboard-customer
steps:
  - id: provision-account
    worker: account-provisioner
    input:
      email: $.input.email
  - id: send-welcome
    worker: email-sender
    input:
      to: $.input.email
      template: welcome

When you trigger this workflow, Mobius creates a run, claims provision-account for the first available worker named account-provisioner, waits for it to complete, then proceeds to send-welcome.

Failure handling

Every step has a retry policy. By default, transient failures retry with exponential backoff. Permanent failures (raised explicitly by the worker) skip retries and either fail the run or branch into a recovery path.

Error typeRetried?Default behavior
TemporaryYesExponential backoff, max 5 attempts
PermanentNoMark step failed, fail run
TimeoutYesExponential backoff, max 3 attempts

See the Worker SDK errors guide for how to raise each kind.

See also