Configure stages and add them to a flow
Configure when stages display to a user, define stage state labels, and add stages to a flow or subflows within Workflow Studio.
Before you begin
This task assumes that you are familiar with flow and subflow stages, stage fields, and stage sets. For more information about stages, see Flow and subflow stages.
Role required: flow_designer or admin
Procedure
- Optional:
If not already present, create a stage field on the table that triggers the flow.
A stage field stores and displays the stage state and details about a specific record as a flow or subflow runs. The Service Catalog Requested Items [sc_req_item] table has a stage field by default.
For a stage field to report stages on a record-based flow, a stage field must be present on the same table as the triggering record.
To add a field to a table, see Add and customize a field in a table.
- Optional:
If adding stages to a flow with a Service Catalog trigger,
select the flow in the Flow field of the Service Catalog
Item [sc_cat_item] table.
If using the Service Catalog trigger, the flow must be associated with the Service Catalog item through the Flow field. Remove any workflows associated with the item by clearing the Workflow and Execution Plan fields. This enables a request for a catalog item to initiate a flow specific to that catalog item.
-
Open the flow or subflow in Workflow Studio.
Note:While you can add stages to a flow that has a scheduled trigger, the stages are never displayed to an end user because there is no associated trigger record for the stage field. Only add stages to flows and subflows that have a trigger or input record.
-
Create and configure stages.
-
Click
and select Flow stages.
The Flow stages menu opens. - Optional:
From Add stages from a template, select a stage set to import existing stages from the Stage Sets table, and select Add stages.
To learn more about stage sets, see Workflow stage sets. Any changes made to the copy do not affect the original stage set record.
In general, use stage sets when you want to reuse stages across multiple flows or subflows.
-
Click Add new stage to manually create and configure stage options inline.
Field Description Name Display name for the stage. Must be unique. Value Internal name for the stage. Must be unique. Duration Estimated duration displayed to the user. If you want to update stages based on flow run times, consider adding one or more Wait for a duration flow logic blocks. For more information, see Wait for a duration flow logic. Always Show If selected, the stage always displays in the stage field, even if the stage is set within a flow logic block that might not execute. In general, create stages inline when you do not plan to reuse stages in other flows or subflows.
-
Order stages from top to bottom in the order you want the stage field
to display them.
The stage at the top appears first in the stage field, and the stage at the bottom appears last in the stage field.Note:If you create stages inline, the Flow Stages menu displays them in the order they were created, not in the order they appear in the flow.
-
Click
-
Add stages to the flow or subflow.
- Point to a location in the flow or subflow.
- Click Add a Stage.
- Select an existing stage.
Stages can be applied at the beginning of any Workflow Studio action or flow logic block, or within an If block.Important:Stages are unavailable from within a For Each flow logic block. You can only add stages before and after a For Each flow logic block. - Optional:
Create stages inline.
- Point to a location in the flow or subflow.
- Select Add a Stage.
- Select +.
Important:When you create stages inline, stage fields display the stages in the order they were created, not in the order they appear in the flow. To configure or change the order of stages you create inline, open the More Actions menu.
- Optional:
Set a stage to the Error state within a conditional flow logic block.
- Point to a location.
-
Select Set "Error" State.
Note the following requirements to set a stage to the Error stage:
- The flow or subflow must have at least one stage defined.
- The Error can only be set within a stage. When an Error condition is reached, the current stage is set to Error.
- The Error can only be set within a conditional flow logic block.
When the flow reaches the indicated point, the currently executing stage is set to Error in the stage field.