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
FieldTypeRequiredDescription
keystringYesVariable name (no spaces — use camelCase or snake_case)
valuestringYesValue — literals, {{lead.xxx}}, or {{variables.xxx}} supported

---

Variables available
VariableDescription
{{variables.[key]}}The variable you just set, available to all subsequent nodes

---

Step-by-step setup
  1. Add a Set Variable node.
  2. Enter the key name e.g. contactId.
  3. Enter the value e.g. {{variables.ghlContact.contactId}}.
  4. Reference it downstream as {{variables.contactId}}.

---

Example config

json { "key": "fullName", "value": "{{lead.firstName}} {{lead.lastName}}" }

---

Tips & gotchas
  • Variable keys are case-sensitive — contactId and ContactId are 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.