A comprehensive n8n workflow that enables customers to browse products, place orders, track shipments, and make payments directly through WhatsApp. This bot integrates WooCommerce, Razorpay payment gateway, and AI-powered customer support to create a seamless conversational commerce experience.
✨ Key Features
- 🛍️ Product Discovery: Share product URLs via WhatsApp to get instant product details, pricing, and stock status
- 📦 Order Creation: Place orders directly through WhatsApp with natural language commands
- 🚚 Order Tracking: Real-time order status updates and tracking information
- 📍 Address Management: Easy address collection and update through structured messages
- 💳 Payment Processing: Automated Razorpay payment link generation
- 🖼️ Payment Confirmation: Image/screenshot upload support for payment verification
- 🤖 AI Support: OpenAI-powered general customer support for queries
- 📱 Multi-scenario Routing: Intelligent query detection and routing
🔧 Prerequisites
Required Accounts & Services
- n8n Instance (self-hosted or cloud)
- WooCommerce Store with REST API access
- Razorpay Account (for payment processing)
- WhatsApp API Provider (e.g., WootSap or similar)
- OpenAI API Key (for AI-powered support)
API Credentials Needed
- WooCommerce Consumer Key
- WooCommerce Consumer Secret
- Razorpay API Key & Secret
- WhatsApp API Token & Instance ID
- OpenAI API Key
📋 Setup Instructions
Step 1: Clone the Workflow
- Download the entire JSON workflow
- In n8n, go to Workflows → Import from File/URL
- Paste the JSON and import
Step 2: Configure WooCommerce Credentials
Replace placeholders in the following nodes:
Fetch Product by URL
Fetch Order
Create Order
Fetch Order by ID
Update Order Address
Replace:
[YOUR-DOMAIN].com → your-store.com
[YOUR_WOOCOMMERCE_KEY] → ck_xxxxxxxxxxxxx
[YOUR_WOOCOMMERCE_SECRET] → cs_xxxxxxxxxxxxx
Step 3: Configure Razorpay
In the Create Razorpay Payment Link
node:
- Add HTTP Basic Auth credentials (Razorpay Key ID & Secret)
- Update the
callback_url
to your store’s thank-you page - Replace
[YOUR-DOMAIN].com
with your actual domain
Step 4: Configure WhatsApp API
In the Send Message
node:
- Replace
[YOUR_WHATSAPP_API_TOKEN]
with your API token - Replace
[YOUR_WHATSAPP_INSTANCE_ID]
with your instance ID
Step 5: Configure OpenAI
In the OpenAI Model
node:
- Add your OpenAI API credentials
- Adjust temperature (default: 0.7) if needed
Step 6: Activate the Webhook
- Open the
Incoming WhatsApp
webhook node - Copy the webhook URL
- Configure your WhatsApp API provider to send incoming messages to this URL
Step 7: Test the Workflow
- Activate the workflow
- Send a test message to your WhatsApp number
- Verify responses are being sent correctly
🔄 Workflow Logic
Query Type Detection
The workflow intelligently detects different query types:
Query Type | Detection Pattern | Example |
---|---|---|
Product URL | Domain product links | https://yourstore.com/product/awesome-item |
Order Lookup | “track”, “status”, “order” + number | Track order 1234 |
Create Order | “order product [ID] quantity [N]” | Order product 567 quantity 2 |
Update Address | “order [ID]” + address fields | Order 1234\nName: John...\nPincode: 400001 |
Payment Screenshot | Image message | [Uploads payment screenshot] |
General Query | Everything else | What's your return policy? |
Workflow Branches
Incoming Message
↓
Extract Data → Detect Query Type → Route to Handler
↓ ↓
├─→ Product URL ────→ Fetch & Display Product
├─→ Order Lookup ───→ Track & Show Status
├─→ Create Order ───→ Create WooCommerce Order
├─→ Update Address ─→ Update Order → Generate Payment Link
├─→ Payment Image ──→ Acknowledge Receipt
├─→ Ask Order ID ───→ Prompt for Details
└─→ General ────────→ AI Support Response
↓
Send WhatsApp Message
💬 Customer Usage Examples
1. Browse Product
Customer sends:
https://yourstore.com/product/wireless-headphones
Bot responds:
✨ *Wireless Headphones*
💰 *Price:* ₹2,499
📦 *Stock:* ✅ In Stock
📄 *Description:*
Premium wireless headphones with noise cancellation...
�Cart *To order, reply:*
"Order product 567 quantity 1"
Product ID: 567
2. Place Order
Customer sends:
Order product 567 quantity 1
Bot responds:
✅ *Order Created!*
📋 *Order #1234*
🆔 *Order ID:* 1234
📦 *Items:*
1. Wireless Headphones × 1 = ₹2,499
🚚 *Shipping:* ₹120
💰 *Total:* ₹2,619
📝 *Next: Provide Shipping Address*
Reply in this format:
Order 1234
Name: [Your Name]
Address: [Street]
City: [City]
State: [State]
Pincode: [6-digit]
3. Provide Address
Customer sends:
Order 1234
Name: Rahul Sharma
Address: 123 MG Road
City: Mumbai
State: Maharashtra
Pincode: 400001
Bot responds:
✅ *Order Confirmed!*
📋 *Order #1234*
💰 *Total Amount:* ₹2,619
📍 *Shipping To:*
Rahul Sharma
123 MG Road
Mumbai, Maharashtra
PIN: 400001
💳 *Complete Payment:*
https://rzp.io/i/ABC123XYZ
⚡ Pay securely via UPI/Card/NetBanking/Wallet
✅ After payment, send screenshot for confirmation
🙏 Thank you for your order!
4. Track Order
Customer sends:
Track 1234
Bot responds:
📦 *Order #1234*
📊 *Status:* PROCESSING
📅 *Date:* 09/10/2025
💰 *Total:* ₹2,619
📦 *Items:*
1. Wireless Headphones x1 - ₹2,499
🚚 *Shipping:*
Rahul Sharma
123 MG Road
Mumbai, Maharashtra - 400001
✨ Being prepared!
💬 Need help? Just ask!
⚙️ Customization Options
Modify Shipping Cost
In Prepare Order Data
node:
const shippingCost = "120.00"; // Change this value
Adjust AI Personality
In AI Agent
node, modify the system message:
"You are a customer support AI assistant. Your job is..."
// Customize tone, style, and behavior
Add Custom Order Metadata
In Prepare Order Data
node, add to meta_data
array:
meta_data: [
{ key: "_whatsapp_order", value: "true" },
{ key: "_custom_field", value: "your_value" }
]
Modify Product Display Format
Edit the Format Product Info
node to change how products are displayed.
🐛 Troubleshooting
Issue: Webhook not receiving messages
Solution:
- Verify webhook URL is correctly configured in WhatsApp API provider
- Check workflow is activated
- Test webhook URL directly using a tool like Postman
Issue: WooCommerce API errors
Solution:
- Verify consumer key and secret are correct
- Ensure WooCommerce REST API is enabled
- Check API permissions in WooCommerce settings
Issue: Razorpay payment link creation fails
Solution:
- Verify Razorpay credentials in HTTP Basic Auth
- Ensure amount is in smallest currency unit (paise for INR)
- Check Razorpay account is activated
Issue: AI responses not working
Solution:
- Verify OpenAI API key is valid
- Check OpenAI account has sufficient credits
- Review API rate limits
Issue: Phone number validation failing
Solution:
- Ensure phone numbers are in correct format (10 digits minimum)
- Check
remoteJid
format from WhatsApp API matches expected pattern
🔒 Security Considerations
- API Credentials: Store all API keys as n8n credentials, not hardcoded
- Phone Verification: The workflow validates phone numbers against order billing phone
- Payment Security: Payment processing handled by Razorpay PCI-DSS compliant gateway
- Data Privacy: Consider adding GDPR compliance measures for customer data
📊 Monitoring & Analytics
Recommended Additions
- Error Logging: Add error handling nodes to catch and log failures
- Analytics Tracking: Store order events in a database for reporting
- Notification System: Alert admins for failed orders or payment issues
- Customer Feedback: Add post-purchase satisfaction survey
🚀 Advanced Enhancements
Potential Features to Add
- Multi-language Support: Detect customer language and respond accordingly
- Product Recommendations: Suggest related products based on order history
- Promotional Campaigns: Send targeted offers via WhatsApp
- Inventory Alerts: Notify when products are back in stock
- Order Cancellation: Allow customers to cancel orders within a timeframe
- Review Collection: Request product reviews after delivery
📝 License
This workflow template is provided as-is for use with n8n. Ensure you comply with all API provider terms of service.
🤝 Support
For issues or questions:
- Check n8n community forum
- Review API provider documentation
- Verify all credentials and configurations