Parallel Component
The <Parallel> component enables concurrent execution of child components. By default, Steps within a Phase execute sequentially—wrap them in Parallel to execute simultaneously.
Experimental. Parallel execution works but has limitations with phase advancement. See limitations section below.
Basic Usage
import { Phase, Parallel, Step, Claude } from "smithers-orchestrator";
<Phase name="Build">
<Step name="build-parallel">
<Parallel>
<Step name="Frontend">
<Claude>Build the frontend application.</Claude>
</Step>
<Step name="Backend">
<Claude>Build the backend services.</Claude>
</Step>
</Parallel>
</Step>
</Phase>
Props
Child components to execute in parallel.
Examples
Parallel Build Tasks
<Phase name="Build">
<Step name="checks">
<Parallel>
<Step name="lint">
<Claude allowedTools={["Bash"]}>
Run the linter.
</Claude>
</Step>
<Step name="typecheck">
<Claude allowedTools={["Bash"]}>
Run TypeScript type checking.
</Claude>
</Step>
<Step name="test">
<Claude allowedTools={["Bash"]}>
Run the test suite.
</Claude>
</Step>
</Parallel>
</Step>
</Phase>
Mixed Sequential and Parallel
Aspirational example. Sequential Steps before/after Parallel may not sequence as expected with the current implementation. See Known Limitations.
<Phase name="CI">
<Step name="setup">
<Claude>Install dependencies.</Claude>
</Step>
<Step name="checks">
<Parallel>
<Step name="lint"><Claude>Run linting.</Claude></Step>
<Step name="test"><Claude>Run tests.</Claude></Step>
</Parallel>
</Step>
<Step name="deploy">
<Claude>Deploy to production.</Claude>
</Step>
</Phase>
With Worktree Isolation
<Parallel>
<Worktree branch="feature-a">
<Claude>Implement feature A.</Claude>
</Worktree>
<Worktree branch="feature-b">
<Claude>Implement feature B.</Claude>
</Worktree>
</Parallel>
How It Works
The Parallel component wraps children in a StepRegistryProvider with isParallel enabled. This signals to the orchestrator that child Steps should execute concurrently rather than waiting for each to complete before starting the next.
Known Limitations
Parallel completion semantics are experimental.
- Steps inside
<Parallel> use a separate step registry and don’t participate in the parent phase’s sequential step tracking
- A Phase containing only
<Parallel> Steps may not advance automatically - use Phase onComplete callback for explicit control
- The “Mixed Sequential and Parallel” example is aspirational - sequential Steps before/after Parallel may not sequence as expected with the current implementation
For reliable phase-based workflows, wrap each Phase’s content in explicit Steps:
<Phase name="Build" onComplete={() => advanceToNextPhase()}>
<Step name="parallel-builds">
<Parallel>
<Claude>Build frontend</Claude>
<Claude>Build backend</Claude>
</Parallel>
</Step>
</Phase>
Rendering
The Parallel component renders as a <parallel> element containing its children:
<parallel>
<step name="Frontend">...</step>
<step name="Backend">...</step>
</parallel>