Flow control

Prev Next

Wait

The Wait node serves as a flow controller within the Workflow editor, allowing for the delay of workflow progression. It’s commonly employed to ensure synchronization of data and communication with remote services is completed before advancing to the next node.

By double-clicking the Wait node, you can specify the amount of time and the time period (minutes, hours, and days). The minimum time value is 1 minute, and there is no maximum limit.

You can monitor workflow executions currently paused by a Wait node under the Running workflows tab.

Wait output

The then output serves as the point where all subsequent workflow nodes should be connected.

What happens if you change or inactivate the workflow?

  • Inactivation: If you inactivate the workflow, new runs will stop, but workflows that are already waiting will continue.

  • Impact of changes: Workflows run based on a snapshot taken when they start. Any changes you make will only apply to new runs, not to workflows that are already waiting.


Variable assign

The Variable assign node makes a value available to later nodes on the same branch during the current workflow run.

  • Set the name of the new variable
    This name is used to reference the variable in subsequent filters and actions.

  • Define the value of the variable
    Enter a fixed value or an expression. An expression can read transported data or use Volt to calculate the value.

These examples illustrate how the date of the purchase can be calculated and stored in a variable.

Variable assign output

The success output serves as the point where all subsequent workflow nodes should be connected.

Example: Add customers to different lists based on the claimed reward

This workflow uses a custom entity to map each reward ID to a customer list ID. The reward event includes the ID of the claimed reward in event.reward event attribute.

Entity lookup uses this value to find the matching mapping record. This lets one workflow path use one Add to list action for different rewards instead of creating a separate branch for each reward. See the reward event.

Reward claimed

reward_id in the mapping

list_id in the mapping

Coffee voucher

Coffee voucher reward ID

Coffee fans list ID

Cinema voucher

Cinema voucher reward ID

Movie fans list ID

Create a custom entity with the ID reward_list_mapping and two string attributes: reward_id and list_id. Mark reward_id as unique so it can be used as the Entity lookup filter. Add one mapping record for each reward in the table, using the reward's actual ID and the ID of its destination list. Add or update a mapping record whenever a reward is added or its destination list changes. See Custom entities.

Configure the workflow to run on the reward event. Add an Entity lookup node and set it up as follows:

  • Select reward_list_mapping as the entity type and reward_id as the filter attribute.

  • Enter {event.reward} as the lookup value. This is the ID of the reward claimed in this workflow run.

  • Enter reward_mapping as the transport variable name. Later nodes can use this name to refer to the mapping record returned by the lookup.

Add a Variable assign node before Add to list and configure its fields. This node copies the mapped list ID into a workflow variable that Add to list can select.

  • Enter target_list in Name. This is the variable you will select in Add to list.

  • Enter {reward_mapping.list_id} in Value. This expression reads the destination list ID from the mapping record added to transport by Entity lookup.

Connect Add to list to the success output of Variable assign. In the list field, select Dynamic value and choose target_list.