Skip to main content
import { Parallel } from "smithers-orchestrator";

Props

PropTypeDefaultDescription
idstringundefinedOptional stable id for tracking and deduping.
maxConcurrencynumberInfinityMax simultaneous children. Remaining tasks queue until a slot opens.
skipIfbooleanfalseSkip the entire group. Returns null; no children are mounted.
childrenReactNodeundefinedTasks and control-flow components to execute concurrently.

Basic usage

<Workflow name="checks">
  <Parallel>
    <Task id="lint" output={outputs.lint}>
      {{ errors: 0 }}
    </Task>
    <Task id="typecheck" output={outputs.typecheck}>
      {{ passed: true }}
    </Task>
    <Task id="test" output={outputs.test}>
      {{ passed: true }}
    </Task>
  </Parallel>
</Workflow>

Limiting concurrency

<Parallel maxConcurrency={2}>
  <Task id="analyze-repo-1" output={outputs.analyzeRepo1} agent={analyst}>
    Analyze repository alpha.
  </Task>
  <Task id="analyze-repo-2" output={outputs.analyzeRepo2} agent={analyst}>
    Analyze repository beta.
  </Task>
  <Task id="analyze-repo-3" output={outputs.analyzeRepo3} agent={analyst}>
    Analyze repository gamma.
  </Task>
  <Task id="analyze-repo-4" output={outputs.analyzeRepo4} agent={analyst}>
    Analyze repository delta.
  </Task>
</Parallel>
At most two agent calls run simultaneously. As each completes, the next queued task starts.

Combining with Sequence

<Workflow name="ci">
  <Parallel maxConcurrency={3}>
    <Sequence>
      <Task id="build-web" output={outputs.buildWeb}>{{ ok: true }}</Task>
      <Task id="deploy-web" output={outputs.deployWeb}>{{ ok: true }}</Task>
    </Sequence>
    <Sequence>
      <Task id="build-api" output={outputs.buildApi}>{{ ok: true }}</Task>
      <Task id="deploy-api" output={outputs.deployApi}>{{ ok: true }}</Task>
    </Sequence>
  </Parallel>
</Workflow>
The two <Sequence> groups run in parallel. Within each, tasks run sequentially.

Conditional skipping

<Parallel skipIf={!ctx.input.runChecks}>
  <Task id="lint" output={outputs.lint}>{{ errors: 0 }}</Task>
  <Task id="test" output={outputs.test}>{{ passed: true }}</Task>
</Parallel>

Rendering

<Parallel> renders as a <smithers:parallel> host element (or null when skipped). Each child receives parallelGroupId and parallelMaxConcurrency in its task descriptor.

Notes

  • Omitting maxConcurrency (or setting Infinity) starts all children simultaneously.
  • The group completes when all children finish (or fail, if continueOnFail is set on individual tasks).
  • Nestable inside <Sequence>, <Branch>, <Loop>, or another <Parallel>.
  • An empty <Parallel> is valid and completes immediately.