Basic steps
Thestep function takes a unique name and a handler. The return value is persisted and reused if the step has already completed:
Retries
Steps retry automatically on failure. Control the number of attempts withmaxAttempts (defaults to 5):
Sleep
Pause the workflow for a duration (in milliseconds) or until a specific time:Progress
Use.progress() to record a checkpoint without running any work. This is useful for observability when you want to mark milestones in a long handler:
Listen
Use.listen() to suspend the workflow and set its status to "listening". The workflow then waits to be resumed by an external event. You can specify this event by passing its name in as an argument:
Fail and abort
Use.fail() or .abort() to stop execution explicitly: