Skip to main content

Flow Control

Flow control actions let you manage how a Workforce content flow responds to different conditions, using decisions, loops and error handling.

tip

These descriptions cover the most commonly used inputs and outputs. Additional input and output variables may be available when designing flows.

Logic Decision
Link copied!

Branches the flow into different outcomes based on how your input matches the rules you configure.

Inputs: None

Outputs: None

How to use: For a Logic Decision, add one or more branches, then click Edit to configure rules for each branch.

This simple example shows a Logic Decision for deciding which background fill to use for different product images.

Logic Decision action example with two branches

tip

To help identify which branch is chosen during a flow run, give each branch a descriptive name.

Loop
Link copied!

Repeats the same steps for each item in a list, by adding a block where you can build a sub-flow, complete with its own entry and exit actions.

Inputs: Data (array)

Outputs: Results (array)

How to use:

Once you've added a Loop action, connect an array variable to the loop's Data property - the loop will iterate through the array, invoking the sub-flow for each item.

Loop action example for modifying image tags

Within the Loop sub-flow, add an action and connect it’s in port to the For Each Item port of the Loop: Start action.

Connect the out port of the action in the sub-flow to the Next Item port of the Loop:End action.

Finally, if you want the loop to map the items in the sub-flow to a results array, assign the output of one of the actions in the loop to the Results property.

The results list is available in the Variable picker to actions outside of the sub-flow via the Processed Data array.

Featured in these example flows

Handle Errors
Link copied!

Creates a sub-flow that manages what should happen when errors occur, by adding a block where you can build a sub-flow, complete with its own entry and exit actions.

Inputs: Uses the inputs of the first action in the sub-flow

Outputs: Success (the output of the last action in the sub-flow) and Error message (string). Note, subsequent actions can be added to the Error port to handle errors.

How to use:

When you add the Handle Errors action to a flow, place any actions inside the sub-flow that require specific handling if they fail.

This example shows the Handle Errors action being used when alt text can't be generated for an image:

Handle Errors action example