Use Set Next Stage to choose which stage the nearest enclosing Branch by Stage runs after the current stage finishes, or to leave that stage flow. The target can be a configured stage, a Text variable that resolves to a stage key, or Exit this stage flow.
Step Library: Workflow > Instance Management
When to use this step
Use this step when you want to:
- move from the current stage to another stage in the nearest enclosing Branch by Stage;
- choose the next stage dynamically from a Text variable; or
- leave the current stage flow after its remaining child steps finish.
Common examples include:
- moving a document from Draft to Review;
- returning work from Review to Draft when corrections are required; or
- leaving a staged process after its final stage completes.
Use Branch by Value instead when one value should select a single branch without transitioning between stages.
Before you begin
This step does not require a connection or special permissions.
Place it within a stage of Branch by Stage, either directly or inside a nested branch, group, loop, or parallel path. If Next stage uses a variable, create or identify a Text variable whose runtime value exactly matches a configured Stage key, including letter case.
Configure the step
- Add Set Next Stage from Workflow > Instance Management within a Branch by Stage stage.
- Select the step to open its configuration panel.
- Under General, select the required Next stage:
- select a configured stage;
- select a Text variable; or
- select Exit this stage flow below the divider after the configured stages.
- Save or publish the workflow.
Settings
| Setting | Required | Accepted values | Visible when | Description |
|---|---|---|---|---|
| Next stage | Yes | One configured stage, one Text variable, or Exit this stage flow | Always | Selects the pending transition for the nearest enclosing Branch by Stage. The default is No stage selected. A fixed stage selection uses the stage's stable identity, so relabeling or reordering the stage does not change the target. A Text variable is evaluated when the step runs and must exactly match a configured Stage key, including letter case. Exit this stage flow leaves the nearest enclosing Branch by Stage after the current stage finishes. |
The variable picker offers Text variables only. A fixed selection becomes invalid if its target stage is deleted.
Data and outputs
Workflow variable effects
This step does not modify workflow variables.
When Next stage uses a Text variable, the step reads its current value without replacing, appending, or clearing it. The variable retains its value and existing scope. A workflow variable remains available to later child steps, later stages, and steps after Branch by Stage; other Text sources retain their normal, potentially narrower scope.
Step outputs
This step does not expose step outputs.
The pending stage selection is flow-control state owned by the enclosing Branch by Stage. It is not available as a previous-step output.
Runtime behavior
Execution and completion
When Set Next Stage runs, Flowifier:
- reads the fixed selection or resolves the selected Text variable;
- stores the result as the pending transition for the current stage path; and
- marks Set Next Stage as Finished.
The transition does not happen immediately. Child steps after Set Next Stage in the current stage continue to run. After the stage finishes, the nearest enclosing Branch by Stage consumes the pending transition and either runs the selected stage or, for Exit this stage flow, continues with the next step after the stage container.
If more than one Set Next Stage runs sequentially in the same path before the stage finishes, the last selection replaces the earlier pending selection.
The step does not call an external provider and has no external side effects.
Branches and child steps
This step does not have branches or child steps.
It can run inside a branch, group, loop, or Run in Parallel path within the nearest enclosing Branch by Stage. Parallel paths use isolated pending transitions:
- if no parallel path selects a target, an earlier pending selection in the enclosing path remains unchanged;
- one path that selects a target propagates that target after all paths finish;
- multiple paths that select the same stage propagate their shared target; and
- multiple paths that select different stages fail Run in Parallel instead of choosing a target based on completion order.
Fixed selections and Text values that resolve to the same configured stage count as the same target.
Failure, retry and resume behavior
Set Next Stage does not suspend execution or perform automatic retries.
If a later child step suspends the workflow before the stage finishes, the pending transition is stored with the enclosing stage or parallel execution state. After resume, execution continues from the suspended child without replaying the completed Set Next Stage action.
If a child step fails, is cancelled, terminates the workflow, or ends the workflow before the enclosing stage consumes the transition, that result is propagated and the pending transition is not used. Set Next Stage does not cancel or terminate the workflow by itself.
Errors and limits
| Situation | Result | Resolution |
|---|---|---|
| Next stage is not selected | The Designer marks the required setting as invalid, and the workflow cannot be published. | Select a configured stage, a Text variable, or Exit this stage flow. |
| A fixed Next stage selection refers to a deleted stage | The Designer shows Next stage does not exist, and the workflow cannot be published. | Select an existing stage or Exit this stage flow. |
| A referenced Text variable was deleted or is no longer accessible | The Designer reports an invalid variable reference, and the workflow cannot be published. | Select an accessible Text variable or use a fixed target. |
| A selected Text variable is empty or unavailable at runtime | Set Next Stage fails, and the activity reports: “The Next stage value is empty or unavailable. Set the selected Text variable to a configured Stage key, then try again.” | Set the variable to an exact configured Stage key before the step runs. |
| A selected Text value does not match a configured Stage key | Set Next Stage finishes, the remaining steps in the current stage run, and Branch by Stage then fails. The Branch by Stage activity reports: “The Next stage value does not match a configured Stage key. Stage key matching is case-sensitive; check the value and try again.” | Correct the value, including letter case, so that it exactly matches a configured Stage key. |
| Parallel paths select different next stages | Run in Parallel fails, the enclosing Branch by Stage propagates the failure, and the workflow instance becomes faulted. The activity reports: “Parallel paths selected different next stages. Make all Set Next Stage actions select the same stage, or ensure only one path sets it.” | Make every writing path select the same stage, or ensure that only one parallel path runs Set Next Stage. |
This step has no additional limits beyond the general workflow limits and the 1,000-stage-execution guard of the enclosing Branch by Stage.
Example
Move from draft to review
Goal: Finish the remaining Draft steps and then run the Review stage.
Configuration:
- Enclosing Branch by Stage stage:
Draft -
Next stage:
Review
Add Set Next Stage before the final child steps that should still run in Draft.
Result: Set Next Stage finishes, the remaining Draft child steps run, and Branch by Stage then starts Review. The step does not change any workflow variable or expose a step output.
Related information
- Branch by Stage — configure the stages that Set Next Stage can select.
- Run in Parallel — understand how parallel paths execute before their next-stage selections are combined.
- Workflow variables — provide a Text stage key dynamically without changing the source variable.
Comments
0 comments
Please sign in to leave a comment.