What This Agent Does
This workflow automates customer outreach for cancelled orders by seamlessly connecting your Shopify store with WhatsApp Business messaging. Every day at your scheduled time, the agent automatically retrieves all cancelled orders, extracts customer phone numbers, and sends personalized WhatsApp messages—all while logging detailed results to Google Sheets for complete visibility and compliance tracking.
Key benefits include:
-
Automated daily execution eliminates manual order checking and message sending
-
Instant customer communication reaches customers on their preferred messaging platform within hours of cancellation
-
Complete audit trail with detailed logging of successful sends, failures, and missing contact information
-
Time savings of 2-3 hours per day for teams managing customer retention manually
-
Improved recovery rates by reaching out to customers immediately while cancellation reasons are fresh
Target use cases: E-commerce businesses looking to reduce order cancellations, recover lost revenue, understand cancellation patterns, and maintain proactive customer communication at scale.
Who Is It For
This workflow is ideal for:
-
E-commerce store owners using Shopify who want to reduce order cancellations through immediate customer outreach
-
Customer success teams managing retention and wanting to automate routine follow-ups
-
Marketing teams seeking to understand cancellation reasons and improve product-market fit
-
Operations managers needing transparent logging and compliance documentation for customer communications
-
Growing businesses that have outgrown manual processes but need reliable, repeatable automation
No coding experience is required—this workflow handles all the technical complexity while you focus on strategy.
Required Integrations
Shopify
Why it's needed: Shopify is your data source for cancelled orders. This integration allows TaskAGI to query your store's order database and retrieve all orders with "cancelled" status, including customer details and order information.
Setup steps:
- Log into your Shopify admin dashboard
- Navigate to Settings → Apps and integrations → Develop apps
- Click Create an app and name it "TaskAGI Automation"
- In the app configuration, go to Configuration tab
- Under Admin API scopes, enable the following permissions:
-
read_orders (to retrieve cancelled orders)
-
read_customers (to access customer contact information)
- Click Save and then Activate app
- Go to the API credentials tab and copy your Access Token
How to obtain API keys/credentials:
Your Shopify Access Token is displayed in the API credentials section. This is a sensitive credential—treat it like a password and never share it publicly.
Configuration in TaskAGI:
- In your TaskAGI workspace, navigate to Integrations
- Search for and select Shopify
- Click Connect and choose Create new connection
- Paste your Access Token into the authentication field
- Enter your Shopify store URL (e.g.,
yourstore.myshopify.com)
- Click Test connection to verify—you should see a success message
- Name this connection "Shopify Store" for easy reference
WhatsApp Business
Why it's needed: WhatsApp Business enables direct messaging to customers on the platform where they're most engaged. This integration sends your personalized cancellation follow-up messages, ensuring high open and response rates compared to email.
Setup steps:
- Visit WhatsApp Business Platform (business.facebook.com)
- Create or log into your Meta Business Account
- Navigate to WhatsApp → Getting Started
- Click Create API Access and follow the verification process
- Once verified, go to System Users and create a new system user with "Admin" role
- Generate a Permanent Access Token for this system user
- In App Roles, assign the system user to your WhatsApp app with full permissions
- Copy your Phone Number ID and Business Account ID from the dashboard
How to obtain API keys/credentials:
-
Access Token: Generated in System Users section (valid indefinitely if marked permanent)
-
Phone Number ID: Found under WhatsApp → Phone Numbers
-
Business Account ID: Located in Settings → Business Information
Configuration in TaskAGI:
- Go to Integrations and select WhatsApp Business
- Click Connect → Create new connection
- Enter your Access Token in the authentication field
- Paste your Phone Number ID (this is your sending number)
- Enter your Business Account ID
- Click Test connection—you should receive a test message on your WhatsApp
- Save as "WhatsApp Business Account"
Google Sheets
Why it's needed: Google Sheets serves as your logging and analytics hub, creating a permanent record of all message sends, failures, and customers without phone numbers. This enables compliance tracking, performance analysis, and troubleshooting.
Setup steps:
- Open Google Sheets and create a new spreadsheet
- Name it "TaskAGI Cancelled Orders Log"
- Create column headers in the first row:
-
A1: Order ID
-
B1: Customer Name
-
C1: Phone Number
-
D1: Message Status
-
E1: Timestamp
-
F1: Notes
- Right-click the sheet tab and select Share
- Click Share and copy the sheet URL from your browser address bar
- In Google Sheets, go to Extensions → Apps Script
- Create a simple function to enable API access (TaskAGI will handle this)
How to obtain API keys/credentials:
-
Sheet URL: The full URL from your browser (e.g.,
https://docs.google.com/spreadsheets/d/SHEET_ID/edit)
- No API key needed—TaskAGI uses URL-based access for simplicity
Configuration in TaskAGI:
- Navigate to Integrations → Google Sheets
- Click Connect → Create new connection
- Click Authorize with Google and sign in with your Google account
- Grant TaskAGI permission to access your Google Sheets
- Return to TaskAGI and paste your Sheet URL in the connection settings
- Click Test connection—TaskAGI will verify it can write to your sheet
- Save as "Cancelled Orders Log"
Configuration Steps
Node 1: Workflow Overview (Documentation)
This is a note node for your reference. No configuration needed—it documents the workflow's purpose. You can edit the note to add team-specific instructions or business context.
Node 2: Daily Schedule (Trigger)
This node runs your workflow automatically every day.
Configuration:
- Click the Daily Schedule node
- Set Frequency to
Daily
- Set Time to your preferred execution time (e.g.,
09:00 AM)
- Set Timezone to your business timezone
-
Example: Running at 9:00 AM daily means cancelled orders from the previous day are processed every morning
Node 3: Get Cancelled Orders (Shopify Query)
This node retrieves all cancelled orders from your Shopify store.
Configuration:
- Select your Shopify connection from the dropdown
- Set Status filter to
cancelled
- Set Date range to
Last 24 hours (captures orders cancelled since yesterday's run)
- Enable Include customer data checkbox
- Click Test to verify—you should see sample cancelled orders returned
Node 4: Loop Through Orders (Processing)
This node processes each cancelled order individually.
Configuration:
- Set Input array to
nodes.7649.orders (output from Get Cancelled Orders)
- This automatically iterates through each order; no manual configuration needed
- Each iteration passes one order to the next nodes
Node 5: Extract Customer Data (Data Transformation)
This node pulls customer phone numbers and names from each order.
Configuration:
- Click the Extract Customer Data node
- In the function editor, ensure this code is present:
return {
phone: order.customer.phone,
name: order.customer.first_name,
order_id: order.id,
cancelled_reason: order.cancel_reason
}
- This extracts only the fields needed for messaging and logging
-
Test with sample data to verify phone numbers are captured correctly
Node 6: Check Has Phone (Conditional Logic)
This node verifies whether the customer has a phone number on file.
Configuration:
- Set Condition to
phone exists and is not empty
- Set True path to continue to WhatsApp sending (Node 7)
- Set False path to log missing phone numbers (Node 10)
- This prevents errors from attempting to send messages without valid numbers
Node 7: Send WhatsApp Message (Messaging)
This node sends the actual WhatsApp message to customers.
Configuration:
- Select your WhatsApp Business connection
- Set Recipient phone to
nodes.7651.phone (extracted customer phone)
- In Message template, use this text:
Hi {{name}}, we noticed your order #{{order_id}} was cancelled.
We'd love to help! Reply with any questions or let us know if you'd
like to place a new order. Our team is here to assist!
- Replace
{{name}} and {{order_id}} with dynamic fields from extracted data
- Set Message type to
Text
-
Important: Ensure phone numbers include country code (e.g.,
+1 for US)
Node 8: Check Message Sent (Delivery Verification)
This node confirms whether the WhatsApp message was successfully delivered.
Configuration:
- Set Condition to
message_status equals "sent"
- Set True path to log success (Node 9)
- Set False path to log failure (Node 11)
- This creates separate records for successful and failed sends
Nodes 9, 10, 11: Logging to Google Sheets
These three nodes record different outcomes to your Google Sheets log.
Configuration for Node 9 (Success Log):
- Select your Google Sheets connection
- Set Sheet URL to your Cancelled Orders Log sheet
- Map these values to columns:
-
Order ID → nodes.7651.order_id
-
Customer Name → nodes.7651.name
-
Phone Number → nodes.7651.phone
-
Message Status → Sent Successfully
-
Timestamp → {{current_timestamp}}
Configuration for Node 10 (No Phone Log):
- Same sheet URL
- Map values:
-
Order ID → nodes.7651.order_id
-
Customer Name → nodes.7651.name
-
Phone Number → N/A
-
Message Status → No Phone Number
-
Notes → Customer record missing phone number
Configuration for Node 11 (Failed Log):
- Same sheet URL
- Map values:
-
Order ID → nodes.7651.order_id
-
Customer Name → nodes.7651.name
-
Phone Number → nodes.7651.phone
-
Message Status → Send Failed
-
Notes → {{error_message}}
Testing Your Agent
Step 1: Pre-Launch Verification
Before running your first automated execution:
-
Verify all connections: Go to Integrations and confirm all three (Shopify, WhatsApp, Google Sheets) show "Connected" status
-
Test Shopify query: Run the "Get Cancelled Orders" node independently—you should see at least one cancelled order returned
-
Test WhatsApp: Send a test message manually through WhatsApp Business to confirm your account is active
-
Test Google Sheets: Manually add one row to your log sheet to confirm write access
Step 2: Run Test Execution
- Click Run Test in the workflow editor (not the scheduled trigger)
- Select Use sample data if available, or Run with live data
- Watch the execution progress in real-time—each node will show success/failure status
-
Expected flow: Trigger → Get Orders → Loop → Extract Data → Check Phone → Send Message → Check Status → Log Result
Step 3: Verify Each Step
At the Shopify node:
- Confirm cancelled orders are returned
- Check that customer phone numbers are included in the response
- Note the order count—this tells you how many messages will be sent
At the extraction node:
- Verify phone numbers are formatted correctly (with country codes)
- Confirm customer names are captured
- Check that order IDs match your Shopify dashboard
At the WhatsApp node:
- Check your personal WhatsApp—you should receive test messages
- Verify message formatting looks correct (no broken variables)
- Confirm delivery status shows "sent" not "failed"
At the logging nodes:
- Open your Google Sheets log
- Verify rows are being added with correct data
- Check that successful sends, failures, and missing phones are in separate rows
- Confirm timestamps are accurate
Step 4: Success Indicators
Your workflow is ready for production when you see:
✅ All integrations connected with no authentication errors
✅ Test execution completes with 0 critical errors (warnings are normal)
✅ Google Sheets log contains at least 3 rows with different statuses (success, failure, no phone)
✅ WhatsApp messages received on your test phone number with correct formatting
✅ Execution time completes in under 2 minutes for up to 100 orders
✅ No data loss between nodes—verify values flow correctly through the entire chain
Step 5: Monitor First Week
After activating the schedule:
- Check your Google Sheets log daily for the first week
- Monitor WhatsApp delivery rates—aim for 85%+ success rate
- Review any failed sends and adjust phone number formatting if needed
- Track customer responses to measure engagement and cancellation recovery
Congratulations! Your automated cancellation recovery workflow is now live and working to recover lost revenue while maintaining excellent customer communication.