Skip to main content
Use a plain boolean for if: the example above reads immutable run input, so there’s no stale-read hazard. For a condition depending on an upstream task, read with ctx.outputMaybe(...) and coalesce the missing first-frame value:

Notes

  • if re-evaluates every render frame: run input is immutable, but task outputs only become visible once they persist, so read incomplete upstream outputs with ctx.outputMaybe() rather than ctx.output().
  • Each branch takes one element; wrap multiples in <Sequence> or <Parallel>.
  • Unselected branch tasks are absent from the task graph.
  • <Branch> takes no children; pass branches via then/else. <Branch>...</Branch> throws INVALID_INPUT instead of silently dropping children.