Skip to content
Automation Squad
ShGSTwMade to order

Ecommerce & orders

Shopify abandoned checkout → Twilio SMS with the recovery link

Carts still open after an hour get one text with their own checkout link.

Every change to a checkout reaches n8n as a Shopify webhook. The run keeps the first event that carries SMS consent, waits a set time, checks whether the checkout became an order, and if not sends one SMS through Twilio with the customer's own recovery link. A Google Sheet holds each checkout to one text and each phone number to one a week. For stores that want abandoned-cart texts without paying for an app.

How it works

  1. Sh

    Trigger

    Checkout created or updated (checkouts/update webhook)

    Shopify

  2. if

    Step 1

    Gate on SMS consent

    Only events where buyer_accepts_sms_marketing is true and sms_marketing_phone is filled continue; Shopify sets both once the customer ticks the consent box, so earlier updates for the same checkout fall through.

  3. GS

    Step 2

    Record the checkout token once

    A lookup on the checkout token against the Send Log ends the run for repeat events, since Shopify fires checkouts/update on every field change; a new token gets a row with phone, cart value and a status of Waiting.

  4. if

    Step 3

    Wait for the recovery window

    A Wait node parks the run in n8n's database for 60 minutes by default; the delay is one value to change.

  5. Sh

    Step 4

    Check whether the cart converted

    A GraphQL Admin API orders query filtered on checkout_token answers whether the customer completed; a match marks the row Converted and ends the run with no message.

  6. GS

    Step 5

    Apply the per-number cap

    A lookup on the phone number finds Sent rows from the last seven days and ends the run if there is one, so a shopper who abandons twice in a week gets one text.

  7. Tw

    Step 6

    Send the recovery text

    One SMS goes from your Twilio number with the customer's first name, the first cart item and the abandoned_checkout_url; STOP replies on US and Canadian numbers are handled by Twilio's default opt-out.

  8. GS

    Step 7

    Log the send

    The checkout's row is updated with the time sent, the Twilio message SID and a status of Sent, which is what step 5 reads for the weekly cap.

What changes once it runs

  • Customers who finish checkout during the wait get nothing, because the order check runs before the send.
  • One text per checkout and at most one per phone number a week, enforced by the sheet rather than by memory.
  • The text carries the customer's own recovery URL, so the cart opens with their items and details intact.
  • Every send is logged with the Twilio message SID, so a delivery question can be traced in the Twilio console.
  • Consent is checked before anything else, and customers who did not tick the SMS box are never texted.

What you get

  • The n8n workflow export, with the consent gate, dedupe, wait, conversion check, weekly cap and send wired.
  • Send Log Google Sheet template.
  • Two SMS templates under 160 characters each, with the merge fields marked.
  • A setup guide covering Shopify scopes and consent settings, Twilio number setup and opt-out handling.
  • Screen recording of a test checkout being abandoned, texted and recovered.
  • 30 days of email support for setup questions.

Before you start

  • Shopify custom app (Dev Dashboard, or a legacy admin custom app) with an Admin API token holding read_orders; that scope covers the checkout webhooks.
  • SMS marketing consent switched on in Shopify under Settings > Checkout > Marketing options.
  • Twilio account with an SMS-capable number registered for the destination country (A2P 10DLC or toll-free verification for US traffic).
  • Google Sheet for the send log (template included).
  • n8n Cloud or self-hosted n8n with a public webhook URL.

Built for

Questions before you buy

Is this compliant with SMS marketing rules?
Consent, frequency and opt-out are covered. The workflow only texts numbers where Shopify recorded SMS marketing consent, sends one message per checkout, and leaves STOP replies to Twilio's default opt-out on US and Canadian numbers. Carrier registration is not covered: US traffic needs A2P 10DLC or toll-free verification, and the setup guide walks through it. Check the rules in your own jurisdiction before switching it on.
Can I change the delay or send a second text?
One value in the Wait node sets the delay, an hour by default; set it anywhere from one to four hours. Not a second text, though. A follow-up is where complaints start, so it is left out of this package; ask if you want a variant that sends a discount code after 24 hours.
What happens if n8n restarts during the wait?
Waits longer than 65 seconds are stored in n8n's database, not in memory, so a restart or a deploy does not lose them. When n8n comes back the waits resume and the conversion check runs as normal.
Why not use Klaviyo or a Shopify app for this?
Use it if you already pay for it. Stores on Klaviyo SMS or an abandoned-cart app already have this; the package is for stores that do not. You pay Twilio per message plus the number rental, and the send log stays in your own sheet.

Nearby on the shelf

Whole catalog