Automations
Set Variable Node
3 min readnode-set-variable
Create or update a variable in the automation context for use in downstream nodes.
Set Variable Node
Sets a named variable to a literal value or an expression. Variables persist for the lifetime of the automation run and can be referenced in any downstream node as {{variables.yourKey}}.
When to use it
- Compute a value once and reuse it across multiple nodes.
- Rename a verbose
{{variables.webhookResponse.data.contact.id}}to a clean{{variables.contactId}}.
---
Required fields
| Field | Type | Required | Description |
|---|---|---|---|
| key | string | Yes | Variable name (no spaces — use camelCase or snake_case) |
| value | string | Yes | Value — literals, {{lead.xxx}}, or {{variables.xxx}} supported |
---
Variables available
| Variable | Description |
|---|---|
{{variables.[key]}} | The variable you just set, available to all subsequent nodes |
---
Step-by-step setup
- Add a Set Variable node.
- Enter the key name e.g.
contactId. - Enter the value e.g.
{{variables.ghlContact.contactId}}. - Reference it downstream as
{{variables.contactId}}.
---
Example config
json
{
"key": "fullName",
"value": "{{lead.firstName}} {{lead.lastName}}"
}
---
Tips & gotchas
- Variable keys are case-sensitive —
contactIdandContactIdare different variables. - You can overwrite a variable by setting the same key again later in the flow.
- Use this node to flatten deeply nested API responses before referencing them.