Skip to main content

Documentation Index

Fetch the complete documentation index at: https://smithers.sh/llms.txt

Use this file to discover all available pages before exploring further.

import { Branch } from "smithers-orchestrator";

type BranchProps = {
  if: boolean;
  then: ReactElement;
  else?: ReactElement;
  skipIf?: boolean;
};
<Workflow name="deploy-pipeline">
  <Task id="test" output={outputs.test}>
    {{ passed: true }}
  </Task>

  <Branch
    if={ctx.output(outputs.test, { nodeId: "test" }).passed}
    then={
      <Task id="deploy" output={outputs.deploy}>
        {{ url: "https://prod.example.com" }}
      </Task>
    }
    else={
      <Task id="notify-failure" output={outputs.notifyFailure}>
        {{ message: "Tests failed, skipping deploy." }}
      </Task>
    }
  />
</Workflow>

Notes

  • if re-evaluates every render frame; read completed-task outputs via ctx.outputMaybe().
  • Each branch takes one element; wrap multiples in <Sequence> or <Parallel>.
  • Unselected branch tasks are absent from the task graph.