Skip to main content
Branching allows an action to direct the flow to one of several downstream paths based on the outcome of its perform function. This is useful for routing logic like “if the record already exists, update it; otherwise, create it.”

Enabling branching on an action

Set allowsBranching: true on the action definition. The perform function must then return an ActionPerformBranchingDataReturn, which extends the standard return with a required branch field:

Static branches

Use staticBranchNames when the set of possible branches is known at component-authoring time. The branch value returned by perform must exactly match one of the names in staticBranchNames:

Dynamic branches

Use dynamicBranchInput when the set of branches is not known at authoring time — for example, when they are driven by user configuration. Set dynamicBranchInput to the key of an input whose value at runtime contains the branch name to take.
When using dynamicBranchInput, omit staticBranchNames. The Prismatic UI will read the selected value from the specified input field to determine which branch to draw.

Branching in triggers

Triggers support the same branching fields as actions: allowsBranching, staticBranchNames, and dynamicBranchInput. When a trigger branches, it uses TriggerBranchingResult:

How branches work in the integration builder

When an action has allowsBranching: true, the Prismatic integration builder renders branch handles on the step. Each branch becomes a separate downstream path:
  • Static branches (staticBranchNames): The UI shows one labeled handle per name in the array. The handles appear as soon as the step is added to the flow.
  • Dynamic branches (dynamicBranchInput): The UI reads the value of the specified input at design time to determine which handles to draw. The integration builder provides the branch names by configuring the designated input.
The string returned in branch at runtime must exactly match one of the branch handles configured in the integration. If it does not match, the execution will fail.