Global AI Network
Agent Template v1.0

Shopify WhatsApp Upsell for Cancelled Orders

Recover lost sales by automatically sending WhatsApp messages to customers with cancelled Shopify orders, logging results in Google Sheets for complete tracking and follow-up.

54+
Deployments
10m
Setup Time
Free
Pricing

Need custom configuration?

Our solution engineers can help you adapt this agent to your specific infrastructure and requirements.

Enterprise Grade Best Practices Production Optimized

INTEGRATED_MODULES

Google Sheets
Google Sheets
Shopify
Shopify
WhatsApp Business
WhatsApp Business
Step by Step

Setup Tutorial

mission-briefing.md

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:

  1. Log into your Shopify admin dashboard
  2. Navigate to SettingsApps and integrationsDevelop apps
  3. Click Create an app and name it "TaskAGI Automation"
  4. In the app configuration, go to Configuration tab
  5. Under Admin API scopes, enable the following permissions:
    • read_orders (to retrieve cancelled orders)
    • read_customers (to access customer contact information)
  6. Click Save and then Activate app
  7. 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:

  1. In your TaskAGI workspace, navigate to Integrations
  2. Search for and select Shopify
  3. Click Connect and choose Create new connection
  4. Paste your Access Token into the authentication field
  5. Enter your Shopify store URL (e.g., yourstore.myshopify.com)
  6. Click Test connection to verify—you should see a success message
  7. 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:

  1. Visit WhatsApp Business Platform (business.facebook.com)
  2. Create or log into your Meta Business Account
  3. Navigate to WhatsAppGetting Started
  4. Click Create API Access and follow the verification process
  5. Once verified, go to System Users and create a new system user with "Admin" role
  6. Generate a Permanent Access Token for this system user
  7. In App Roles, assign the system user to your WhatsApp app with full permissions
  8. 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:

  1. Go to Integrations and select WhatsApp Business
  2. Click ConnectCreate new connection
  3. Enter your Access Token in the authentication field
  4. Paste your Phone Number ID (this is your sending number)
  5. Enter your Business Account ID
  6. Click Test connection—you should receive a test message on your WhatsApp
  7. 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:

  1. Open Google Sheets and create a new spreadsheet
  2. Name it "TaskAGI Cancelled Orders Log"
  3. Create column headers in the first row:
    • A1: Order ID
    • B1: Customer Name
    • C1: Phone Number
    • D1: Message Status
    • E1: Timestamp
    • F1: Notes
  4. Right-click the sheet tab and select Share
  5. Click Share and copy the sheet URL from your browser address bar
  6. In Google Sheets, go to ExtensionsApps Script
  7. 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:

  1. Navigate to IntegrationsGoogle Sheets
  2. Click ConnectCreate new connection
  3. Click Authorize with Google and sign in with your Google account
  4. Grant TaskAGI permission to access your Google Sheets
  5. Return to TaskAGI and paste your Sheet URL in the connection settings
  6. Click Test connection—TaskAGI will verify it can write to your sheet
  7. 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:

  1. Click the Daily Schedule node
  2. Set Frequency to Daily
  3. Set Time to your preferred execution time (e.g., 09:00 AM)
  4. Set Timezone to your business timezone
  5. 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:

  1. Select your Shopify connection from the dropdown
  2. Set Status filter to cancelled
  3. Set Date range to Last 24 hours (captures orders cancelled since yesterday's run)
  4. Enable Include customer data checkbox
  5. 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:

  1. Set Input array to nodes.7649.orders (output from Get Cancelled Orders)
  2. This automatically iterates through each order; no manual configuration needed
  3. 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:

  1. Click the Extract Customer Data node
  2. 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
    }
    
  3. This extracts only the fields needed for messaging and logging
  4. 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:

  1. Set Condition to phone exists and is not empty
  2. Set True path to continue to WhatsApp sending (Node 7)
  3. Set False path to log missing phone numbers (Node 10)
  4. 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:

  1. Select your WhatsApp Business connection
  2. Set Recipient phone to nodes.7651.phone (extracted customer phone)
  3. 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!
    
  4. Replace {{name}} and {{order_id}} with dynamic fields from extracted data
  5. Set Message type to Text
  6. 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:

  1. Set Condition to message_status equals "sent"
  2. Set True path to log success (Node 9)
  3. Set False path to log failure (Node 11)
  4. 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):

  1. Select your Google Sheets connection
  2. Set Sheet URL to your Cancelled Orders Log sheet
  3. Map these values to columns:
    • Order IDnodes.7651.order_id
    • Customer Namenodes.7651.name
    • Phone Numbernodes.7651.phone
    • Message StatusSent Successfully
    • Timestamp{{current_timestamp}}

Configuration for Node 10 (No Phone Log):

  1. Same sheet URL
  2. Map values:
    • Order IDnodes.7651.order_id
    • Customer Namenodes.7651.name
    • Phone NumberN/A
    • Message StatusNo Phone Number
    • NotesCustomer record missing phone number

Configuration for Node 11 (Failed Log):

  1. Same sheet URL
  2. Map values:
    • Order IDnodes.7651.order_id
    • Customer Namenodes.7651.name
    • Phone Numbernodes.7651.phone
    • Message StatusSend Failed
    • Notes{{error_message}}

Testing Your Agent

Step 1: Pre-Launch Verification

Before running your first automated execution:

  1. Verify all connections: Go to Integrations and confirm all three (Shopify, WhatsApp, Google Sheets) show "Connected" status
  2. Test Shopify query: Run the "Get Cancelled Orders" node independently—you should see at least one cancelled order returned
  3. Test WhatsApp: Send a test message manually through WhatsApp Business to confirm your account is active
  4. Test Google Sheets: Manually add one row to your log sheet to confirm write access

Step 2: Run Test Execution

  1. Click Run Test in the workflow editor (not the scheduled trigger)
  2. Select Use sample data if available, or Run with live data
  3. Watch the execution progress in real-time—each node will show success/failure status
  4. 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.

Similar Solutions

Related Agents

Explore these powerful automation agents that complement your workflow.

Shopify Social Auto-Post with AI Captions

Shopify Social Auto-Post with AI Captions

Automate Shopify product launches with AI-generated social captions, instant Facebook posting, and team notifications vi...