Skip to main content

Understanding Variables in Spur Automation Flows

Learn how to use variables in Spur automation flows to personalize messages and build smart automations with dynamic customer data.

Updated this week

Variables are placeholders that let you pull in dynamic information like customer names, order details, or product info directly into your messages and flow logic. Instead of writing generic messages, you can personalize every interaction and build smart automations that respond to real data.

This guide breaks down the different types of variables available in Spur and how to use them.


Types of Variables

Spur organizes variables into five categories:

  1. User Attributes – Always available

  2. Store Attributes – Always available

  3. Workflow Variables – Custom Variable you create for use in a single execution. These are useful for storing temporary data - things that might be different each time a user comes through this automation.

  4. Custom Contact Fields – Fields you create in your database

  5. Last Order Details – Variables to reference the details of the last order (not the current order) they might've placed with their number

  6. Trigger Attributes – Dynamic variables based on the trigger you select

Let's walk through each one.


1. Contact Attributes (User Attributes)

These attributes contain basic information about the person your flow is communicating with.

Available Contact Attributes:

  • {{contact.firstName}} – The contact's first name

  • {{contact.lastName}} – The contact's last name

  • {{contact.number}} – The contact's phone number

  • {{contact.email}} – The contact's email address

Example:

Message:

Hey {{contact.firstName}}, thanks for reaching out! 

How can we help you today?

What the customer sees (if their name was Sarah):

Hey Sarah, thanks for reaching out! 

How can we help you today?

2. Store Attributes

These contain information about your store and are always available.

Available Store Attributes:

  • {{store.name}} – Your store name

  • {{store.url}} – Your store URL

  • {{store.contactEmail}} – Your store contact email

Example:

Message:

Visit us at {{store.primaryDomainUrl}} or email us at {{store.contactEmail}} for support.

What the customer sees:

Visit us at www.yourstore.com or email us at [email protected] for support.

3. Workflow Variables

Workflow variables are custom variables you create during a flow to store information. You can name them whatever you want.

How to Create a Workflow Variable:

  1. To start with, for example, you can use the "Text With User Input" block to ask the customer a question (e.g., "What's your name?").

  2. In the "Save To" section, check "Show in Flow Data" and give it a name (e.g., Customer's name).

  3. Save the flow.

Once saved, the variable becomes available throughout the rest of the flow.

You can also designate and save a workflow variable at any point in the flow using an action and selecting ''Save in workflow column'' from the drop down

Example:

Send Message #0 (Wait for User Input type message):

What's your name?

Wait for customer response → Customer replies with ''John'', save response as Customer's name

While building the flow, save the flow at this point and the properties of the workflow variable will become available to reference and select as a variable in the variable picker side menu once you start editing any text field: ''{{properties['NameOfWorkFlowVariableHere']}}''

Send Message #1:

Okay {{properties['Customer's name']}}, how can we help you?

What the customer sees:

Okay John, how can we help you?

Important Notes:

  • Workflow variables only appear after you save the flow.

  • You can reference them using {{properties['variable_name']}}.

  • If the customer doesn't provide a response, the variable will be empty, and the message will fail to send.


4. Custom Contact Fields

These are fields you create in the Database section of Spur to store custom information about your contacts.

Examples of Custom Contact Fields:

  • Party Interested

  • Birthday Month

  • Anniversary Month

  • Customization preferences

  • VIN (for automotive businesses)

  • Business Website

Once created, these fields appear in the Custom Contact Fields dropdown when building flows.

How to Use Custom Contact Fields:

You can use them in messages or conditions just like any other variable.

Example:

If you have a custom field called Birthday Month:

You could reference it with: {{contact.custom['Birthday Month']}}


5. Last Order Details

The Last Order Details variables contain the same data as the trigger attributes you'd see when using the Shopify: Order Created trigger.

However, there's an important difference: Last Order Details variables are always available, regardless of which trigger you're using.

When to Use Last Order Details Variables:

Use these variables when you want to reference a customer's previous order information in any flow, not just order-related flows.

Important Warning:

The person going through your flow might not have placed an order yet. If they haven't, these variables will be empty, and any message or condition using them will fail.

Only use Last Order Details variables when you're certain the customer has placed at least one order.

WhatsApp Only:

Last Order Details variables only work in WhatsApp flows because the phone number links a customer's order history to their Shopify account. Spur uses this connection to pull their last order data.

These variables don't work for Instagram or Facebook flows because orders aren't tied to social media accounts.


6. Trigger Attributes

Trigger attributes are the most powerful type of variable. They contain data from the event that triggered the flow (like an order being created, a cart being abandoned, or a comment on Instagram).

How Trigger Attributes Work:

  • Every trigger in Spur is a pre-configured webhook that receives payload data from Shopify, Meta, or other platforms you have integrated with Spur.

  • This payload contains detailed information about the event (order details, cart items, customer info, etc.).

  • Spur makes this data available as trigger attributes so you can reference it anywhere in your flow.

Important Notes:

  • Trigger attributes only appear after you save the flow.

  • If you change the trigger, save the flow again to see the new trigger attributes.

  • Trigger attributes vary depending on which trigger you use.


Example: Order Created Trigger

When you use the Order Created trigger, over 30 trigger attributes become available, including:

  • {{trigger.name}} – Unique order ID

  • {{trigger.total_price}} – Total price after shipping and taxes

  • {{trigger.financial_status}} – Payment status (paid, pending, etc.)

  • {{trigger.computed.shipping_address}} – Full shipping address

  • {{trigger.computed.product_names}} – Names of products in the cart

  • {{trigger.order_status_url}} – Link to the order status page for an order

Example Message:

Thanks for your order, {{contact.firstName}}! 

Your order #{{trigger.name}} totaling ₹{{trigger.total_price}} is confirmed.

Track it here: {{trigger.order_status_url}}

What the customer sees:

Thanks for your order, Sarah! 

Your order #1234 totaling ₹2,500 is confirmed.

Check the status for it here: https://yourstore.com/track/1234

Using Trigger Attributes in Conditions

You can also use trigger attributes to create conditional logic.

Example:

Send a special thank you message only if the order total is above ₹10,000.

Condition:

If {{trigger.total_price}}, Greater than 10000

Then Send Message:

Wow, {{contact.firstName}}! 

Thank you for your big order of ₹{{trigger.total_price}}.

You're amazing! 🎉

How to Access Variables in Your Flow

Variables don't automatically appear in the trigger settings. Here's how to access them:

  1. Add a message or action block in your flow.

  2. Click on any text input field (where you can type a message or enter data).

  3. A dropdown will appear showing all available variables organized by category:

    • User Attributes

    • Store Attributes

    • Workflow Variables

    • Custom Contact Fields

    • Last Order Details

    • Trigger Attributes

  4. Click on any variable to insert it into your message or condition.


Real World Examples

Example 1: Personalized Abandoned Cart Message

Trigger: Abandoned Checkout

Message:

Hey {{contact.firstName}}, you left {{trigger.cart_product_names}} in your cart. 

Complete your order now and get 10% off!

Example 2: Conditional Discount Based on Order Value

Trigger: Order Created

Condition:

If {{trigger.order_total}} > 5000

Then Send Message:

Thanks for your order of ₹{{trigger.order_total}}, {{contact.firstName}}! 

Here's a 15% discount code for your next purchase: THANKYOU15

Else:

Thanks for your order, {{contact.firstName}}! 

We appreciate your support.

Example 3: Using Workflow Variables to Collect Feedback

Send Message #0 (Wait for user input type message):

How would you rate your experience with us? 

Reply with a number from 1 to 10.

Wait for customer response → Save as rating

Send Message #1:

Thanks for the {{properties['rating']}} rating! We appreciate your feedback.

What Happens If a Variable Is Empty?

If a variable has no value (for example, the customer hasn't provided their email), the variable will return nothing, and the message may fail to send or display incorrectly.

To avoid this, you can:

  • Use conditional logic to check if a variable exists before using it.

  • Set default values in your flow.


Summary

Variable Type

When Available

Example

User Attributes

Always

{{contact.firstName}}

Store Attributes

Always

{{store.name}}

Workflow Variables

After you save data in the flow

{{properties['Customer's name']}}

Custom Contact Fields

After you create them in Database

{{contact.custom['Birthday Month']}}

Trigger Attributes

After you select a trigger and save the flow

{{trigger.name}


Next Steps

To see which variables are available for a specific trigger:

  1. Select a trigger in your flow.

  2. Save the flow.

  3. Click on any text input field in a message or action block.

  4. Open the Trigger Attributes dropdown from the menu that opens up on the right to see all available variables.


Need help? Reach out to our support team anytime :)

Did this answer your question?