WhatsApp order confirmations for new Shopify orders

When a new Shopify order lands, send the customer a WhatsApp confirmation through Heyy and log the order to a Google Sheet.

Deterministic Code
ShopifyHeyyGoogle SheetsOperationsMarketingNotifications & AlertsData Sync

Build me a deterministic code workflow that fires on a Shopify orders/create webhook. For every new order, send the customer a WhatsApp order confirmation through Heyy and log the order to a row in my Google Sheets order log.

At workflow start (a one-time setup step that runs the first time the workflow executes), resolve two things from my Heyy workspace and cache them on the workflow:

1) The label ID for the label named new_order. Look it up from the workspace's Heyy labels list. This is the label that is already wired to my WhatsApp order confirmation template, so attaching it to a contact is what sends the message.

2) The externalIds for three Heyy custom contact attributes: last_order_id, last_order_total, and last_order_items. Use Heyy's List Contact Attributes operation to find them by name. Custom attributes have to be written by externalId, not display name.

Both the label name (new_order) and the three attribute names should be exposed as workflow settings so I can rename them later without editing code. If any of them can't be resolved at start, fail the workflow with a clear error telling me which name is missing in Heyy.

On every Shopify orders/create event, pull these fields from the payload: customer first and last name, customer phone, customer email, order number (name field, e.g. #1042), order total (total_price), currency, order created_at timestamp, source_name (the channel like web, pos, instagram), and a one-line items summary built from line_items as a comma-separated list of quantity x title (e.g. "2 x Blue Tee, 1 x Black Cap").

If the order has a non-empty customer phone, call Heyy's Create Contact operation with phone, name (first + last), and email, attach the new_order label by its resolved ID, and set the three custom attributes via their resolved externalIds: last_order_id = order number, last_order_total = formatted as total + space + currency (e.g. "129.00 USD"), last_order_items = the items summary string. Heyy will upsert by phone and fire the WhatsApp confirmation template via the label automation.

If the order has no customer phone, skip the Heyy step entirely (don't try to call it with a null phone) but still log the row. Either way, call Google Sheets Append Values to append one row to the Orders log tab of my spreadsheet with these columns in order: order number, customer name, order total, currency, channel (source_name), order timestamp (created_at). Make the spreadsheet ID and tab name workflow settings I can edit.

Treat the Heyy call and the Google Sheets call as independent: if Heyy fails (rate limit, bad attribute, etc.) still try to write the sheet row, and surface a clear error so I can see which side failed. Don't retry inside the workflow if Heyy returns a non-retryable error like 400 or 404. For 429 from Heyy, back off and try once more.

Every step is a fixed field mapping with no judgment required, so build this as a code workflow with discrete nodes, not an agent.

Additional information

What does this prompt do?
  • Sends each new Shopify customer a WhatsApp order confirmation by adding them to Heyy with a label that fires your existing confirmation template.
  • Saves the customer's last order number, total, and one-line items summary onto their Heyy contact so future messages can reference what they bought.
  • Appends one row per order to a Google Sheets order log with the order number, customer, total, currency, channel, and timestamp.
  • Skips the WhatsApp step cleanly when an order has no customer phone, but still writes the row to your sheet so nothing is lost.
What do I need to use this?
  • A Shopify store you can configure to send new-order notifications to General Input.
  • A Heyy workspace with a WhatsApp confirmation template already wired to a label (for example, a label named new_order).
  • A Google account and a spreadsheet with an Orders log tab ready to receive new rows.
How can I customize it?
  • Change the Heyy label name so a different WhatsApp template fires (for example, swap new_order for vip_order on high-value carts).
  • Adjust which order fields land on the Heyy contact, like adding shipping city or first product SKU alongside the order total.
  • Point the Google Sheets step at a different spreadsheet or tab, or reorder the columns in your Orders log to match how your team already tracks sales.

Frequently asked questions

Will this send a WhatsApp message for every order, including repeat customers?
Yes. Every new Shopify order triggers the flow, so returning customers get a fresh confirmation each time. Heyy updates the existing contact with the latest order details rather than creating duplicates.
What happens if a customer checks out without a phone number?
The WhatsApp step is skipped for that order, so no message is attempted. The row is still written to your Google Sheets order log so your records stay complete.
Do I need to write the WhatsApp message inside this workflow?
No. Your WhatsApp template lives in Heyy and is wired to a label. This workflow just adds the customer to that label, and Heyy sends the template you already approved.
Can I log to a different spreadsheet for each Shopify store?
Yes. The Google Sheets step is a single setting, so you can point it at whichever spreadsheet and tab you like, or duplicate the workflow per store.
Is this realtime or on a schedule?
Realtime. Shopify pings General Input the moment an order is placed, and the WhatsApp confirmation and sheet row follow within seconds.

Stop copying order details into Heyy and your spreadsheet by hand.

Connect Shopify, Heyy, and Google Sheets once, and every new order books its own WhatsApp confirmation and log entry.