8
n8n 中文网amn8n.com

使用Gmail确认从Airtable自动化Shopify订单

中级

这是一个自动化工作流,包含 14 个节点。主要使用 If, Gmail, Shopify, Webhook, Airtable 等节点。 从Airtable自动化Shopify订单并通过Gmail发送确认

前置要求
  • Google 账号和 Gmail API 凭证
  • Shopify Admin API 凭证
  • HTTP Webhook 端点(n8n 会自动生成)
  • Airtable API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "JjrhFDyBIgB20pnY",
  "meta": {
    "instanceId": "1a54c41d9050a8f1fa6f74ca858828ad9fb97b9fafa3e9760e576171c531a787"
  },
  "name": "使用 Gmail 确认从 Airtable 自动化 Shopify 订单",
  "tags": [],
  "nodes": [
    {
      "id": "c07b2f4e-f9c6-40a9-88a3-cd3d905b1ab4",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 384,
        "height": 560,
        "content": "## 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "aa293e3f-80ae-4d7d-822d-99060117f9d8",
      "name": "从 Airtable 触发",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1520,
        -16
      ],
      "webhookId": "f4e69e57-40f0-4af9-b44d-17eb9389b427",
      "parameters": {
        "path": "f4e69e57-40f0-4af9-b44d-17eb9389b427",
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "5446b168-c78c-438f-9670-1a5e050a978f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 560,
        "content": "## 获取订单和客户详情"
      },
      "typeVersion": 1
    },
    {
      "id": "2f2c60e4-ffab-475a-9b09-5cd5bfa5e723",
      "name": "获取订单和客户详情",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -1056,
        -16
      ],
      "parameters": {
        "id": "={{ $json.query.recordId }}",
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appQTd8PXDgHdjOpr",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr",
          "cachedResultName": "Dynamic Video Content"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblEXxxmfYYsMDLC9",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr/tblEXxxmfYYsMDLC9",
          "cachedResultName": "Orders"
        },
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "d2faa646-73ed-4945-973c-9519a5ef172b",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 560,
        "content": "## 获取产品行项目"
      },
      "typeVersion": 1
    },
    {
      "id": "f95ca4c0-d248-45d7-b6f1-e232b625dc09",
      "name": "获取产品行项目",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -640,
        -16
      ],
      "parameters": {
        "id": "={{ $json['Order Line Items'][0] }}",
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appQTd8PXDgHdjOpr",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr",
          "cachedResultName": "Dynamic Video Content"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblC9b18Rf1uZZW7m",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr/tblC9b18Rf1uZZW7m",
          "cachedResultName": "Order Line Items"
        },
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "d26b1db9-f190-4ff5-9f9a-f8e24cb15fe0",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 576,
        "content": "## 在 Shopify 中创建订单"
      },
      "typeVersion": 1
    },
    {
      "id": "5f84993b-5a4b-4afb-b9b5-4afe10c5e86e",
      "name": "在 Shopify 中创建订单",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -208,
        -16
      ],
      "parameters": {
        "limeItemsUi": {
          "lineItemValues": [
            {
              "price": "={{ $json.Price }}",
              "title": "={{ $json.Title }}",
              "quantity": "={{ $json.Quantity }}",
              "productId": "={{ $json['Product Name'] }}"
            }
          ]
        },
        "authentication": "oAuth2",
        "additionalFields": {
          "email": "={{ $('Fetch Order & Customer Details').item.json['Email ID'] }}",
          "shippingAddressUi": {
            "shippingAddressValues": {
              "zip": "={{ $('Fetch Order & Customer Details').item.json['Zip Code'] }}",
              "city": "={{ $('Fetch Order & Customer Details').item.json.City }}",
              "phone": "={{ $('Fetch Order & Customer Details').item.json.Phone }}",
              "country": "={{ $('Fetch Order & Customer Details').item.json.Country }}",
              "address1": "={{ $('Fetch Order & Customer Details').item.json['Address Line 1'] }}",
              "address2": "={{ $('Fetch Order & Customer Details').item.json['Address Line 2'] }}",
              "lastName": "={{ $('Fetch Order & Customer Details').item.json['Last Name'] }}",
              "province": "={{ $('Fetch Order & Customer Details').item.json.Province }}",
              "firstName": "={{ $('Fetch Order & Customer Details').item.json['First Name'] }}"
            }
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1a679ecb-190e-47b7-b8cc-e7a552ef265b",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 576,
        "content": "## 发送订单确认邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "faaae486-32c7-4cf8-8c1b-15b2bb84ede0",
      "name": "发送订单确认邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        176,
        -16
      ],
      "webhookId": "a4a8c440-78fa-487e-929a-3f3506078ca0",
      "parameters": {
        "sendTo": "samartian8@gmail.com",
        "message": "=<div style=\"font-family: Arial, sans-serif; color: #333333; line-height: 1.5; max-width: 600px; margin: auto; padding: 20px; background-color: #f9f9f9; border-radius: 8px;\">   <h2 style=\"color: #4CAF50; text-align: center;\">Your Order is Confirmed!</h2>   <p>Hi <strong> {{ $json.customer.first_name }} {{ $json.customer.last_name }}</strong>,</p>   <p>Thank you for your order! We're excited to let you know that your order has been successfully placed and is being processed.</p>    <h3>Order Summary</h3>   <table style=\"width: 100%; border-collapse: collapse; margin-bottom: 20px;\">     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Order Number</th>       <td style=\"padding: 8px;\"> {{ $json.order_number }}</td>     </tr>     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Order Date</th>       <td style=\"padding: 8px;\">{{ new Date($json.created_at).toISOString().split('T')[0] }}\n\n </td>     </tr>     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Total Amount</th>       <td style=\"padding: 8px;\">{{ $json.currency }} {{ $json.current_total_price }}</td>     </tr>   </table>    <h3>Item Ordered</h3>   <table style=\"width: 100%; border-collapse: collapse; margin-bottom: 20px;\">     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Product</th>       <td style=\"padding: 8px;\">{{ $('Fetch Product Line Items').item.json['Product Name'] }} </td>     </tr>     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Quantity</th>       <td style=\"padding: 8px;\">{{ $json.line_items[0].quantity }}</td>     </tr>     <tr>       <th style=\"text-align: left; border-bottom: 1px solid #ddd; padding: 8px;\">Price</th>       <td style=\"padding: 8px;\">{{ $json.current_subtotal_price_set.shop_money.amount }}</td>     </tr>   </table>    <p>If you have any questions, feel free to reply to this email or contact our support team.</p>    <p style=\"text-align: center;\">     <a href=\"{{$json[\"OrderLink\"]}}\" style=\"display: inline-block; padding: 10px 20px; background-color: #4CAF50; color: #ffffff; text-decoration: none; border-radius: 5px;\">View Your Order</a>   </p>    <p style=\"font-size: 12px; color: #777777; text-align: center; margin-top: 20px;\">     &copy; 2025 Your Samartian. All rights reserved.   </p> </div>",
        "options": {},
        "subject": "Order Confirmed !"
      },
      "typeVersion": 2.1
    },
    {
      "id": "b8ce7156-635b-4294-b7dd-429aa4995401",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 576,
        "content": "## 闭环 - 更新 Airtable 状态"
      },
      "typeVersion": 1
    },
    {
      "id": "38c5e7da-e7ec-4dd5-8d52-4684b600483f",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        256
      ],
      "parameters": {
        "color": 3,
        "width": 432,
        "height": 560,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0899512f-4f91-4e92-91aa-4df4b3861d3c",
      "name": "确认邮件已发送?",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6ebeb00a-1bed-47dc-b84e-a83e4ea43b04",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.labelIds[0] }}",
              "rightValue": "SENT"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "18b32ce7-74e4-42a0-ad1a-0e21502f3981",
      "name": "闭环 - 更新 Airtable 状态",
      "type": "n8n-nodes-base.airtable",
      "position": [
        752,
        -32
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appQTd8PXDgHdjOpr",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr",
          "cachedResultName": "Dynamic Video Content"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblEXxxmfYYsMDLC9",
          "cachedResultUrl": "https://airtable.com/appQTd8PXDgHdjOpr/tblEXxxmfYYsMDLC9",
          "cachedResultName": "Orders"
        },
        "columns": {
          "value": {
            "id": "={{ $('Fetch Order & Customer Details').item.json.id }}",
            "Shopify Ordered": "Done"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Order Number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Country",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address Line 1",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Address Line 1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address Line 2",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Address Line 2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Province",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Province",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Zip Code",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Zip Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Email ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Line Items",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Line Items",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Trigger Shopify",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Trigger Shopify",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Shopify Ordered",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Pending",
                  "value": "Pending"
                },
                {
                  "name": "Done",
                  "value": "Done"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Shopify Ordered",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e292d3d8-118d-45ef-aebc-1ed81c03bbfe",
  "connections": {
    "Confirm Email Sent?": {
      "main": [
        [
          {
            "node": "Close the Loop - Update Airtable Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger from Airtable": {
      "main": [
        [
          {
            "node": "Fetch Order & Customer Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Product Line Items": {
      "main": [
        [
          {
            "node": "Create the Order in Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create the Order in Shopify": {
      "main": [
        [
          {
            "node": "Send Order Confirmation Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Order Confirmation Email": {
      "main": [
        [
          {
            "node": "Confirm Email Sent?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Order & Customer Details": {
      "main": [
        [
          {
            "node": "Fetch Product Line Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量14
分类-
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Intuz

Intuz

@intuz

Workflow automation can help automate your routine activities and help saves $$$, as well as hours of time. As a boutique tech consulting company, Intuz help businesses with custom AI/ML, AI Workflow Automations, and software development. Automate your business workflow for: Sales Marketing Accounting Finance Operations E-Commerce Customer Support Admin & Backoffice Logistics & Supply Chain

外部链接
在 n8n.io 查看

分享此工作流