🔧 Send Shopify shipping tracking WhatsApp notifications with full tracking info

71 views · 🔧 Miscellaneous

Description

Order Fulfillment & Shipping Notification System

Automatically notify customers via WhatsApp when their orders ship, with intelligent phone validation, multi-country support, and bilingual messaging including complete tracking information.

What does this workflow do?

When you fulfill an order in Shopify, this workflow instantly updates your database, validates the customer’s phone number across 23+ countries, and sends a professional WhatsApp notification with full tracking details in their preferred language.

Key features:

Setup Requirements

Integrations Needed:

  1. Shopify - For order fulfillment webhooks
  2. PostgreSQL - For order and customer data storage
  3. WhatsApp Business API - For sending notifications via Facebook Graph API

Credentials Required:

How to Use

  1. Import the workflow into your n8n instance
  2. Configure credentials:
    • Add your Shopify store access token
    • Connect your PostgreSQL database
    • Add your WhatsApp Business API credentials
  3. Update test phone numbers in filter nodes (If10 and If11) with your actual test numbers
  4. Customize brand name in WhatsApp message templates if needed (currently "" / "")
  5. Activate the workflow to start sending shipping notifications

Workflow Structure

1. Trigger (Shopify Webhook)

Listens for fulfillments/create events when orders are marked as shipped in Shopify

2. Update Order Status

Updates PostgreSQL database with:

3. Customer Lookup

Retrieves customer record from database using phone number from fulfillment data

4. Phone Validator (Code Node)

Intelligent phone number formatting:

5. Get Customer Preferences

Retrieves language preference and first name for personalization

6. Language Detection

Routes workflow based on customer’s preferred language (Arabic vs. English)

7. Test Number Filter

Prevents notifications to internal/development phone numbers

8. WhatsApp Notification

Sends comprehensive shipping notification with tracking details in customer’s language

Supported Countries & Codes

GCC Region:

MENA Region:

International:

Message Templates

Arabic Message (عربي):

مرحبًا [الاسم]،

يسرّنا إعلامكم بأنه تم شحن طلبكم بنجاح.
رقم الطلب: [order_id]
رقم التتبع: [tracking_number]
شركة الشحن: [courier_name]
رابط التتبع: [tracking_url]
المدة المتوقعة للتوصيل: من 7 إلى 12 يوم عمل.

يمكنكم متابعة حالة الشحنة عبر رقم التتبع، وسنحرص على إبقائكم على اطلاع حتى استلام الطلب.

مع أطيب التحيات،

English Message:

Hello [Name],

We are pleased to inform you that your order has been shipped successfully.

Order No: [order_id]
Tracking No: [tracking_number]
Courier Company: [courier_name]
Tracking URL: [tracking_url]
Estimated delivery time: 7–12 business days.

You may track your shipment using the tracking number provided. We will continue to keep you informed until your order is delivered.

Kind regards,

Database Schema Requirements

Orders Table:

CREATE TABLE orders (
  order_id VARCHAR PRIMARY KEY,  -- Shopify order number
  status VARCHAR,                  -- Order status ('open', 'shipped', 'delivered', 'canceled')
  shipping_company VARCHAR,        -- Courier service name
  tracking_number VARCHAR,         -- Package tracking ID
  customer_id INTEGER              -- Foreign key to customers table
);

Customers Table:

CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  website_id INTEGER,              -- Shopify customer ID
  phone VARCHAR,                   -- Customer phone number
  language VARCHAR(2),             -- Preferred language ('ar' or 'en')
  first_name VARCHAR,              -- Customer first name
  last_name VARCHAR                -- Customer last name
);

Phone Validator Logic

The Phone Validator node intelligently handles phone numbers:

  1. Extracts phone from fulfillment data (checks destination.phone, shipping_address.phone, or root phone)
  2. Detects country from destination.country_code (defaults to ‘OM’ if not provided)
  3. Cleans number by removing whitespace and non-numeric characters (except +)
  4. Validates length (minimum 5 digits required)
  5. Checks for country code in the number
  6. Adds country code automatically if missing based on shipping country
  7. Ensures + prefix for international format
  8. Returns:
    • phone: Formatted number with country code (+XXX)
    • original_phone: Raw input for reference
    • country_code: ISO country code
    • validation_status: ‘success’ or ‘empty_or_invalid’

Customization Tips

Use Cases

Error Handling

Performance Notes

Technical Notes


Tags: #shopify #whatsapp #fulfillment #shipping #tracking #bilingual #arabic #english #phone-validation #ecommerce #notifications #international

🔗 Nodes Used

HTTP Request, Postgres, Shopify Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup