Shopify Order Management
Complete Shopify order lifecycle management built on n8n. Handles new orders, status sync, inventory alerts, abandoned cart recovery, and daily sales reporting.
Problem
Shopify's built-in tools are limited for operations management. Order status changes aren't logged centrally, low-stock alerts arrive too late, abandoned cart emails are basic, and daily sales data requires logging into the admin dashboard.
This system automates the full order lifecycle with real-time tracking and proactive alerts.
What It Does
- 1. New Order Handling — Webhook captures new orders, logs to Google Sheets, emails admin
- Order Status Sync — Periodically syncs fulfillment/payment status from Shopify to Sheets
- Low Stock Alerts — Checks inventory every 6 hours, alerts on items below threshold
- Abandoned Cart Recovery — Sends recovery emails to customers who abandoned checkout
- Daily Sales Reports — Revenue, order count, AOV, fulfillment stats, and top products
Included Workflows
| # | File | Purpose |
|---|
| 01 | INLINECODE0 | Webhook → parse order → log to Sheets → notify admin |
| 02 |
02-order-status-sync.json | Scheduled → check pending orders → sync from Shopify API |
| 03 |
03-low-stock-alert.json | Scheduled → inventory check → alert on low stock |
| 04 |
04-abandoned-cart-recovery.json | Scheduled → fetch abandoned carts → recovery email |
| 05 |
05-daily-sales-report.json | Daily → fetch orders → metrics → report email |
Architecture
CODEBLOCK0
Required n8n Credentials
| Credential Type | Used For | Placeholder in JSON |
|---|
| Google Sheets OAuth2 | Order tracking and logging | INLINECODE5 |
| SMTP |
Notifications, recovery emails, reports |
YOUR_SMTP_CREDENTIAL_ID |
Environment Variables
CODEBLOCK1
Configuration Placeholders
| Placeholder | Description |
|---|
| INLINECODE7 | Google Sheet ID for order tracking |
| INLINECODE8 |
n8n Google Sheets credential ID |
|
YOUR_SMTP_CREDENTIAL_ID | n8n SMTP credential ID |
|
YOUR_NOTIFICATION_EMAIL | Admin email for reports and alerts |
Google Sheets Schema (Orders)
| Column | Type | Description |
|---|
| orderid | text | Shopify order ID (primary key) |
| ordernumber |
text | Human-readable order number |
| customer_name | text | Customer full name |
| customer_email | text | Customer email |
| customer_phone | text | Customer phone |
| total_price | number | Order total |
| currency | text | Currency code (USD, EUR, etc.) |
| financial_status | text | pending / paid / refunded |
| fulfillment_status | text | unfulfilled / fulfilled / delivered |
| items_count | number | Number of line items |
| items_summary | text | Item names and quantities |
| shipping_address | text | Shipping address summary |
| created_at | datetime | Order creation timestamp |
| synced_at | datetime | Last sync timestamp |
Quick Start
1. Prerequisites
- - n8n v2.4+ (self-hosted)
- Shopify store with Admin API access (custom app)
- Google Sheets OAuth2 credentials
- SMTP email credentials
2. Create Shopify Custom App
In Shopify Admin > Settings > Apps > Develop apps > Create app. Grant scopes:
read_orders,
read_products,
read_checkouts.
3. Create Orders Sheet
Create a Google Sheet with the columns above. Name the tab "Orders".
4. Configure Shopify Webhook
In Shopify Admin > Settings > Notifications > Webhooks, add
orders/create pointing to your n8n webhook URL.
5. Import & Configure
Import all 5 JSON files into n8n. Replace
YOUR_* placeholders and set environment variables.
Use Cases
- 1. DTC brands — Order tracking, inventory alerts, and automated cart recovery
- Print-on-demand — Monitor fulfillment status across products
- Dropshippers — Track orders and low-stock from suppliers
- Subscription boxes — Daily sales and fulfillment monitoring
- Agency operators — Multi-store management with centralized reporting
Requirements
- - n8n v2.4+ (self-hosted recommended)
- Shopify store with Admin API custom app
- Google Sheets OAuth2 credentials
- SMTP email credentials
Shopify 订单管理
基于 n8n 构建的完整 Shopify 订单生命周期管理。处理新订单、状态同步、库存预警、弃单恢复以及每日销售报告。
问题
Shopify 内置工具在运营管理方面存在局限。订单状态变更无法集中记录,低库存预警送达过晚,弃单邮件功能基础,每日销售数据需登录管理后台查看。
本系统通过实时追踪和主动预警实现订单全生命周期自动化管理。
功能说明
- 1. 新订单处理 — Webhook 捕获新订单,记录至 Google Sheets,邮件通知管理员
- 订单状态同步 — 定期将履约/支付状态从 Shopify 同步至 Sheets
- 低库存预警 — 每 6 小时检查库存,对低于阈值的商品发送预警
- 弃单恢复 — 向放弃结账的客户发送恢复邮件
- 每日销售报告 — 收入、订单数、客单价、履约统计及热销商品
包含的工作流
| # | 文件 | 用途 |
|---|
| 01 | 01-new-order-handler.json | Webhook → 解析订单 → 记录至 Sheets → 通知管理员 |
| 02 |
02-order-status-sync.json | 定时任务 → 检查待处理订单 → 从 Shopify API 同步 |
| 03 | 03-low-stock-alert.json | 定时任务 → 库存检查 → 低库存预警 |
| 04 | 04-abandoned-cart-recovery.json | 定时任务 → 获取弃单 → 发送恢复邮件 |
| 05 | 05-daily-sales-report.json | 每日任务 → 获取订单 → 计算指标 → 发送报告邮件 |
架构
Shopify Webhook (orders/create)
|
v
工作流 01:新订单处理
+-> 解析订单数据
+-> 记录至 Google Sheets(订单标签页)
+-> 邮件通知管理员
定时任务(每 2 小时):
|
v
工作流 02:订单状态同步
+-> 从 Sheets 读取未履约订单
+-> 从 Shopify API 获取最新状态
+-> 更新 Sheets 中的最新状态
定时任务(每 6 小时):
|
v
工作流 03:低库存预警
+-> 从 Shopify 获取所有商品
+-> 检查库存与阈值对比
+-> 若低库存 → 发送邮件预警
定时任务(每 3 小时):
|
v
工作流 04:弃单恢复
+-> 从 Shopify 获取未完成结账
+-> 筛选:1-24 小时前的弃单
+-> 发送含购物车链接的恢复邮件
每日任务:
|
v
工作流 05:每日销售报告
+-> 获取过去 24 小时订单
+-> 计算收入、客单价、履约统计
+-> 按数量统计热销商品
+-> 发送格式化报告邮件
所需的 n8n 凭证
| 凭证类型 | 用途 | JSON 中的占位符 |
|---|
| Google Sheets OAuth2 | 订单追踪与记录 | YOURGOOGLESHEETSCREDENTIALID |
| SMTP |
通知、恢复邮件、报告 | YOUR
SMTPCREDENTIAL_ID |
环境变量
bash
Shopify(必填)
SHOPIFY
STOREURL=https://your-store.myshopify.com
SHOPIFY
ACCESSTOKEN=shpat_xxxxxxxxxxxxx
SHOPIFY
WEBHOOKSECRET=your-webhook-secret
Google Sheets
SHOPIFY
ORDERSSHEET_ID=your-sheet-id
预警
SHOPIFY
ADMINEMAIL=admin@yourstore.com
LOW
STOCKTHRESHOLD=5
配置占位符
| 占位符 | 说明 |
|---|
| YOURSHOPIFYORDERSSHEETID | 订单追踪的 Google Sheet ID |
| YOURGOOGLESHEETSCREDENTIALID |
n8n Google Sheets 凭证 ID |
| YOUR
SMTPCREDENTIAL_ID | n8n SMTP 凭证 ID |
| YOUR
NOTIFICATIONEMAIL | 报告和预警的管理员邮箱 |
Google Sheets 架构(订单)
| 列名 | 类型 | 说明 |
|---|
| orderid | 文本 | Shopify 订单 ID(主键) |
| ordernumber |
文本 | 可读的订单编号 |
| customer_name | 文本 | 客户全名 |
| customer_email | 文本 | 客户邮箱 |
| customer_phone | 文本 | 客户电话 |
| total_price | 数字 | 订单总额 |
| currency | 文本 | 货币代码(USD、EUR 等) |
| financial_status | 文本 | pending / paid / refunded |
| fulfillment_status | 文本 | unfulfilled / fulfilled / delivered |
| items_count | 数字 | 商品行数 |
| items_summary | 文本 | 商品名称及数量 |
| shipping_address | 文本 | 收货地址摘要 |
| created_at | 日期时间 | 订单创建时间戳 |
| synced_at | 日期时间 | 最后同步时间戳 |
快速开始
1. 前置条件
- - n8n v2.4+(自托管)
- 具备 Admin API 访问权限的 Shopify 商店(自定义应用)
- Google Sheets OAuth2 凭证
- SMTP 邮件凭证
2. 创建 Shopify 自定义应用
在 Shopify 管理后台 > 设置 > 应用 > 开发应用 > 创建应用。授予权限范围:read
orders、readproducts、read_checkouts。
3. 创建订单表格
创建包含上述列的 Google Sheet。将标签页命名为Orders。
4. 配置 Shopify Webhook
在 Shopify 管理后台 > 设置 > 通知 > Webhooks,添加指向 n8n Webhook URL 的 orders/create。
5. 导入与配置
将所有 5 个 JSON 文件导入 n8n。替换 YOUR_* 占位符并设置环境变量。
使用场景
- 1. DTC 品牌 — 订单追踪、库存预警和自动弃单恢复
- 按需打印 — 监控各商品的履约状态
- 代发货商 — 追踪供应商订单和低库存情况
- 订阅盒子 — 每日销售和履约监控
- 代理运营者 — 多店铺管理与集中报告
要求
- - n8n v2.4+(建议自托管)
- 具备 Admin API 自定义应用的 Shopify 商店
- Google Sheets OAuth2 凭证
- SMTP 邮件凭证