AI/ML
n8n Shopify Automation: Convert Abandoned Carts into Sales
Overview
n8n monitors Shopify for abandoned carts, waits 30 minutes, then sends a personalized email with a discount code to nudge customers back to purchase.
Prerequisites
- n8n installed.
- Shopify store with checkout webhook.
- Email service (e.g., SendGrid) account.
Workflow Setup
Prepare n8n Environment
Navigate to http://localhost:5678 (or your n8n hosted URL) and log in with your credentials.
In the sidebar, click “Workflows,” then select “+ New” and name it (e.g., “Campaign Tracker”). Click “+” on the canvas to open the node selector.
Trigger Node: Shopify Webhook
Node: Webhook
Settings:
Method: POST
Path: shopify-cart-abandon
Shopify Webhook: “Checkout Abandonment” at https://<n8n-host>/webhook/shopify-cart-abandon
Output: Cart data (e.g., {{ $json.body.email }}).
Delay Node: Wait
Node: Wait
Settings:
Time: 30 minutes
Purpose: Gives customers time to return naturally.
Check Status Node: HTTP Request
Node: HTTP Request
Settings:
URL: https://<your-shopify-store>.myshopify.com/admin/api/2023-10/checkouts/{{ $node["Webhook"].json.body.token }}
Method: GET
Authentication: Shopify API key
Output: Checks if cart is still abandoned.
Send Email Node: SendGrid
Node: SendGrid
Settings:
Credentials: SendGrid API key
To: {{ $node["Webhook"].json.body.email }}
Subject: Complete Your Purchase!
Body: Hi, you left items in your cart. Use code RECOVER10 for 10% off! <link-to-cart>
Output: Email sent if cart remains abandoned.
Workflow Summary
- Flow: Webhook (cart abandon) → Wait (30min) → HTTP Request (status check) → SendGrid (email).
- Execution: ~30 minutes delay, then instant.
Benefits
- Recovers 10-15% of abandoned carts (industry avg.).
- Automates outreach, saving marketing time.
- Boosts revenue with minimal effort.
Troubleshooting
- Email Not Sent: Verify SendGrid API key and cart status logic.
- Webhook Delay: Ensure n8n server is running.
Ready to transform your business with our technology solutions? Contact Us today to Leverage Our AI/ML Expertise.
Comment