Browse the docs

Agent setup guide

Abandoned Cart Recovery Writer

Abandoned Shopify checkouts from opted-in shoppers get two reminders written for the products in the cart, sent through your Klaviyo flows, unless they ordered.

Available About 20 min to set up

What it does

Abandoned Shopify checkouts from opted-in shoppers get two reminders written for the products in the cart, sent through your Klaviyo flows, unless they ordered.

  • Starts for each new abandoned Shopify checkout.
  • Checks in code that the shopper accepted email marketing at checkout and left a valid email; otherwise nothing is sent.
  • After 1 hour, reads the shopper's newest order: if it came from this checkout (checked in code), nothing is sent.
  • AI writes two reminders for the products in the cart, with only the reassurances and discount code you gave.
  • After your approval (or straight away, if you switch review off) reminder 1 goes to Klaviyo as an event; your flow sends it with your template and unsubscribe link.
  • 24 hours later it checks again and sends reminder 2 only if they still haven't ordered.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • Shopify and Klaviyo, connected in Settings → Integrations.
  • Two Klaviyo flows triggered by “Cart reminder 1 ready” and “Cart reminder 2 ready”.

What it doesn't do

  • Shoppers who didn't accept email marketing at checkout get nothing.
  • It doesn't design the email or send it itself: your Klaviyo flows do, once per checkout.
  • It never invents discounts, stock levels or deadlines.
  • Shopify only; turn off Shopify's own abandoned-checkout email (or Klaviyo's built-in cart flow) so shoppers don't get both.
  • Waits need Wait steps (migration 0062) in your workspace.

Availability and plans

Available

Its workflow is built and tested, and every app it needs is live. You can get it and set it up now.

Included free on the Enterprise plan; on other paid plans it's a one-time purchase per workspace (the price is on the Agents page). The Agents page in the app always shows its current status.

Before you start

  • A paid plan: agents run live, and the Free plan only runs Dry Runs.
  • An AI provider key (OpenAI, Anthropic, Google and more) in Settings → AI Providers. AI usage is billed by your provider.
  • These apps, connected in Settings → Integrations: Shopify and Klaviyo.
  • The app it watches, connected in Settings → Integrations (the agent starts from an app event).
  • About 20 minutes.

Set it up step by step

Get the agent first (buy it, or it's already yours when your plan includes it), then in Agents → My agents press “Set up this agent”. That creates the agent's workflow in your workspace (it counts towards your plan's workflow limit) and opens the canvas with a setup checklist above it. Each item links to the exact place to go and ticks itself off when it's done.

1. Connect your AI provider

The AI steps run on your own key (OpenAI, Anthropic, Google and more). Add one in Settings → AI Providers.

2. Connect Shopify

Connect your store with a custom app that has read_orders (allow protected customer data for the shopper's details) (Settings → Integrations → Shopify).

3. Connect Klaviyo

Connect Klaviyo with a private key that has events:write (Settings → Integrations → Klaviyo).

4. Pick your store

Open the trigger and both “Did they order since?” steps and pick your Shopify store.

SettingWhat to enterIn step
Shopify storeThe Shopify store whose abandoned checkouts start a run. Pick your connected Shopify account.“New abandoned checkout”
Shopify store (first check, same one)The same Shopify store. Pick your connected Shopify account.“Did they order since?”
Shopify store (second check, same one)The same Shopify store. Pick your connected Shopify account.“Did they order since? (again)”

5. Describe your store

Open “Write both reminders” and replace the placeholder with your rules and review switch.

SettingWhat to enterIn step
Your store and review switchReplace the placeholder with your store, tone, reassurances, any discount code with its terms, sign-off and REVIEW BEFORE SENDING: yes or no. It starts as “[YOUR STORE'S NAME, YOUR TONE, WHAT HELPS PEOPLE DECIDE (FREE SHIPPING OVER AN AMOUNT, RETURNS, GUARANTEES — EXACT TERMS), A DISCOUNT CODE FOR THE SECOND REMINDER WITH ITS EXACT TERMS (OR NONE), YOUR SIGN-OFF, AND WHETHER EACH CART'S REMINDERS NEED YOUR APPROVAL. REVIEW BEFORE SENDING: yes]” until you replace it.“Write both reminders”

6. Pick Klaviyo

Open both “Send reminder … to Klaviyo” steps and pick the account. Build the Klaviyo flows on “Cart reminder 1 ready” and “Cart reminder 2 ready”.

SettingWhat to enterIn step
Klaviyo accountThe Klaviyo account with your reminder flows (the key needs events:write). Pick your connected Klaviyo account.“Send reminder 1 to Klaviyo”
Klaviyo account (reminder 2, same one)The same Klaviyo account. Pick your connected Klaviyo account.“Send reminder 2 to Klaviyo”

7. Test it with Dry Run

Press Dry Run: the agent runs on sample data with no messages sent and nothing written to your apps.

8. Switch the trigger on

Open the trigger and press “Activate app trigger”: new abandoned checkouts are picked up every few minutes, and each run waits before sending.

How it works

The agent is a normal workflow with 25 steps (1 AI step, with a person approving in Reviews). You can open, edit and monitor it like any other workflow.

  • New abandoned checkout — Starts on “New abandoned checkout” in Shopify (an app event). Starts a run for each checkout a shopper left unpaid after entering an email (Shopify is checked every few minutes).
  • Opted in, with an email? — Step. In code: a valid email, the shopper accepted email marketing at checkout, and Shopify gave a recovery link. Otherwise nothing is sent.
  • Can we email them? — Decision: picks the branch to follow. No consent, email or recovery link: nothing is sent.
  • Not emailed — Kept in the run history. Branch: Can't email. The shopper didn't opt in to email marketing, or the checkout had no email or recovery link.
  • Wait 1 hour — Waits 1 hour. Branch: Opted in. Gives the shopper 1 hour to finish on their own. Change the time on this step.
  • Did they order since? — Shopify: Find orders. Reads the shopper's newest order in Shopify.
  • Same checkout? — Step. In code: does the shopper's newest order come from this checkout? Then they finished and nothing is sent.
  • Still abandoned? — Decision: picks the branch to follow. Finished checkout: nothing is sent.
  • Recovered before any email — Kept in the run history. Branch: They ordered. The shopper finished checking out.
  • Write both reminders — AI step (runs on your AI provider key). Branch: Still abandoned. AI writes the two reminder emails for the products in this cart, in your voice, with only the reassurances and code you gave.
  • Check the wording — Step. In code: both subjects and intros are there, under 400 characters, with no leftover placeholders.
  • Review first? — Decision: picks the branch to follow. Incomplete wording is held. With review on (the default) both reminders wait for you; with review off they go straight on.
  • Held: nothing sent — Kept in the run history. Branch: Incomplete. The wording was blank, too long or still had a placeholder.
  • Approve both reminders — A person approves or rejects it in Reviews (the run waits). Branch: Review first. Both reminders wait in Reviews: edit them and approve. Reject to send nothing for this cart.
  • Check before sending — Step. Branch: No review / Approved. In code, after any edits: both reminders are still filled in, under 400 characters, with no placeholders.
  • Passed? — Decision: picks the branch to follow. Passed: reminder 1 goes to Klaviyo. Otherwise nothing is sent.
  • Held after review — Kept in the run history. Branch: Held. An edit left a placeholder or made a reminder too long.
  • Send reminder 1 to Klaviyo — Klaviyo: Track an event. Branch: Send. Records a “Cart reminder 1 ready” event on the shopper's profile with the wording, the cart and the recovery link; your Klaviyo flow on that metric sends the email (once per checkout).
  • Wait 24 hours — Waits 24 hours. Waits 24 hours before the second reminder. Change the time on this step.
  • Did they order since? (again) — Shopify: Find orders. Reads the shopper's newest order in Shopify again.
  • Same checkout? (again) — Step. In code: does the newest order now come from this checkout?
  • Still abandoned? — Decision: picks the branch to follow. Finished checkout: no second reminder.
  • Recovered after reminder 1 — Kept in the run history. Branch: They ordered. The shopper finished checking out; no second reminder.
  • Send reminder 2 to Klaviyo — Klaviyo: Track an event. Branch: Still abandoned. Records a “Cart reminder 2 ready” event with the second wording (and your code, if any); your Klaviyo flow on that metric sends it.
  • Both reminders sent — Kept in the run history. Klaviyo has both events; your flows send the emails.

Test it with Dry Run

Press Dry Run in the canvas. The agent runs on the sample data stored on its trigger (the “Sample data for Dry Run” box), so you can check every step's output before anything is live. The sample has the same shape as a real event from the app.

Sample data fields

id, token, email, phone, recovery_url, total_price, subtotal_price, currency, customer_id, customer_first_name, buyer_accepts_marketing, line_items (a list), created_at, completed_at, checkout.

  • Nothing is sent or written: app actions, emails and Slack posts are simulated, and AI steps don't call your AI provider.
  • Approval steps use the Dry Run decision you pick in the step's settings (approved, rejected or timeout), so you can try each branch.
  • Wait steps don't wait: they report how long they would wait and the run goes on.

Go live

  • Open the trigger and press “Activate app trigger”: new abandoned checkouts are picked up every few minutes, and each run waits before sending.
  • Activating the app trigger needs the trigger's connected account. The first check only remembers what's already there, so older items don't start runs; the same item never starts two runs.
  • The setup checklist adds a “paid plan” item before activation: live runs need a paid plan (the Free plan only runs Dry Runs).
  • When every checklist item is done and the trigger is on, the checklist says “Live — this agent is running”. Follow its runs in the workflow's History tab and in Analytics → Agents.

Questions

Why Klaviyo and not Gmail?

Cart reminders are marketing email. Sending them through your Klaviyo flows keeps your template, unsubscribe link and consent rules in one place; the agent also sends nothing unless the shopper accepted email marketing at checkout.

How does it know they finished checking out?

Before each reminder it reads the shopper's newest Shopify order and checks in code whether it came from this checkout. If it did, nothing more is sent.

What's in the Klaviyo events?

reminder (1 or 2), first_name, subject, intro, discount_code, recovery_url, items, total and currency. Use them in your flow's email as {{ event.intro }}, {{ event.recovery_url }} and so on.

Can I change the timing?

Yes: change the hours on the two Wait steps (1 and 24 by default).

Troubleshooting

  • “No AI provider connected” or a rejected key: connect or fix the key in Settings → AI Providers, then press Test there.
  • A checklist item stays unticked: the setting is still empty or still contains its placeholder text. Open the step from the checklist and fill it in.
  • An app step fails with “Needs reconnect”: the account's access was revoked or expired. Reconnect it in Settings → Integrations.
  • No runs start: activate the app trigger with a connected account. Only items created after activation start runs.
  • A run shows as paused: it's waiting for someone in Reviews to approve or reject it.
  • A run shows “Waiting until …” in History: that's a Wait step; it continues on its own (it can be cancelled through the API).
  • A step failed: open the run in History and check that step in the Trace tab for the error and what it received.

Generated from the agent's own workflow, so it always matches what the agent does. Last updated .