Recover failed WooCommerce orders with personalized email drafts

By General Input

Every 4 hours, find WooCommerce orders stuck in failed or pending payment, draft personalized recovery emails in Gmail, and post a Slack rollup for the revenue team.

Integrations

  • WooCommerce
  • Gmail
  • Slack

Type

Agentic Task

Categories

  • Sales
  • Marketing

Build me an agent workflow that recovers lost revenue from WooCommerce orders that got stuck in failed or pending payment. It should run on a cron schedule every 4 hours.

On each run, the agent should call WooCommerce List Orders filtered to status of failed or pending, and to orders created between 2 hours ago and 48 hours ago. The 2 hour floor avoids hassling people who are still actively checking out. The 48 hour ceiling avoids cold outreach where the buyer has moved on.

For each matching order, the agent should pull the customer's billing first name, billing email, the line items (product name, quantity, total), the order total, and the order currency. If the order already has notes or meta indicating a recovery email has been sent, or the status changed to refunded or cancelled in the meantime, skip it. Group orders by billing email so one customer with two stuck carts gets a single email, not two.

For every remaining buyer, write a friendly, specific recovery email. The email should reference the actual products in their cart by name (not a generic 'your order'), acknowledge that payment did not go through without blaming them, and include a fresh checkout link back to their WooCommerce order. Keep it short, warm, and human. No 'Dear Customer'. Use the billing first name when available.

Stage each email by calling Gmail Create a Draft, with the buyer's billing email in the To field and a clear subject like 'Finish your {{product}} order' or 'Looks like checkout didn't go through'. Drafts let a human review before sending. Do not auto-send.

After all drafts are staged, call Slack Send a Message once with a rollup of everything created in this run. The rollup should list each customer's first name, the order total with currency, and the products in the cart, plus a one-line total for the run (for example 'Drafted 7 recovery emails covering $1,240 in stuck orders'). Post it to the revenue team's channel. If zero drafts were created on a run, post a single quiet line saying so rather than a big empty rollup.

Make the cron schedule, the order age window (2 to 48 hours), the Slack channel, the email tone, and the 'skip if already recovered' check easy to adjust at the top of the workflow so the operator can tune them without rewriting the logic.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsChase the paperwork every new client and vendor still owesFile Gmail attachments into storage with names you can findWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teams