Liquid support in Flow

Developers who are experienced with Shopify Liquid can add Liquid to messages in workflows. If you aren't familiar with Shopify Liquid, then use the Add template variables window to add Liquid to your messages.

Flow supports most of Shopify Liquid, but there are some exceptions that are described here. To learn more about template variables, see the examples page. If you have any questions, contact your Merchant Success Manager.

Conditional and iteration tags

You can manually add Liquid variable tags to your workflow messages. You can use these tags to include more information in your messages.

For example, you can use a for loop object to iterate through a list of objects, such as line items for an order. With these tags, you can create messages that contain details, such as product title, SKU, price, and quantity for each line item in an order and save your recipients from having to look up this information in your Shopify admin.

Flow supports all Shopify Liquid conditional (or control flow) tags:

Flow also supports all Shopify Liquid iteration tags:

Filters

Flow supports the following Shopify Liquid filters:

Filter name Filter type
abs Math
append String
capitalize String
ceil Math
concat Array
date Additional
default Additional
divided_by Math
downcase String
escape String
first Array
floor Math
join Array
last Array
lstrip String
map Array
minus Math
modulo Math
newline_to_br String
plus Math
prepend String
remove String
remove_first String
replace String
replace_first String
reverse Array
round Math
rstrip String
size Array
slice String
sort Array
split String
strip String
strip_html String
strip_newlines String
times Math
truncate String
truncatewords String
uniq Array
upcase String
url_encode String

Template variables

Variables that apply to the Customer created action:

Variables that apply to the Inventory quantity changed and Product added actions:

Variables that apply to the Order paid and Order risk analyzed actions:

Variables that apply to the Order fulfilled action:

Variables that apply to the Refund order action:

Customer variables

The following table describes the template variables related to customers:

Variable name Description
customer.acceptsMarketing Whether the customer has agreed to receive marketing materials.
customer.averageOrderAmount Average amount that the customer spent per order.
customer.canDelete Whether the merchant can delete the customer from the store.
customer.displayName Full name of the customer, based on first name + last name.
customer.email
customer.firstName
customer.hasNote Whether the customer has a note associated with them.
customer.hasTimelineComment Whether the merchant has added timeline comments about the customer on the customer's page.
customer.id Globally unique identifier.
customer.lastName
customer.lifetimeDuration Time since the customer was first added to the store.
customer.note Note about the customer written by the merchant.
customer.ordersCount Number of orders that the customer has made at the store in their lifetime.
customer.phone
customer.state State or province where the customer resides.
customer.taxExempt Whether the customer is exempt from being charged taxes on their orders.
customer.totalSpent Total amount that the customer has spent on orders in their lifetime.
customer.verifiedEmail Whether the email address is formatted correctly.
customer.defaultAddress.address1 Address line 1 (Street address/PO Box/Company name).
customer.defaultAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
customer.defaultAddress.city City/District/Suburb/Town/Village.
customer.defaultAddress.company Company/Organization/Government.
customer.defaultAddress.country State/County/Province/Region.
customer.defaultAddress.countryCode Two-letter country code.
customer.defaultAddress.firstName First name of the customer.
customer.defaultAddress.formattedArea Comma-separated list of city, province, and country.
customer.defaultAddress.lastName Last name of the customer.
customer.defaultAddress.latitude Latitude coordinate of the customer address.
customer.defaultAddress.longitude Longitude coordinate of the customer address.
customer.defaultAddress.name Name of the customer, based on first name + last name.
customer.defaultAddress.phone Unique phone number for the customer.
customer.defaultAddress.province State/County/Province/Region.
customer.defaultAddress.provinceCode Two-letter province or state code.
customer.defaultAddress.zip Zip/Postal Code.
customer.image.altText A word or phrase to share the nature or contents of an image.
customer.lastOrder.billingAddressMatchesShippingAddress Whether the billing address matches the shipping address.
customer.lastOrder.buyerAcceptsMarketing Whether the customer agreed to receive marketing materials.
customer.lastOrder.canMarkAsPaid Whether the order can be manually marked as paid.
customer.lastOrder.cancelReason Reason the order was canceled.
customer.lastOrder.capturable Whether payment for the order can be captured.
customer.lastOrder.cartDiscountAmount Amount of the order-level discount (does not contain any line item discounts).
customer.lastOrder.clientIp The ip address of the client that is associated with this order.
customer.lastOrder.closed Whether the order is closed.
customer.lastOrder.confirmed Whether inventory has been reserved for the order.
customer.lastOrder.currencyCode The currency of the store at the time of the order.
customer.lastOrder.customerLocale
customer.lastOrder.discountCode Discount code provided by the customer.
customer.lastOrder.displayFinancialStatus Financial status of the order that can be shown to the merchant.
customer.lastOrder.displayFulfillmentStatus Fulfillment status for the order that can be shown to the merchant.
customer.lastOrder.email Email address provided by the customer.
customer.lastOrder.fulfillable Whether there are items that can be fulfilled.
customer.lastOrder.fullyPaid Whether the order has been paid in full.
customer.lastOrder.hasTimelineComment Whether the merchant added timeline comments to the order.
customer.lastOrder.landingPageDisplayText
customer.lastOrder.name Unique identifier for the order that appears on the order.
customer.lastOrder.netPayment Net payment for the order, based on the total amount received - total amount refunded.
customer.lastOrder.note Contents of the note associated with the order.
customer.lastOrder.phone Phone number provided by the customer.
customer.lastOrder.referralCode Marketing referral code from the link that the customer clicked to visit your store.
customer.lastOrder.referrerDisplayText Website that sent the customer to your online store.
customer.lastOrder.refundable Whether the order can be refunded.
customer.lastOrder.requiresShipping Whether any line item in the order requires physical shipping.
customer.lastOrder.riskLevel Fraud risk level of the order.
customer.lastOrder.subtotalPrice Subtotal of the line items and their discounts (does not contain shipping costs, shipping discounts, and order-level discounts).
customer.lastOrder.taxesIncluded Whether taxes are included in the subtotal price of the order.
customer.lastOrder.test Whether the order is a test.
customer.lastOrder.totalCapturable Amount authorized for the order, that is uncaptured or undercaptured.
customer.lastOrder.totalDiscounts Total amount discounted from the order (includes order-level and line item discounts).
customer.lastOrder.totalPrice Total amount of the order (includes taxes and discounts).
customer.lastOrder.totalReceived Total amount received by the customer for the order.
customer.lastOrder.totalRefunded Total amount refunded for the order.
customer.lastOrder.totalShippingPrice Total amount charged for shipping the order.
customer.lastOrder.totalTax Total of all taxes applied to the order.
customer.lastOrder.totalWeight Total weight (grams) of the order.
customer.lastOrder.unpaid Whether no payments have been made for the order.

Fulfillment variables

The following table describes the template variables related to fulfillment:

Variable name Description
fulfillment.displayStatus Human readable display status for this fulfillment.
fulfillment.id Globally unique identifier.
fulfillment.name Human readable reference identifier for this fulfillment.
fulfillment.status
fulfillment.totalQuantity
fulfillment.service.handle Human-readable unique identifier for this fulfillment service.
fulfillment.service.inventoryManagement
fulfillment.service.productBased
fulfillment.service.serviceName
order.all_line_items_shippable

Order variables

The following table describes the template variables related to orders:

Variable name Description
order.billingAddressMatchesShippingAddress Whether the billing address matches the shipping address.
order.buyerAcceptsMarketing Whether the customer agreed to receive marketing materials.
order.canMarkAsPaid Whether the order can be manually marked as paid.
order.cancelReason Reason the order was canceled.
order.capturable Whether payment for the order can be captured.
order.cartDiscountAmount Amount of the order-level discount (does not contain any line item discounts).
order.clientIp The ip address of the client that is associated with this order.
order.closed Whether the order is closed.
order.confirmed Whether inventory has been reserved for the order.
order.currencyCode The currency of the store at the time of the order.
order.customerLocale
order.discountCode Discount code provided by the customer.
order.displayFinancialStatus Financial status of the order that can be shown to the merchant.
order.displayFulfillmentStatus Fulfillment status for the order that can be shown to the merchant.
order.email Email address provided by the customer.
order.fulfillable Whether there are items that can be fulfilled.
order.fullyPaid Whether the order has been paid in full.
order.hasTimelineComment Whether the merchant added timeline comments to the order.
order.id Globally unique identifier.
order.landingPageDisplayText
order.name Unique identifier for the order that appears on the order.
order.netPayment Net payment for the order, based on the total amount received - total amount refunded.
order.note Contents of the note associated with the order.
order.phone Phone number provided by the customer.
order.referralCode Marketing referral code from the link that the customer clicked to visit your store.
order.referrerDisplayText Website that sent the customer to your online store.
order.refundable Whether the order can be refunded.
order.requiresShipping Whether any line item in the order requires physical shipping.
order.riskLevel Fraud risk level of the order.
order.subtotalPrice Subtotal of the line items and their discounts (does not contain shipping costs, shipping discounts, and order-level discounts).
order.taxesIncluded Whether taxes are included in the subtotal price of the order.
order.test Whether the order is a test.
order.totalCapturable Amount authorized for the order, that is uncaptured or undercaptured.
order.totalDiscounts Total amount discounted from the order (includes order-level and line item discounts).
order.totalPrice Total amount of the order (includes taxes and discounts).
order.totalReceived Total amount received by the customer for the order.
order.totalRefunded Total amount refunded for the order.
order.totalShippingPrice Total amount charged for shipping the order.
order.totalTax Total of all taxes applied to the order.
order.totalWeight Total weight (grams) of the order.
order.unpaid Whether no payments have been made for the order.
order.billingAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.billingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.billingAddress.city City/District/Suburb/Town/Village.
order.billingAddress.company Company/Organization/Government.
order.billingAddress.country State/County/Province/Region.
order.billingAddress.countryCode Two-letter country code.
order.billingAddress.firstName First name of the customer.
order.billingAddress.formattedArea Comma-separated list of city, province, and country.
order.billingAddress.lastName Last name of the customer.
order.billingAddress.latitude Latitude coordinate of the customer address.
order.billingAddress.longitude Longitude coordinate of the customer address.
order.billingAddress.name Name of the customer, based on first name + last name.
order.billingAddress.phone Unique phone number for the customer.
order.billingAddress.province State/County/Province/Region.
order.billingAddress.provinceCode Two-letter province or state code.
order.billingAddress.zip Zip/Postal Code.
order.channel.name Name of the channel.
order.channel.supportsFuturePublishing Whether or not this channel supports future publishing.
order.customer.acceptsMarketing Whether the customer has agreed to receive marketing materials.
order.customer.averageOrderAmount Average amount that the customer spent per order.
order.customer.canDelete Whether the merchant can delete the customer from the store.
order.customer.displayName Full name of the customer, based on first name + last name.
order.customer.email
order.customer.firstName
order.customer.hasNote Whether the customer has a note associated with them.
order.customer.hasTimelineComment Whether the merchant has added timeline comments about the customer on the customer's page.
order.customer.lastName
order.customer.lifetimeDuration Time since the customer was first added to the store.
order.customer.note Note about the customer written by the merchant.
order.customer.ordersCount Number of orders that the customer has made at the store in their lifetime.
order.customer.phone
order.customer.state State or province where the customer resides.
order.customer.taxExempt Whether the customer is exempt from being charged taxes on their orders.
order.customer.totalSpent Total amount that the customer has spent on orders in their lifetime.
order.customer.verifiedEmail Whether the email address is formatted correctly.
order.customerJourney.customerOrderIndex
order.customerJourney.daysToConversion
order.displayAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.displayAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.displayAddress.city City/District/Suburb/Town/Village.
order.displayAddress.company Company/Organization/Government.
order.displayAddress.country State/County/Province/Region.
order.displayAddress.countryCode Two-letter country code.
order.displayAddress.firstName First name of the customer.
order.displayAddress.formattedArea Comma-separated list of city, province, and country.
order.displayAddress.lastName Last name of the customer.
order.displayAddress.latitude Latitude coordinate of the customer address.
order.displayAddress.longitude Longitude coordinate of the customer address.
order.displayAddress.name Name of the customer, based on first name + last name.
order.displayAddress.phone Unique phone number for the customer.
order.displayAddress.province State/County/Province/Region.
order.displayAddress.provinceCode Two-letter province or state code.
order.displayAddress.zip Zip/Postal Code.
order.marketingAttribution.campaign
order.marketingAttribution.content
order.marketingAttribution.medium
order.marketingAttribution.source
order.marketingAttribution.term
order.physicalLocation.isActive Indicates whether or not a location is active.
order.physicalLocation.name
order.physicalLocation.shipsInventory Indicates whether or not this location ships inventory.
order.shippingAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.shippingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.shippingAddress.city City/District/Suburb/Town/Village.
order.shippingAddress.company Company/Organization/Government.
order.shippingAddress.country State/County/Province/Region.
order.shippingAddress.countryCode Two-letter country code.
order.shippingAddress.firstName First name of the customer.
order.shippingAddress.formattedArea Comma-separated list of city, province, and country.
order.shippingAddress.lastName Last name of the customer.
order.shippingAddress.latitude Latitude coordinate of the customer address.
order.shippingAddress.longitude Longitude coordinate of the customer address.
order.shippingAddress.name Name of the customer, based on first name + last name.
order.shippingAddress.phone Unique phone number for the customer.
order.shippingAddress.province State/County/Province/Region.
order.shippingAddress.provinceCode Two-letter province or state code.
order.shippingAddress.zip Zip/Postal Code.
order.shippingLine.custom
order.shippingLine.price
order.shippingLine.shippingRateHandle
order.shippingLine.title
order.suggestedRefund.amount
order.suggestedRefund.maximumRefundable
order.suggestedRefund.subtotal
order.suggestedRefund.totalTaxes

Product variables

The following table describes the template variables related to products:

Variable name Description
product.availablePublicationCount The number of channels a product is published on without feedback errors.
product.defaultCursor A default cursor for use in pagination.
product.description Stripped description of the product, single line with HTML tags removed.
product.handle
product.hasOnlyDefaultVariant Whether the product has only a single variant with the default option and value.
product.hasOutOfStockVariants
product.id Globally unique identifier.
product.isGiftCard
product.productType
product.publicationCount The number of channels a product is published on.
product.publishedOnCurrentChannel Check to see if product is published to the calling app's channel.
product.templateSuffix
product.title
product.totalInventory
product.totalVariants
product.tracksInventory
product.vendor
product.feedback.summary
product.seo.description SEO Description.
product.seo.title SEO Title.
product_variant.availableForSale Indicates if the product variant is available for sale.
product_variant.barcode
product_variant.compareAtPrice
product_variant.defaultCursor A default cursor for use in pagination.
product_variant.displayName Display name of the variant, based on product's title + variant's title.
product_variant.harmonizedSystemCode
product_variant.id Globally unique identifier.
product_variant.inventoryManagement
product_variant.inventoryPolicy
product_variant.inventoryQuantity Total sellable quantity of the variant
product_variant.inventoryQuantityPrior
product_variant.position
product_variant.price
product_variant.requiresShipping
product_variant.sku
product_variant.taxable
product_variant.title
product_variant.weight
product_variant.weightUnit
product_variant.fulfillmentService.handle Human-readable unique identifier for this fulfillment service.
product_variant.fulfillmentService.inventoryManagement
product_variant.fulfillmentService.productBased
product_variant.fulfillmentService.serviceName
product_variant.image.altText A word or phrase to share the nature or contents of an image.
product_variant.product.availablePublicationCount The number of channels a product is published on without feedback errors.
product_variant.product.defaultCursor A default cursor for use in pagination.
product_variant.product.description Stripped description of the product, single line with HTML tags removed.
product_variant.product.handle
product_variant.product.hasOnlyDefaultVariant Whether the product has only a single variant with the default option and value.
product_variant.product.hasOutOfStockVariants
product_variant.product.isGiftCard
product_variant.product.productType
product_variant.product.publicationCount The number of channels a product is published on.
product_variant.product.publishedOnCurrentChannel Check to see if product is published to the calling app's channel.
product_variant.product.templateSuffix
product_variant.product.title
product_variant.product.totalInventory
product_variant.product.totalVariants
product_variant.product.tracksInventory
product_variant.product.vendor

Refund variables

The following table describes the template variables related to refunds:

Variable name Description
refund.id Globally unique identifier.
refund.note
refund.restocked
refund.staffMember.active Whether the staff member is active or not.
refund.staffMember.email
refund.staffMember.exists
refund.staffMember.firstName
refund.staffMember.isShopOwner Whether or not the user is an owner.
refund.staffMember.lastName
refund.staffMember.name
refund.staffMember.phone

Shop variables

The following table describes the template variables related to shops:

Variable name Description
shop.channelCount Exposes the number of channels.
shop.checkoutApiSupported Specifies whether the shop supports checkouts via Checkout API.
shop.currencyCode
shop.customerAccounts
shop.description
shop.email
shop.ianaTimezone
shop.myshopifyDomain
shop.name
shop.pendingOrderCount
shop.setupRequired
shop.taxShipping Specifies whether or not taxes are charged for shipping.
shop.taxesIncluded The setting for whether applicable taxes are included in product prices.
shop.weightUnit
shop.billingAddress.address1 Address line 1 (Street address/PO Box/Company name).
shop.billingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
shop.billingAddress.city City/District/Suburb/Town/Village.
shop.billingAddress.company Company/Organization/Government.
shop.billingAddress.country State/County/Province/Region.
shop.billingAddress.countryCode Two-letter country code.
shop.billingAddress.firstName First name of the customer.
shop.billingAddress.formattedArea Comma-separated list of city, province, and country.
shop.billingAddress.lastName Last name of the customer.
shop.billingAddress.latitude Latitude coordinate of the customer address.
shop.billingAddress.longitude Longitude coordinate of the customer address.
shop.billingAddress.name Name of the customer, based on first name + last name.
shop.billingAddress.phone Unique phone number for the customer.
shop.billingAddress.province State/County/Province/Region.
shop.billingAddress.provinceCode Two-letter province or state code.
shop.billingAddress.zip Zip/Postal Code.
shop.countriesInShippingZones.includeRestOfWorld Whether 'Rest of World' has been defined in any shipping zones.
shop.features.branding Branding of the shop.
shop.features.financialReports
shop.features.harmonizedSystemCode Display Harmonized System codes on products. Used for customs when shipping cross-border.
shop.features.liveView Whether to show the live view. Live view is hidden from merchants that are on a trial or don't have a storefront.
shop.features.shopifyPlus
shop.features.showMetrics Whether to show metrics. Metrics are hidden for new merchants until they become meaningful.
shop.features.storefront
shop.primaryDomain.host The host name of the domain (eg: example.com).
shop.primaryDomain.sslEnabled Whether SSL is enabled or not.
shop.resourceLimits.maxProductOptions Maximum number of product options allowed.
shop.resourceLimits.maxProductVariants Maximum number of variants allowed.
shop.resourceLimits.redirectLimitReached Whether the shop has reached the limit of the number of URL redirects it can make for resources.

LineItem template variables

If you have a lot of experienced with Shopify Liquid, then you might want to use advanced features like Liquid tags in your workflows. For example you can use a for loop tag to list line item details, such as the name of each product order as well as its SKU and price. To do this, you also need to use the LineItem object. The LineItem object that Flow supports is slightly different from the one that is described in the Shopify Liquid documentation.

The following table describes the template variables that are supported for the LineItem object:

Template variable Data type Description
canRestock Boolean Whether the item ordered in the line item can be restocked if it is returned or the order is canceled.
discountedTotal Money Amount of the discount applied to the line item.
discountedUnitPrice Money Unit price of the product variant after its per-unit discount had been applied.
fulfillableQuantity Integer Number of product variants that still need to be fulfilled. This value is based on quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity.
fulfillmentStatus String How far along an order is in terms line items fulfilled. Valid values: fulfilled, null or partial.
name String Name of the ordered product.
nonFulfillableQuantity Integer Number of line items that cannot be fulfilled.
originalTotal Money Total price (without discounts) of the line item, based on the original unit price of the variant multiplied by the quantity ordered.
originalUnitPrice Money Variant price without any discounts applied.
Quantity Number Number of variant items ordered.
refundableQuantity Integer Number of items in the line item that can be refunded.
requiresShipping Boolean Whether physical shipping is required for the variant.
SKU String Variant SKU number.
taxable Boolean Whether the variant is taxable.
title String Title of the product or variant (this field only applies to custom line items).
totalDiscount Money Total amount discounted from the order. Includes line item and order-level discounts.
unfulfilledDiscountedTotal Money
unfulfilledOriginalTotal Money
unfulfilledQuantity Integer
variantTitle String Name of the variant.
vendor String Name of the vendor who made the variant.

Learn more

Ready to start selling with Shopify?

Try it free