Using Local Variables in FlowMattic
The Local Variables feature in the FlowMattic Tools module lets you create, retrieve, update, and delete temporary variables within a single workflow. These variables exist only during the execution of a workflow and can be incredibly useful for storing and manipulating values on the fly.
🔍 Where to Find This Feature
Local Variables are part of the FlowMattic Tools module. When creating or editing a workflow, choose an action, search for “FlowMattic Tools”, and select one of the available Local Variable actions.
🧰 What Are Local Variables?
Local variables are temporary variables that:
- Are accessible only during the current workflow execution
- Can be used to store static values, intermediate results, or data across steps
- Support two types:
- String – A single text or numeric value
- Array – A collection of key-value pairs
🔧 Available Actions
There are four key actions available:
- Create Local Variable
- Get Local Variable
- Update Local Variable
- Delete Local Variable
Let’s walk through each of them step by step.
1️⃣ Create Local Variable
Use this action to define and initialize a local variable.
🔹 Configuration
- Variable Name – A name for your variable (e.g.,
my_custom_variable) - Variable Type – Choose
StringorArray - Variable Values:
- If String, provide a single value
- If Array, provide multiple key-value pairs
✅ Example (Array)
{
"product": "FlowMattic",
"quantity": 1
}
🔁 Response
{
"status": "success",
"variable_id": "a08d289c6e94207f1f1b8388fd6e8b3e",
"value": {
"product": "FlowMattic",
"quantity": 1
}
}
Note: The
variable_idwill be used in subsequent steps to access this variable.
2️⃣ Get Local Variable
Retrieve the value of a previously created variable using its ID.
🔹 Configuration
- Variable ID – Use dynamic tag like
{tools2.variable_id}
✅ Example Usage
Use this step to get values and pass them to a webhook, email, or conditional logic.
3️⃣ Update Local Variable
Modify the value of an existing variable.
🔹 Configuration
- Variable ID – Use the ID from the “Create” step
- Variable Type – Must match the original type
- Updated Values:
- You can change any key or add new ones
✅ Example Update
{
"product": "Updated Name",
"quantity": 2
}
4️⃣ Delete Local Variable
Removes a variable completely from the workflow memory.
🔹 Configuration
- Variable ID – Use dynamic tag like
{tools4.variable_id}
Once deleted, the variable is no longer available for the remainder of the workflow run.
🧷 Use Case: Storing Static Data
Sometimes you need to reuse static data (like constants) across multiple steps.
✅ Example
Create a variable:
{
"company_name": "FlowMattic",
"support_email": "[email protected]"
}
Now, instead of entering these values again and again, you can just use Get Local Variable wherever needed.
💡 Use Case
Send a thank-you email with the company name and email, then log the entry with the same details using a webhook.
💡 Real-World Use Cases
✅ Basic Use Cases
- Store and reuse user input like name or email
- Carry temporary values between steps
- Hold static information like support details or tax rates
🚀 Advanced Use Cases
- Build custom payloads for API calls step-by-step
- Store filter results from Google Sheets or Airtable temporarily
- Store status flags (e.g.,
status = success) to use in conditional paths - Use as counters (e.g.,
loop_count += 1) for iterations
📘 Summary
| Action | Purpose |
|---|---|
| Create | Define a new variable |
| Get | Retrieve the value for further use |
| Update | Modify contents of an existing variable |
| Delete | Remove the variable from memory |
Let us know if you have any questions about using Local Variables in FlowMattic!