step.runWorkflow(). This lets you compose complex processes from
smaller, reusable workflows — like splitting an order pipeline into separate
payment and shipping workflows.
The parent sleeps while the child runs, freeing its worker slot. When the child
finishes, the parent automatically resumes and receives the child’s output.
Basic Usage
Timeout
By default, the parent waits up to 1 year for the child to finish. You can customize this withoptions.timeout:
timeout accepts a duration string, a number
of milliseconds, or a Date:
Workflow Spec
The first argument accepts a workflow spec:Step Name
Setoptions.name to control the durable step name. If omitted, OpenWorkflow
uses the target workflow name.
Error Handling
If the child workflow fails, the parent workflow step also fails:Workflow steps do not retry automatically. The child workflow is responsible
for its own retries. If the child fails permanently, the error propagates to
the parent.
Parallel Child Workflows
Start multiple child workflows concurrently withPromise.all: