Using Workflow Variables and Merge Tags in Emails and Conditions
What it is
A workflow variable is a named piece of data that is captured, computed, or generated at some point in a workflow and then made available to every node that comes after it. When a requester fills in a form, each field becomes a variable. When an AI Agent runs, its output is a variable. When a task is completed, the decision made and any comments become variables. Variables are referenced using merge tag syntax: double curly braces around the variable name, like {{requester_name}} or {{due_date}}.
Merge tags work in three places:
- Email subjects and bodies — to personalize notification emails with live data.
- Condition expressions — to route a workflow based on a value (e.g., approve small amounts automatically, escalate large ones).
- Node configuration fields — wherever a field accepts a variable (recipient email addresses, task assignee, delay duration, etc.).
Why it's useful / Key benefits
- Automatically personalized emails. Every notification goes out with the requester's real name, the actual project title, and the correct deadline — no manual editing, no generic "Dear User" messages.
- Data flows through the whole process. A value captured at Step 1 is available in Step 10. You never need to look up information that was already collected.
- Routing decisions use real data. Condition nodes can branch based on
{{purchase_amount}}being above a threshold,{{department}}matching a specific team, or any other captured value — making the workflow genuinely dynamic. - One-click copying from the Variable Panel. You never have to memorize or type variable names. The Variable Panel lists every available variable with its source node and type; one click copies the merge tag to your clipboard.
- Drag-and-drop variables into editors. In both the condition builder and the email editor, you can drag a variable directly from the panel into a field.
- Type safety. Each variable has a declared type (string, number, boolean, date, file) which the condition builder uses to show only the relevant comparison operators, preventing logic errors.
Before you start
- Variables are created by nodes that come before the node where you want to use them in the workflow graph. A variable from a node that runs later is not accessible yet.
- Required permission: Manage Workflows (to configure workflow nodes).
- To see the Variable Panel, you must be in the Visual Designer with at least one configured upstream node.
Where to find it:
In the Visual Designer toolbar, click the Variable Panel icon (the {} button) to open the slide-in Variable Panel on the right side of the canvas.
How to use it — step by step
Exploring available variables
-
Open a workflow in the Visual Designer.
-
Click the Variable Panel icon in the toolbar (or press the keyboard shortcut if one is shown). The Variable Panel slides in from the right.
-
Variables are grouped by the node they come from. Each group shows the node's icon and label (e.g., "Start Node," "Task: Review Contract," "AI Agent: Classify Request").
-
Within each group, each variable row shows:
- The merge tag in monospace format, e.g.,
{{form_project_name}} - The type badge (string in gray, number in amber, boolean in green, date in sky blue, file in rose)
- The source badge (Form, Task, AI, Python, etc.)
- The merge tag in monospace format, e.g.,
-
To copy a merge tag, click anywhere on the variable row. A brief "Copied" indicator confirms it is on your clipboard, ready to paste.
-
To drag-insert a variable into a compatible field, grab the drag handle (the six-dot grip icon that appears on hover at the left of a row) and drag it into the target field.
Using merge tags in email subject lines
- Open an Email node's Email Properties dialog (double-click the node).
- Click in the Email Subject field.
- Open the Variable Panel in the main designer and copy the tag you need — or simply type it manually in
{{variable_name}}format. - Paste the tag into the subject field. Example:
Action Required: {{task_title}} due {{due_date}}
The subject line also accepts plain text mixed with any number of merge tags. Tags are replaced with their actual values at send time.
Using merge tags in email body content
- Open the Unlayer email editor (the body section of the EMAIL tab).
- Click inside any Text block in the editor canvas.
- Place your cursor at the position where you want the variable's value to appear.
- Either:
- Click the Merge Tags button in the Unlayer toolbar (the
{}icon). A dropdown appears organized into categories: Basic, Task, Action Links, Form Fields, and Task Vars. Click any item to insert it. - Or copy the tag from the Variable Panel in the main designer and paste it in.
- Click the Merge Tags button in the Unlayer toolbar (the
- The tag appears in the text in
{{variable_name}}format. At send time, the platform substitutes the real value.
Predefined merge tags always available in emails
| Category | Tag | What it inserts |
|---|---|---|
| Basic | {{form_title}} |
The name of the trigger form or workflow |
| Basic | {{submission_id}} |
The unique identifier for this workflow instance |
| Basic | {{requester_name}} |
Full name of the person who triggered the workflow |
| Task | {{task_title}} |
The title of the current or most recent task node |
| Task | {{assignee_name}} |
The name of the person assigned to the task |
| Task | {{due_date}} |
The task's due date |
| Action Links | {{complete_link}} |
A secure one-use link that completes the task (for external approvers) |
| Action Links | {{reject_link}} |
A secure one-use link that rejects the task (for external approvers) |
| Action Links | {{hold_link}} |
A secure one-use link that places the task on hold (for external approvers) |
| Action Links | {{portal_url}} |
The URL of the External Approver Portal for this task |
In addition to these, every form field submitted at the trigger step becomes a merge tag with the field's internal name prefixed, such as {{form_contract_value}} or {{form_department}}.
Using variables in condition expressions
- Open a Condition Node or a Conditional Branch Node (double-click it on the canvas).
- In the condition builder, find the Value field for a rule (the left-hand side of the comparison).
- Start typing
{{to indicate a variable reference, then type the variable name. The condition builder resolves it at runtime. - Set the Operator for the rule (see operators table below). The available operators automatically match the variable's type.
- Set the comparison value (the right-hand side) — either a literal value or another
{{variable_name}}.
Example condition: {{purchase_amount}} is greater than 10000
For full details on the condition node and expression builder, see Routing Logic: If/Else Conditions, Conditional Branches, and Expression Builder.
Using variables in other node fields
Many node configuration fields accept merge tags wherever a dynamic value is useful:
| Node | Field where variables work |
|---|---|
| Task node | Assignee field (to assign dynamically based on submitted data) |
| Task node | Due Date field (to set a deadline from a submitted date) |
| Email node | Recipient Emails field (to send to an address captured in the form) |
| Pause / Delay node | Until date field (to pause until a date variable) |
| Reminder Scheduler node | Date column (from a DB Query variable) |
| DB Query node | SQL Query field (embed a variable in a WHERE clause) |
Options & settings explained
Variable Panel controls
| Control | Description |
|---|---|
| Node group headers | Collapsible rows grouping variables by the node they come from. Click the chevron to expand or collapse. |
| Search field (if shown) | Filters the variable list by name or description in real time. |
| Variable row (click to copy) | Clicking anywhere on the row copies the {{variable_name}} merge tag to your clipboard. |
| Drag handle (grip icon) | Appears on hover; drag to insert the tag into a compatible target field. |
| Type badge | Shows the variable's data type: string (gray), number (amber), boolean (green), date (sky blue), file (rose). |
| Source badge | Indicates which kind of node produced the variable: Form, Task, AI, Python, Input, HTTP, etc. |
Merge tag syntax rules
| Rule | Detail |
|---|---|
| Format | Always {{variable_name}} — two opening curly braces, the name, two closing curly braces. Spaces inside the braces are not supported. |
| Case-sensitive | {{Task_Title}} and {{task_title}} are different. Use the Variable Panel to copy the exact name. |
| Chaining | You cannot nest tags inside each other. Each tag is independent. |
| Missing variable | If a variable is undefined at runtime (e.g., an optional field that was left blank), the tag is replaced with an empty string. |
Variable types and compatible operators
| Type | Operators available in conditions |
|---|---|
| string | equals, does not equal, contains, does not contain, starts with, ends with, is empty, is not empty |
| number | equals, does not equal, is greater than, is less than, is greater than or equal to, is less than or equal to, is empty, is not empty |
| boolean | equals true, equals false |
| date | equals, is before, is after, is between, is empty, is not empty |
| file | is empty, is not empty |
Tips & best practices
- Copy from the Variable Panel — never type from memory. Variable names must be exact, including underscores, prefixes, and capitalisation. One typo and the tag is sent literally in the email.
- Check the type badge before writing a condition. Comparing a string variable with a numeric operator will not work as expected. The type badge in the Variable Panel tells you what type the variable is.
- Use action links only in external-approver scenarios. The
{{complete_link}},{{reject_link}}, and{{hold_link}}tags generate secure single-use links. Place them in emails sent to people who will act without logging in. See External Approver Portal. - Upstream-only rule. A variable from a Task node that comes after the Email node in the graph is not available in that Email node. Design your workflow so data-producing nodes come before data-consuming nodes.
- Global variables are always available. The Variable Panel's global group (if present) contains variables available at any point regardless of node order — for example, submission metadata.
- Test with realistic data. Before activating a workflow, run a test submission with representative form values and verify the emails contain the expected resolved values. See Running a Workflow.
Frequently asked questions
Q: A merge tag in my email is showing up literally — e.g., {{task_title}} instead of the actual task name. Why?
Most likely causes: (1) the tag is misspelled — copy it exactly from the Variable Panel; (2) the variable does not exist yet at the point the email is sent (the source node runs after the email node); (3) the variable was optional and the requester left it blank, resulting in an empty string. Check the Variable Panel to confirm the tag name and node order.
Q: Can I use a variable to decide who receives an email?
Yes. In the Email node's RECIPIENTS tab, type a merge tag like {{requester_email}} in a Recipient Emails field. The platform resolves it at runtime and sends the email to whatever address that variable holds.
Q: How do I know which variable name corresponds to a specific form field?
Open the Variable Panel and expand the node group for the Start (trigger) node. Each form field appears as a variable. The tag name uses the field's internal name prefixed with form_. If unsure, ask the workflow designer or look at the field configuration in the trigger node's properties.
Q: Can I use variables in the email subject line?
Yes. The subject line field supports the same {{variable_name}} syntax as the body. For example: Your request "{{form_request_title}}" has been approved.
Q: What happens if a variable value is null or the field was left blank? The merge tag is replaced with an empty string at send time. To avoid blank gaps in your email, consider making form fields required where the value is critical, or use the Hide Empty Fields option in the Email node's Advanced tab to suppress fields with no value.
Q: Can I use variables in a Pause node to delay until a date from the form? Yes. In the Pause / Delay node, select the "Until variable date" mode and pick the date variable from the dropdown. See Pause / Delay Node for details.
