8
n8n 中文网amn8n.com

Airtable订单状态变更到Twilio短信通知

中级

这是一个Support Chatbot领域的自动化工作流,包含 12 个节点。主要使用 If, Set, Merge, Twilio, Airtable 等节点。 Airtable订单状态变更到Twilio短信通知

前置要求
  • Airtable API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "c8c9ba5d3eb26ae47a06d24ff164a01c0d73ed4753a74903c2bb609d434a0f6b",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "0f9a301c-3c4e-4b93-9acb-aaac7dc71767",
      "name": "监控订单状态变更",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        560,
        240
      ],
      "parameters": {
        "baseId": {
          "__rl": true,
          "mode": "url",
          "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq"
        },
        "tableId": {
          "__rl": true,
          "mode": "url",
          "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq?blocks=hide"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerField": "Created",
        "authentication": "airtableTokenApi",
        "additionalFields": {}
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "lkxZWCd27TyEahCT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3fd2c55-69bb-4deb-960b-4fce09c97a6a",
      "name": "配置",
      "type": "n8n-nodes-base.set",
      "position": [
        768,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e60a21c7-574a-4579-9e7f-57cf6b9f50c9",
              "name": "orders_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tblhBgneMJ0mEPHKy/viw2ySMTX32PaQmXn?blocks=hide"
            },
            {
              "id": "d40b4f55-a7e1-4735-9d6f-d5d3f88ba8ec",
              "name": "notifications_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq?blocks=hide"
            },
            {
              "id": "bad7583e-9699-4fec-a6f9-697f595c093e",
              "name": "scripts_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tbltfdPxUeOVGbb1l/viwFwsRKskE2F5b67?blocks=hide"
            },
            {
              "id": "e39b8ae5-c53a-4186-9ec5-6c352cd1d7e4",
              "name": "from_number",
              "type": "string",
              "value": "+18565883517"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "4be3c39c-6be2-49cd-81bc-368a501eb9cd",
      "name": "将配置与订单数据合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1328,
        16
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "70b22256-8e20-4eb5-99df-eef81da8ef12",
      "name": "准备 SMS 内容",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "463668f7-11f7-48d2-91c3-635a78637c7f",
              "name": "Message",
              "type": "string",
              "value": "=Hi {{ $json.fields['First Name (from Order)'][0] }}, Your order status changed to: {{ $json.fields['Order Status'] }}. Any questions, call us!"
            },
            {
              "id": "3ddbf667-aa74-4ddb-b12e-6bf1294fdaa3",
              "name": "To",
              "type": "string",
              "value": "={{ $json.fields['Customer Phone Number (from Order)'][0] }}"
            },
            {
              "id": "609250bc-7ae0-4213-9611-a60b3ac63eaa",
              "name": "From",
              "type": "string",
              "value": "={{ $json.from_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a4a0103e-9fe8-4076-bee8-6c8c34a3fae6",
      "name": "发送订单状态短信",
      "type": "n8n-nodes-base.twilio",
      "onError": "continueRegularOutput",
      "position": [
        1728,
        16
      ],
      "parameters": {
        "to": "={{ $json.To }}",
        "from": "={{ $json.From }}",
        "message": "={{ $json.Message }}",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "id": "JgMpoxsNKUfVKqN1",
          "name": "Twilio account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cd039e97-d4f4-4d67-bc1b-f972d79ba2d5",
      "name": "检查短信送达状态",
      "type": "n8n-nodes-base.if",
      "position": [
        1936,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3f814939-8cea-4114-aed8-9f4202c7eb80",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ !$json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d85bf204-a0b4-4f00-aa04-2704ea7787af",
      "name": "筛选待处理通知",
      "type": "n8n-nodes-base.if",
      "position": [
        944,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "223f9988-650a-4fcc-9a65-2f240c4b3dce",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.fields['Message Status'] }}",
              "rightValue": "To send"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b079226c-e475-438e-8fa8-46b82d129a21",
      "name": "标记通知为发送中",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1184,
        192
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Sending..."
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "lkxZWCd27TyEahCT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "eff63937-f30e-4d03-8c14-07091abb0bbc",
      "name": "标记通知为成功",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2176,
        -80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Success"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "lkxZWCd27TyEahCT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35bb7ae7-8b76-4eb4-8be3-c9f270887039",
      "name": "标记通知为失败",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2176,
        128
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Error"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "lkxZWCd27TyEahCT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c42f9334-652d-485b-aab2-08380db4af6f",
      "name": "配置助手",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        64
      ],
      "parameters": {
        "width": 272,
        "content": "## 在此处配置 👇👇"
      },
      "typeVersion": 1
    },
    {
      "id": "doc-note-1759930148724",
      "name": "工作流描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -250
      ],
      "parameters": {
        "width": 600,
        "height": 1100,
        "content": "## 工作流概览"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Monitor Order Status Changes": [
      {
        "id": "rec5IBu6cQyupk23H",
        "fields": {
          "Order": [
            "recLG83ejiTyKDS33"
          ],
          "Created": "2025-09-17T14:41:08.000Z",
          "Order Status": "Shipped",
          "Message Status": "To send",
          "First Name (from Order)": [
            "Maria"
          ],
          "Customer Phone Number (from Order)": [
            "+36303679742"
          ]
        },
        "createdTime": "2025-09-17T14:41:08.000Z"
      }
    ]
  },
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Filter Pending Notifications",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check SMS Delivery": {
      "main": [
        [
          {
            "node": "Mark Notification as Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark Notification as Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare SMS Content": {
      "main": [
        [
          {
            "node": "Send Order Status SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Order Status SMS": {
      "main": [
        [
          {
            "node": "Check SMS Delivery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Pending Notifications": {
      "main": [
        [
          {
            "node": "Combine Config with Order Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mark Notification as Sending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Notification as Sending": {
      "main": [
        [
          {
            "node": "Combine Config with Order Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Monitor Order Status Changes": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Config with Order Data": {
      "main": [
        [
          {
            "node": "Prepare SMS Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客服机器人

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类1
节点类型7
难度说明

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

作者
Milan Vasarhelyi - SmoothWork

Milan Vasarhelyi - SmoothWork

@vasarmilan

We help you eliminate the busywork by building compact business tools tailored to your processes. 📞: https://smoothwork.ai/book-a-call ▶️: https://www.youtube.com/@vasarmilan

外部链接
在 n8n.io 查看

分享此工作流