What you need
Message limits. Each customer gets at most 3 messages if they never reply: an intro and 2 follow-ups. After that, a 7-day cooldown tag stops a repeat abandoner from restarting the sequence. The cooldown length is the one setting you tune: the
Wait 7 days step in Workflow 4.
How it fits together
400 LINK_IN_FIRST_MESSAGE), and iOS does not make links from unknown senders tappable until they reply. So text 1 asks a question. Links go in the follow-ups, and the bot sends the link the moment the shopper replies.
First text. Expect the first text roughly 15 to 20 minutes after a shopper leaves checkout. We measured this once (the Customer abandons checkout trigger fired about 16 minutes after the shopper left checkout in our test). Shopify does not document the timing.
Timing. Follow-ups go out 1 day and 3 days after the abandonment. Each is skipped automatically if the shopper replied (Tuco skipIfReplied). All pending texts are cancelled when they order. Sends happen between 09:00 and 20:00 in your shop’s time zone.
Step 1. Create the API key and the Flow secret
- In Tuco, go to Settings, then API keys, and create a key named “Shopify Flow”. Copy it once.
- In Shopify admin, go to Apps, then Flow, then Settings, then Secrets. Add a secret with handle
tuco_api_keyand the key as the value. You need the “Manage connections and secrets” staff permission. Flow hides it in run logs. - Every HTTP action below uses two headers:
Authorization=Bearer {{secrets.tuco_api_key}}andContent-Type=application/json.
Pasting into Flow: rules that bite
- No
{or}inside{{ ... }}. Flow’s Liquid ends an output tag at the first}. The bodies do all brace cleaning inside{% assign %}tags. Keep this rule if you edit a template. - Metafield values are single-line text. Paste with no trailing newline.
- Click the editor’s first line, then paste. Clicking the panel background makes Flow try to paste steps onto the canvas.
- Fill the Body before the URL field, then re-check the URL. In testing the URL lost its value when the body was pasted after it.
Step 2. Metafield definitions: not required
Skip creating definitions. The Update customer metafield action writes unstructured metafields: you give it Namespace, Key and Type directly. W2 reads them back through the customer’s metafield list, which needs no definition.Step 3. Build Workflow 1, “Tuco · 1 · Abandoned checkout → mark”
- In Flow, click Create workflow and name it. Trigger: Customer abandons checkout.
- Add a Condition with these criteria, joined with AND:
abandonment.customerHasNoOrderSinceAbandonmentis truecustomer.defaultPhoneNumber.smsMarketingConsent.stateequalsSUBSCRIBED(the consent gate). Do not usecustomer.phoneorcustomer.smsMarketingConsent: Flow lists them as deprecated.- A list criterion: None of
customer/tags, item Equal totuco-cooldown
- In the “Then” branch, add four Update customer metafield actions. For each, use Namespace
tuco, the Key below, Type Single line text, and paste the code into Value. - Last action: Add customer tags with
tuco-abandoned-checkoutandtuco-cooldownin one action. - Turn the workflow on.
Key checkout_url
Key checkout_url
Key cart_summary
Key cart_summary
Key cart_items
Key cart_items
Key cart_total
Key cart_total
cart_summary uses a for loop and forloop.first, because Flow’s Liquid has no list indexing.
Step 4. Build Workflow 2, “Tuco · 2 · Text the shopper”
- Trigger: Customer tags added. Condition:
tagscontainstuco-abandoned-checkout. - Do not add customer tags anywhere in this workflow. It would loop.
- Action: Remove customer tags with
tuco-abandoned-checkout. This re-arms W1 for the customer’s next abandonment. - Add four Send HTTP request actions. The easiest way is Import from cURL. Make sure the secret from Step 1 exists first (Flow, then Settings, then Secrets, handle
tuco_api_key), because the pasted command refers to{{secrets.tuco_api_key}}. For each action: Send HTTP request, then Import from cURL, paste the whole command below, then Import. Flow fills the method, URL, both headers and the multi-line Liquid body in one go. Then set the 4XX and 5XX dropdowns as listed and re-check the URL and body.
A 4XX means the request is wrong (bad phone, link in a first message, bad key). Retrying the same body never fixes it, so Fail and read the run log. 5XX and 429 are temporary, so Retry. Retries are safe: every
/api/messages body carries an idempotencyKey (shopify-ac-<customer id>-<yyyymmdd>-intro, -fu1 or -fu2). Tuco keeps keys for 24 hours and a replay returns the original response.
Every W2 body starts with a for mf in customer.metafields loop that reads the four values W1 stored. You do not need the variable picker.
HTTP 1: intro (no link)
HTTP 1: intro (no link)
HTTP 2: tag the lead and save the cart
HTTP 2: tag the lead and save the cart
HTTP 3: follow-up 1 (+1 day)
HTTP 3: follow-up 1 (+1 day)
HTTP 4: follow-up 2 (+3 days)
HTTP 4: follow-up 2 (+3 days)
Authorization: Bearer {{secrets.tuco_api_key}} and Content-Type: application/json, and the matching body below. Fill the Body before the URL.
Fallback body: intro
Fallback body: intro
Fallback body: follow-up 1
Fallback body: follow-up 1
Fallback body: follow-up 2
Fallback body: follow-up 2
scheduledDate when the workflow runs ("now" | date_plus: "1 day", and 3 days for follow-up 2). skipIfReplied of "2d" and "4d" makes Tuco cancel the queued send if the shopper replied in that window. In follow-up 2, edit the marked discountCode line: it must be a real Shopify discount code, or set it to "" to drop the sentence.
The /api/leads/tags call uses customFields, which merges the cart data into the lead (matched by phone). See Add or remove lead tags. The goal bot reads these fields.
Step 5. Build Workflow 3, “Tuco · 3 · Stop when they buy”
- Trigger: Order created. Condition:
order.customer.defaultPhoneNumber.phoneNumberis not empty. - Send HTTP request, then Import from cURL, with the first command below (POST
https://app.tuco.ai/api/messages/cancel-for-lead). 4XX Ignore, 5XX Retry. Cancelling is idempotent: Tuco returns 200 even with nothing pending. See cancel for lead. - Send HTTP request, then Import from cURL, with the second command below (POST
https://app.tuco.ai/api/leads/tags). 4XX Ignore (most buyers were never texted, so404 lead_not_foundis normal), 5XX Retry.
Cancel command
Cancel command
Tag command
Tag command
Manual fallback body: cancel
Manual fallback body: cancel
tuco-cooldown.
Step 6. Build Workflow 4, “Tuco · 4 · Cooldown release”
- Trigger: Customer tags added. Condition:
tagscontainstuco-cooldown. - Action: Wait 7 days. This is the cooldown length.
- Action: Remove customer tags with
tuco-cooldown. Do not add tags here.
Step 7. Create the goal bot
The bot answers when a lead that carries the tagshopify-abandoned-checkout replies. It reads the stored cart and checkout link from the lead’s custom fields.
Create it paused, so it cannot answer anyone until you have tested it. See Create goal bot.
abandoned-checkout.json:
- Replace the
[MERCHANT: ...]text in the prompt with one discount code and its terms, or writeNo discount authorised. - Load your shipping, returns and FAQ pages into the Tuco knowledge base. The bot answers product and policy questions only from it. If the knowledge base does not say, the bot says it is not sure and that a teammate will follow up.
- Run a simulation. Nothing is sent.
- Set the bot to active in Goal bots, or with
PATCH /api/goal-bots/{id}and{ "status": "active" }(update).
Step 8. Test with your own phone
- Add a customer for yourself in Shopify with your E.164 phone and SMS marketing set to subscribed.
- Start a checkout as that customer (email and phone) and leave. Wait for Shopify to fire “Customer abandons checkout”. The Flow run log shows when. To skip the wait, set the four metafields by hand and add the tag
tuco-abandoned-checkoutto your customer. - In Flow, open the W2 run log. All four HTTP steps should be green. You get text 1 (no link) inside the send window. Reply “yes”. The bot sends your link.
- In Tuco, check that the lead has the tag
shopify-abandoned-checkoutand the custom fieldsshopify_checkout_url,shopify_cart_items,shopify_cart_totalandshopify_abandoned_at. Two scheduled messages should be pending. - Complete the order. W3 runs, the pending messages are cancelled, and the tag becomes
shopify-customer.
Troubleshooting
Verified in a real store
Tested on 2026-12-04 in a Shopify dev store on a Grow plan.- W2 activated and fired. Shopify sent valid JSON:
recipientPhone+13054952897(E.164), a name with quotes escaped correctly, anidempotencyKeysuch asshopify-ac-31632508289058-20261204-intro, andscheduledDatefrom"now" | date_plus: "1 day" | date: "%Y-%m-%dT%H:%M:%S%z", for example2026-12-05T14:49:18+0000. Thetimezonecame fromshop.ianaTimezone. Thefor mf in customer.metafieldsloop was accepted by the editor and by activation. - W1 activated.
abandonment.abandonedCheckoutPayload.abandonedCheckoutUrl,lineItems(title,quantity,variantTitle),subtotalPriceSet.presentmentMoney.amountand.currencyCode, andabandonment.customerHasNoOrderSinceAbandonmentwere all accepted. - Update customer metafield, then the Metafield dropdown, then Use an unstructured metafield, then Namespace, Key, Type Single line text and Value. No definition is needed.
- The Customer abandons checkout trigger fired about 16 minutes after the shopper left checkout in this test. Shopify documents no timing. W1 stored the real recover URL and the items, and the W1 to W2 chain worked end to end.
- Found and fixed along the way: braces inside
{ }break Flow’s tokenizer, metafield values must not end in a newline,customer.phoneandcustomer.smsMarketingConsentare deprecated, and an empty cart used to render “your your cart” with a dangling link colon. The follow-ups now handle empty metafields.
Limits and caveats
- Shopify plan. You need Grow, Advanced or Plus for the HTTP action.
- Volume. Each Tuco line can start conversations with 50 first-time contacts per day. Add lines for more volume. See pricing.
- SMS fallback. If a number is not on iMessage, Tuco can fall back to SMS. SMS fallback only reaches numbers in the line’s country, so a US line reaches US numbers. See failures and fallbacks.
- You write the AI rules. The goal bot prompt is yours to edit and test. Tools that write the rules for you save time, but you give up control over what is said.
- Consent is yours. Tuco does not decide whether you may text a customer. See iMessage compliance.
Goal bots
How goal bots read lead fields, use the knowledge base and hand off to a person.