1. Building Flows
  2. Passing Data

Data travels through the flow starting from the trigger until the last piece in the flow.

This allows flows to be so powerful as you can design each step to work with the flowing data.

We’ll go through both types in detail.

Steps Output

Each step of your flow has an input that flows in and an output that flows out.

You can use the output of any previous step in the currently selected step settings.

If the input is a text input then all you need to do is just click on the input and the dropdown with (Data to insert) will show.

title

If the input is of any other type you will notice a dynamic value button at the top right corner of the input which will turn it to a text input.

title

Example

We’ll add 2 code pieces, the first one will return a JSON object, and the second one will use it.

Using Steps Output

  1. Start a new flow.
  2. Set the trigger to anything (we’ll only run the flow through Test flow).
  3. Add a code piece, add the following code to it:
exports.codePiece = async (params) => {
    return {
        type: "alien",
        color: "green",
        age: 1200
    };
};
  1. Add another code piece, we want to pass the output of the previous code step to this one, and use it to construct a sentence.
  2. In the Parameters section of the piece settings, we’ll set the following parameters:

Pass Parameters to Code Piece

  1. We’ll use the 3 parameters in the “Params Example” step and the following code for the step:
exports.codePiece = async (params) => {
    return "I am a "+ params.color +" "+ params.type +" and I am "+ params.age +" years old!";
};
  1. Click on Test flow and watch the output of the second code piece. It will look like this: Output of a Code Piece Congratulations 🎉 You are now capable of passing data through flow steps!
If there is a step that has a property which is not present in the “Data to insert” dropdown, you can use the step name to resolve the path to it by typing ${step_name.path_to_property}. This is used with JSON inputs like the body of an HTTP request

Output of a Code Piece