Add a Return Action

The Return action is used to return a payload for an action chain and to return control back to where the action chain was called. For instance, action chain A can call action chain B, which returns a value, then action chain A can use that returned value for further processing.

The Return action can also be used to exit an action chain early due to an exception, such as an invalid value, or some other condition. If no value is returned by the Return action, the value of undefined is returned by default.

For the Run In Parallel action, which uses aysc() functions to run blocks of code in parallel, the Return action can be used to return a value for a block of code. For further details, see the Use 2: Run Multiple Action Chains in Parallel to Produce a Combined Result section here.

To use a Return action:

  1. Add the action in one of three ways, depending on your preference and where you want it added:
    • Drag the action from the Actions palette onto the canvas, dropping the action either at the bottom edge of the action it is to follow, or at the top edge of the action it is to precede.
    • Double-click the action in the Actions palette to add it to an empty canvas or to the end of an action chain.
    • On the canvas, select the action you want the new action to follow, then double-click the new action in the Actions palette.
  2. For the Payload property, hover over the far-right side of the property and click the down arrow that appears to choose the variable with the payload to return.