<Sequence> groups its children and executes them one at a time, in order, from top to bottom. Each child must complete before the next one starts.
Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
skipIf | boolean | false | When true, the entire sequence 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 sequentially. |
Usage
fetch runs first. Only after it completes does transform start. store runs last.
When to use Sequence explicitly
<Workflow> already sequences its direct children implicitly, so a top-level <Sequence> is optional. You need an explicit <Sequence> when you want to enforce ordering inside other control-flow components:
<Sequence> groups run in parallel with each other, but the tasks within each group run sequentially.
Conditional skipping
UseskipIf to conditionally bypass an entire group of tasks:
skipIf is true, the component returns null. None of the child tasks are mounted into the workflow graph, so they do not appear in the execution plan at all.
Rendering
Internally,<Sequence> renders as a <smithers:sequence> host element (or null when skipped). The runtime traverses the element tree and assigns ordinals to tasks in the order they appear.
Notes
- Child ordering matches JSX source order. The first child in the JSX runs first.
<Sequence>can be nested inside<Parallel>,<Branch>,<Ralph>, or another<Sequence>.- An empty
<Sequence>(no children) is valid and produces no tasks.