Set Variable

Store and transform data for use in your flow

Overview

The Set Variable utility allows you to create named variables that store data for use throughout your flow. You can combine data from multiple sources, transform values, or create new data structures.

Variables set here are available to all subsequent nodes in the flow using template syntax.

Configuration

Variable Name

A descriptive name for your variable. Use camelCase for consistency.

userFullName

Value

The value to store. Can be static text, templates, or expressions.

{{#1.data.firstName}} {{#1.data.lastName}}

Type

Specify the data type for automatic conversion:

  • text - String value (default)
  • number - Numeric value
  • boolean - True/false value
  • array - JSON array
  • collection - JSON object

Multiple Variables

You can set multiple variables in a single node. Click "Add Variable" to add more.

Output

All set variables are available in the output:

Accessing variables:

  • {{#N.variableName}} - Where N is the node number
  • {{#3.userFullName}} - Example: access userFullName from node 3

Examples

Example 1: Combine Data

Create a full name from first and last name:

Variable Name:fullName
Value:{{#1.firstName}} {{#1.lastName}}

Example 2: Create Object

Build a structured object from multiple sources:

Variable: apiPayload
{
  "user": "{{#1.data.userId}}",
  "action": "update",
  "timestamp": "{{now}}",
  "data": {{#2.data}}
}

Example 3: Multiple Variables

Set several related variables at once:

baseUrlhttps://api.example.com
endpoint/users/{{#1.data.id}}
fullUrl{{baseUrl}}{{endpoint}}

Tips

Tip: Use Set Variable at the start of your flow to define configuration values that might change (API URLs, thresholds, etc.).

Tip: Give variables clear, descriptive names. This makes your flow easier to understand and maintain.

Note: For complex data transformations, consider using the Code utility instead of multiple Set Variable nodes.

Set Variable Utility - Flows Guide - Serenities