Skip to main content
A weekly report can prepare a draft and sources independently, but composition needs both results. Declare multiple entries for independent tasks and join for the upstream results required by composition.

Run two entries and one join

Save as parallel.mjs and run node parallel.mjs in a directory with the SDK installed:
The output is completed, and the composed result contains the draft and sources. compose creates an action only after both dependencies finish. Completion order can vary while the join condition remains the same. Multiple entries or multiple success transitions make work ready together. runUntilBlocked executes actions sequentially; a parallel graph does not automatically create threads or concurrent model calls. For actual concurrency, the host claims ready Actions separately and reports each result using its original identity.

Select a result-specific branch

Add a rejection path to the approval step in the quickstart:
Also declare revise in steps and register its handler. Approval choices should include approved and rejected. Ordinary success edges may omit on; known failures use on: ‘failed’. Use a transition handler for more complex business conditions; see business state and loops.

Avoid a join that never finishes

Each join dependency must name an actual upstream step with a transition into the join. Mutually exclusive branches will not all execute, so do not require them together in a join. The graph cannot prevent conflicting writes to one file. Give parallel tasks separate files or workspaces and combine results afterward. Declare ordering when shared writes must happen sequentially.
Last modified on October 22, 2026