Skip to main content

Run two checks in parallel

After the review, a reviewer can file the document and check its references in either order. Start from your choice model, the completed choice model or the completed parallel model.

  1. After the exclusive merge, insert a Parallel Gateway with an outgoing flow to each new User Task: Check references (ID checkReferences) and File document (ID fileDocument).
  2. Assign both tasks to reviewer. Join their outgoing flows at a second Parallel Gateway and connect that gateway to the end event.
  3. Compare the gateway pairs. The exclusive pair selects and merges a single token. The parallel split creates work on both branches, and its join waits for a token from each incoming branch.

Deploy your parallel model and run it twice.

Terminal window
node run-workflow.ts tutorial parallel summary references-first
node run-workflow.ts tutorial parallel detailed file-first

Each run performs exactly one review, then starts the two checks. After completing the first check, the helper verifies that the process is still active. The second check releases the join. The order is a choice for the worker, so reversing it produces the same completion. The parallel routing contract describes which split and join structures the engine supports.

Watch where the first token waits in the interactive split and join.

Continue to add data and a Service Task.