Back to Templates

Recover abandoned WooCommerce carts using OpenAI GPT-4.1-mini, Gmail and Slack

Created by

Created by: WeblineIndia || weblineindia
WeblineIndia

Last update

Last update 18 hours ago

Share


AI-Powered Abandoned Cart Recovery (WooCommerce + CoCart + n8n)

This workflow automatically tracks abandoned carts from a WooCommerce store, waits for a defined time, rechecks the cart status, generates a personalized reminder email using AI, sends it to the customer via Gmail and notifies the internal team on Slack.

It helps recover lost revenue by following up with customers at the right time using personalized, human-friendly messaging — without any manual work.

This workflow listens for abandoned cart events from your store, waits for a configurable delay (such as 30–60 minutes), verifies whether the cart is still unpaid and then automatically sends a personalized reminder email generated by AI. At the same time, it sends a Slack notification to your internal team for visibility.

You receive:

  • Automated abandoned cart detection
  • AI-generated personalized reminder emails
  • Customer email delivery via Gmail
  • Internal Slack notifications for your team

Ideal for ecommerce teams who want a simple, automated way to recover abandoned carts and improve conversion rates.

What It Does

This workflow automates the full abandoned cart recovery process:

  1. Receives abandoned cart data from the store via webhook.
  2. Normalizes incoming cart and customer information.
  3. Waits for a defined time to allow natural checkout completion.
  4. Rechecks the cart status using the CoCart API.
  5. Validates whether:
    • Items are still in the cart
    • Payment is still pending
  6. Generates a personalized reminder email using OpenAI.
  7. Extracts email subject and body from AI output.
  8. Sends the reminder email to the customer via Gmail.
  9. Sends a Slack message to notify the internal team.

If the cart is already completed, the workflow stops automatically.

Who’s It For

This workflow is ideal for:

  • Ecommerce store owners
  • WooCommerce merchants
  • Marketing teams handling cart recovery
  • Sales teams tracking abandoned purchases
  • Agencies building automation for ecommerce clients
  • Anyone wanting automated abandoned cart follow-ups

Requirements to Use This Workflow

To run this workflow, you will need:

  • n8n instance (cloud or self-hosted)
  • WooCommerce store
  • CoCart plugin installed and configured
  • OpenAI API key
  • Gmail account with OAuth access
  • Slack workspace (for internal notifications)
  • Basic understanding of webhooks and API responses

How It Works

  1. Webhook Trigger – Store sends abandoned cart data to n8n.
  2. Data Normalization – Cart key, email, product details are structured.
  3. Wait Period – Workflow pauses for a defined time (30–60 minutes).
  4. Recheck Cart – Cart status is fetched again from CoCart.
  5. Abandoned Cart Validation – Checks if items exist and payment is pending.
  6. AI Email Generation – OpenAI creates a friendly reminder email.
  7. Email Parsing – Subject and body are extracted from AI output.
  8. Customer Email – Gmail sends the reminder to the customer.
  9. Slack Notification – Internal team is notified about the abandoned cart.

Setup Steps

  1. Import the provided n8n workflow JSON file.
  2. Connect the Webhook node to your store so abandoned cart data is sent correctly.
  3. Configure the Wait node with your desired delay (example: 30–60 minutes).
  4. Ensure the CoCart API endpoint is accessible and accepts the cart key.
  5. Connect your OpenAI account to generate email content.
  6. Configure the Gmail node to send reminder emails to customers.
  7. Connect Slack credentials to receive internal notifications.
  8. Activate the workflow — abandoned cart recovery starts automatically.

How To Customize Nodes

Customize Wait Time

Adjust the Wait node to:

  • Send reminders faster (15–30 minutes)
  • Send reminders later (1–2 hours)

Customize Email Content

Modify the AI Agent prompt to:

  • Change email tone (formal, friendly, urgent)
  • Add discount messaging
  • Include brand voice or CTA text

Customize Slack Notifications

You can:

  • Change the Slack channel
  • Add mentions (@team, @sales)
  • Include cart value or product links

Add-Ons (Optional Enhancements)

You can extend this workflow to:

  • Send multiple reminder emails (1st, 2nd, final)
  • Add SMS or WhatsApp reminders
  • Apply discount codes automatically
  • Track recovered carts in a database
  • Segment customers by cart value
  • Add analytics or dashboards

Use Case Examples

1. Cart Recovery

Recover lost sales automatically without manual follow-ups.

2. Sales Team Visibility

Slack alerts keep your team informed of high-value abandoned carts.

3. Personalized Marketing

AI generates human-like emails tailored to each customer.

4. Scalable Automation

Works for one store or hundreds of carts per day.

Troubleshooting Guide

Issue Possible Cause Solution
No webhook data Webhook not connected Verify store webhook URL
Email not sent Gmail not authenticated Reconnect Gmail credentials
Cart always skipped IF conditions incorrect Check item count & payment status
AI output empty OpenAI API issue Verify API key and limits
Slack alert missing Wrong channel or token Reconnect Slack credentials

Need Help?

If you need help customizing or extending this workflow with advanced features such as adding multi-step reminders, discounts, analytics or scaling it for production, then our n8n automation experts at WeblineIndia are happy to assist you.