<Parallel> groups its children and executes them concurrently. All children start at the same time (subject to the concurrency limit) rather than waiting for the previous child to complete.
Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
maxConcurrency | number | Infinity | Maximum number of child tasks that can run simultaneously. When the limit is reached, remaining tasks wait until a running task completes before starting. |
skipIf | boolean | false | When true, the entire parallel group and all its children are skipped. The component returns null and no child tasks are mounted. |
children | ReactNode | undefined | The tasks and control-flow components to execute concurrently. |
Basic usage
lint, typecheck, and test — start at the same time and run concurrently.
Limiting concurrency
UsemaxConcurrency to control how many tasks run simultaneously. This is useful when tasks consume shared resources (API rate limits, database connections, CPU) and you want to avoid overloading them.
maxConcurrency={2}, at most two agent calls run at the same time. As each completes, the next queued task starts.
Combining with Sequence
<Parallel> and <Sequence> compose naturally. You can nest sequential chains inside a parallel group:
<Sequence> groups run in parallel. Within each group, tasks run sequentially. deploy-web waits for build-web, but build-api does not wait for build-web.
Conditional skipping
skipIf is true, the component returns null and none of the child tasks are included in the execution plan.
Rendering
Internally,<Parallel> renders as a <smithers:parallel> host element (or null when skipped). Each child task within the group receives a parallelGroupId and parallelMaxConcurrency in its task descriptor, which the scheduler uses to manage concurrent execution.
Notes
- When
maxConcurrencyis omitted or set toInfinity, all children start at the same time with no limit. - The parallel group completes when all children have finished (or failed, if
continueOnFailis set on individual tasks). <Parallel>can be nested inside<Sequence>,<Branch>,<Ralph>, or another<Parallel>.- An empty
<Parallel>(no children) is valid and completes immediately.