Skip to content

Workflow Variables

Learn how to use dynamic variables to pass data between workflow steps.

Overview

Workflow variables let you dynamically insert data from triggers and previous actions into your workflow steps. They’re the key to creating powerful, personalized automations.

Variable Syntax

Variables use double curly braces:

{{Source.field_name}}

Basic Examples

{{Trigger.user_email}}
{{Trigger.order_id}}
{{Action1.post_id}}

Variable Sources

Trigger Variables

Data from the event that started the workflow:

{{Trigger.user_id}}
{{Trigger.user_email}}
{{Trigger.billing.first_name}}
{{Trigger.order_total}}

Action Output Variables

Results from previous actions:

{{Action1.post_id}}        # First action output
{{Action2.success}}        # Second action output
{{Action3.record_id}}      # Third action output

Site Variables

WordPress site information:

{{Site.name}}              # Site title
{{Site.url}}               # Site URL
{{Site.admin_email}}       # Admin email

Accessing Nested Data

Use dot notation for nested properties:

{{Trigger.billing.first_name}}
{{Trigger.billing.address_1}}
{{Trigger.shipping.city}}

Object Structure Example

{
  "billing": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "address_1": "123 Main St",
    "city": "New York"
  }
}

Access with:

{{Trigger.billing.first_name}}  → "John"
{{Trigger.billing.city}}        → "New York"

Accessing Arrays

Use index notation for array items:

{{Trigger.items[0].name}}       # First item name
{{Trigger.items[0].quantity}}   # First item quantity
{{Trigger.items[1].price}}      # Second item price

Array Example

{
  "items": [
    {"name": "T-Shirt", "quantity": 2, "price": "25.00"},
    {"name": "Jeans", "quantity": 1, "price": "50.00"}
  ]
}

Access with:

{{Trigger.items[0].name}}     → "T-Shirt"
{{Trigger.items[1].price}}    → "50.00"

Common Variable Patterns

User Data

{{Trigger.user_id}}
{{Trigger.user_email}}
{{Trigger.user_login}}
{{Trigger.display_name}}
{{Trigger.first_name}}
{{Trigger.last_name}}

Order Data (WooCommerce)

{{Trigger.order_id}}
{{Trigger.order_number}}
{{Trigger.total}}
{{Trigger.status}}
{{Trigger.billing.email}}
{{Trigger.billing.first_name}}
{{Trigger.shipping.address_1}}
{{Trigger.items[0].name}}

Post Data

{{Trigger.post_id}}
{{Trigger.post_title}}
{{Trigger.post_content}}
{{Trigger.post_url}}
{{Trigger.author.name}}
{{Trigger.categories}}

Form Data

{{Trigger.entry_id}}
{{Trigger.form_id}}
{{Trigger.fields.1}}          # Field ID 1
{{Trigger.fields.2}}          # Field ID 2
{{Trigger.fields.name.first}} # Name field - first

Using Variables in Fields

Email Subject

Welcome, {{Trigger.first_name}}!

Email Body

Hi {{Trigger.first_name}},

Thank you for your order #{{Trigger.order_number}}.

Your total: ${{Trigger.total}}

Items ordered:
- {{Trigger.items[0].name}} x {{Trigger.items[0].quantity}}

Shipping to:
{{Trigger.shipping.address_1}}
{{Trigger.shipping.city}}, {{Trigger.shipping.state}}

Building URLs

https://yoursite.com/order/{{Trigger.order_id}}
https://yoursite.com/user/{{Trigger.user_id}}/profile

Dynamic Content

Your account {{Trigger.user_login}} has been created.
View your post at: {{Trigger.post_url}}

Variable Fallbacks

Handle missing data with defaults:

{{Trigger.first_name | default:"Customer"}}
{{Trigger.company | default:"N/A"}}

Combining Variables

Concatenate in text:

{{Trigger.first_name}} {{Trigger.last_name}}

Build complex strings:

Order #{{Trigger.order_number}} - {{Trigger.billing.first_name}} {{Trigger.billing.last_name}} (${{Trigger.total}})

Action Chaining

Use output from one action in the next:

Example Workflow

1. Create Post
   - Title: {{Trigger.form_title}}
   - Output: post_id, post_url

2. Send Email
   - Subject: New post created
   - Body: View it at {{Action1.post_url}}

3. Update Record
   - Field: WordPress Post ID
   - Value: {{Action1.post_id}}

Debugging Variables

Check Available Variables

  1. Configure your trigger
  2. Look at the properties panel
  3. “Available Data” shows all variables

Test Variable Values

  1. Create a test action (like Send Email)
  2. Include variables you want to test
  3. Run workflow with test data
  4. Check the received email/output

Activity Log

The activity log shows:

  • Actual values of variables
  • Data passed between steps
  • Any errors or missing data

Best Practices

Always Verify Variables Exist

Check that expected data is present before using:

{{Trigger.billing.email}}  # Might be empty for guests

Use Meaningful Field Names

When possible, use variables that clearly indicate their source:

Customer: {{Trigger.billing.first_name}}

Handle Empty Values

Consider what happens if a variable is empty:

Hi {{Trigger.first_name | default:"there"}},

Document Your Variables

In complex workflows, note which variables you’re using and why.