Jotform-Telegram 订单同步(已提交)

高级

这是一个自动化工作流,包含 32 个节点。主要使用 If、Set、Code、Wait、Switch 等节点。 JotForm自动化商务同步:Telegram确认与Zoho发票

前置要求
  • Telegram Bot Token
  • Google Sheets API 凭证

分类

未分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "zCg4z524oOeWzzH9",
  "meta": {
    "instanceId": "7f1a0694161455be3a7e71f1e0dea04908b0376a1a81e3a0c1e5ac879d48f83a"
  },
  "name": "Jotform-Telegram 订单同步(已提交)",
  "tags": [],
  "nodes": [
    {
      "id": "5dbd71ce-486c-4abd-9264-8f3d9169d03e",
      "name": "JotForm 触发器",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -192,
        -176
      ],
      "webhookId": "7973d518-b1c7-4e87-9b02-242bbbef1fd8",
      "parameters": {
        "form": "{{ $form_id_placeholder }}"
      },
      "typeVersion": 1
    },
    {
      "id": "63b71df6-f37c-407d-a022-19733284d757",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2560,
        -208
      ],
      "webhookId": "8f5af583-46c4-4493-91d6-068530d5378f",
      "parameters": {
        "text": "=🧴 {{ $template_order_name }} Order Confirmation\nThank you, {{ $('Organize').item.json.customer.name }}! Your order {{ $('Organize').item.json.orderId }} has been received ✅  \nHere’s your summary:\n\n🛍️ Products: \n{{ $('Edit Fields').item.json.Products }}\n\n💰 Total: {{ $('Organize').item.json.total }} {{ $('Organize').item.json.currency }}\n🚚 Delivery: {{ $template_delivery_time }}  \n📍 Address: {{ $('Organize').item.json.customer.address }}\n\nNeed help? Message us here anytime 💬",
        "chatId": "={{ $('Edit Fields').item.json.ChatId }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "babe8a4d-af6b-49c4-859b-4575238b3e7f",
      "name": "获取 ChatId 行",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1392,
        -192
      ],
      "parameters": {
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "691a0fd1-73f5-45b2-b0f7-25a02474de85",
      "name": "设置 ChatId 和产品",
      "type": "n8n-nodes-base.set",
      "position": [
        1984,
        -208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5b508d30-5a49-4ed0-a664-bdb08e86edaf",
              "name": "ChatId",
              "type": "string",
              "value": "={{ $('Get ChatId Row(s)').item.json.MessageChatId }}"
            },
            {
              "id": "27d0c17c-fe7f-4dfa-8ee2-ed8b930a4e6d",
              "name": "Products",
              "type": "string",
              "value": "={{ \n  $('Organize').item.json.products\n  .map(p => `• ${p.name.replace(/([_*[\\]()~`>#+=|{}.!-])/g, '\\\\$1')} x${p.quantity}`)\n  .join('\\n') \n}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "654f6d89-8281-4b83-a95f-88d16a40e178",
      "name": "整理并生成订单 ID",
      "type": "n8n-nodes-base.code",
      "position": [
        16,
        -176
      ],
      "parameters": {
        "jsCode": "// Parse incoming Jotform data\nconst data = items[0].json;\n\n// Extract main fields\nconst name = `${data[\"Full Name\"].first} ${data[\"Full Name\"].last}`.trim();\nconst email = data[\"E-mail\"];\nconst phone = data[\"Contact Number\"]?.full || \"\";\nconst billing = data[\"Billing Address\"];\nconst address = [billing.addr_line1, billing.addr_line2, billing.city, billing.state, billing.postal, billing.country]\n  .filter(Boolean)\n  .join(\", \");\n\n// Extract product details\nconst products = (data[\"My Products\"].products || []).map(p => ({\n  name: p.productName,\n  quantity: p.quantity,\n  unitPrice: p.unitPrice,\n  subTotal: p.subTotal,\n  currency: p.currency,\n  options: p.productOptions.join(\", \"),\n}));\n\n// Extract total\nconst totalInfo = data[\"My Products\"].totalInfo || {};\nconst total = totalInfo.totalSum || 0;\nconst currency = totalInfo.currency || \"USD\";\n\n// Generate order ID - use placeholder prefix\nconst orderId = `{{ $order_id_prefix }}-${Math.floor(Date.now() / 1000)}`;\n\n// Escape MarkdownV2 special chars for Telegram\nconst escapeMarkdown = (text) => {\n  return text\n    ?.toString()\n    .replace(/([_*[\\]()~`>#+=|{}.!-])/g, '\\\\$1');\n};\n\n// Prepare final object\nreturn [\n  {\n    json: {\n      orderId,\n      customer: {\n        name,\n        email,\n        phone,\n        address,\n      },\n      products,\n      total,\n      currency,\n      // Pre-generate summary text for other nodes (like Google Sheets)\n      summaryText: `🧴 *{{ $template_order_name }} Order Confirmation* \nThank you, ${escapeMarkdown(name)}\\\\! Your order *#${escapeMarkdown(orderId)}* has been received ✅  \n\n🛍️ *Products:* \n${products.map(p => `\\\\- ${escapeMarkdown(p.name)} x${escapeMarkdown(p.quantity)} \\\\(${escapeMarkdown(p.subTotal)} ${escapeMarkdown(p.currency)}\\\\)`).join('\\n')}\n\n💰 *Total:* ${escapeMarkdown(total)} ${escapeMarkdown(currency)}  \n📍 *Address:* ${escapeMarkdown(address || \"N/A\")}  \n📞 *Phone:* ${escapeMarkdown(phone || \"N/A\")}`,\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8428985f-6c14-4918-b19e-ff604da17b66",
      "name": "如果找到 ChatId",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        -192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "00d797b0-9a4d-498b-a57c-65e3114e5d63",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Get ChatId Row(s)').item.json.id }}",
              "rightValue": "={{ Math.max(...$items(\"Get ChatId Row(s)\").map(i => i.json.id)) }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "32633847-dcf7-4307-a613-f1a23e3e05b1",
      "name": "追加/更新 CRM 表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2000,
        -464
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $('Organize & Generate Order ID').item.json.orderId }}",
            "currency": "={{ $('Organize & Generate Order ID').item.json.currency }}",
            "الفئة": "={{ $('Organize & Generate Order ID').item.json.customer.email }}",
            "النوع": "={{ $('Organize & Generate Order ID').item.json.customer.name }}",
            "الوصف": "={{ $('Organize & Generate Order ID').item.json.summaryText }}",
            "التاريخ": "={{ $('JotForm Trigger').item.json.createdAt || new Date().toISOString() }}",
            "المقدار": "={{ $('Organize & Generate Order ID').item.json.customer.address }}",
            "اسم الموظف": "={{ $('Organize & Generate Order ID').item.json.total }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "التاريخ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "التاريخ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "النوع",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "النوع",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "الفئة",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "الفئة",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "المقدار",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "المقدار",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "currency",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "currency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "اسم الموظف",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "اسم الموظف",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "الوصف",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "الوصف",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "update_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "update_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $google_sheet_gid }}",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/{{ $google_sheet_document_id }}/edit#gid={{ $google_sheet_gid }}",
          "cachedResultName": "Sheet1 (Placeholder)"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $google_sheet_document_id }}",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/{{ $google_sheet_document_id }}/edit?usp=drivesdk",
          "cachedResultName": "CRM (Placeholder)"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "420c37a1-cf4c-4af1-a565-218016fca586",
      "name": "创建 Zoho 发票",
      "type": "n8n-nodes-base.zohoCrm",
      "position": [
        2288,
        -208
      ],
      "parameters": {
        "subject": "Form Sale",
        "resource": "invoice",
        "Product_Details": [
          {
            "id": "{{ $zoho_product_id_1 }}",
            "total": "={{ $('Organize & Generate Order ID').item.json.products[0].subTotal }}",
            "quantity": "={{ $('Organize & Generate Order ID').item.json.products[0].quantity }}",
            "unit_price": "={{ $('Organize & Generate Order ID').item.json.products[0].unitPrice }}",
            "product_description": "={{ $('Organize & Generate Order ID').item.json.products[0].options }}"
          }
        ],
        "additionalFields": {
          "Grand_Total": "={{ $('Organize & Generate Order ID').item.json.total }}"
        }
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "919827cc-6c70-4d27-a5f5-c0a0aebc5730",
      "name": "Telegram 触发器(获取 ChatId)",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -176,
        -432
      ],
      "webhookId": "ee13da0e-595b-4b4a-8f35-912e44059af6",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "c7810f3b-da2a-4dcb-a63e-f02e2c294e04",
      "name": "插入订单数据",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        224,
        -176
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $json.customer.name }}",
            "email": "={{ $json.customer.email }}",
            "phone": "={{ $json.customer.phone }}",
            "address": "={{ $json.customer.address }}",
            "orderId": "={{ $json.orderId }}",
            "TelegramDate": 0,
            "MessageChatId": ""
          },
          "schema": [
            {
              "id": "MessageChatId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "MessageChatId",
              "defaultMatch": false
            },
            {
              "id": "TelegramDate",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TelegramDate",
              "defaultMatch": false
            },
            {
              "id": "orderId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "orderId",
              "defaultMatch": false
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "address",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8bca615b-5157-4641-ab95-af3548c27293",
      "name": "获取空 ChatId 行",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        32,
        -432
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "MessageChatId",
              "condition": "isEmpty"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "856d1f24-6ea8-419f-b974-88517c06d333",
      "name": "更新 ChatId",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        288,
        -432
      ],
      "parameters": {
        "columns": {
          "value": {
            "MessageChatId": "={{ $('Telegram Trigger (Get ChatId)').item.json.message.chat.id }}"
          },
          "schema": [
            {
              "id": "MessageChatId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "MessageChatId",
              "defaultMatch": false
            },
            {
              "id": "orderId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "orderId",
              "defaultMatch": false
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "address",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "MessageChatId"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "MessageChatId",
              "condition": "isEmpty"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e9796f5f-1c75-4db1-8b23-07d36a805221",
      "name": "获取订单行以检查 ChatId",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        624,
        -176
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "orderId",
              "keyValue": "={{ $('Insert Order Data').item.json.orderId }}",
              "condition": "equal"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3cfda48d-d552-4f64-8305-6fddbbf1d4be",
      "name": "标记为等待中",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1120,
        48
      ],
      "parameters": {
        "columns": {
          "value": {
            "waitedOnce": "true"
          },
          "schema": [
            {
              "id": "MessageChatId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "MessageChatId",
              "defaultMatch": false
            },
            {
              "id": "orderId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "orderId",
              "defaultMatch": false
            },
            {
              "id": "waitedOnce",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "waitedOnce",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "orderId",
              "keyValue": "={{ $json.orderId }}",
              "condition": "equal"
            }
          ]
        },
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "{{ $datatable_id }}",
          "cachedResultUrl": "/projects/{{ $project_id_placeholder }}/datatables/{{ $datatable_id }}",
          "cachedResultName": "JotformTelegram (Placeholder)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fd53acd6-7699-421a-84cd-18ce3dd9a6be",
      "name": "分支(ChatId 检查)",
      "type": "n8n-nodes-base.switch",
      "position": [
        1104,
        -176
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e308b538-960e-4a09-b23f-8d252174df38",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.waitedOnce }}",
                    "rightValue": ""
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "409a337d-b3af-4bcf-b316-92de32911dc5",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.MessageChatId }}",
                    "rightValue": ""
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "3306d51c-b1c8-4f36-8648-6701a69b78b9",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -256
      ],
      "parameters": {
        "color": 3,
        "content": "当 JotForm 上提交新订单表单时启动工作流。"
      },
      "typeVersion": 1
    },
    {
      "id": "259d41a0-48a4-4a37-99a0-352e2ca08ad3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -256
      ],
      "parameters": {
        "color": 4,
        "width": 192,
        "content": "解析表单数据,构建结构,并创建唯一订单 ID。"
      },
      "typeVersion": 1
    },
    {
      "id": "d2312f79-9ca4-4c73-8f6c-4df71acec6d6",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -256
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "将订单详情保存到 n8n 数据表中以跟踪其状态和 Chat ID。"
      },
      "typeVersion": 1
    },
    {
      "id": "138ef5db-e274-43a6-8665-327c3a2cd047",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -496
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "content": "独立触发器,等待客户向机器人发送任何消息以捕获其 Chat ID。"
      },
      "typeVersion": 1
    },
    {
      "id": "dbb6be07-f740-402a-bd36-2f9187d107ea",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -496
      ],
      "parameters": {
        "color": 5,
        "width": 208,
        "content": "在数据表中查找等待客户 Chat ID 的订单。"
      },
      "typeVersion": 1
    },
    {
      "id": "5b18035f-c415-4000-9e5c-c2f0d9397745",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -496
      ],
      "parameters": {
        "color": 4,
        "content": "使用来自新 Telegram 消息的 Chat ID 更新相应的待处理订单行。"
      },
      "typeVersion": 1
    },
    {
      "id": "41d16d68-1e62-47ef-b6aa-8f0697e87672",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -256
      ],
      "parameters": {
        "color": 4,
        "width": 272,
        "content": "在插入后立即检查数据表,查看客户的 Chat ID 是否已可用。"
      },
      "typeVersion": 1
    },
    {
      "id": "e1c89c28-44b8-4357-8c8f-fda555564cfc",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -256
      ],
      "parameters": {
        "color": 2,
        "width": 256,
        "height": 176,
        "content": "如果找到 Chat ID 则引导流程继续,如果仍缺失则等待。"
      },
      "typeVersion": 1
    },
    {
      "id": "5f1d726b-3db7-4625-a05f-c87f5000174c",
      "name": "等待 5 分钟",
      "type": "n8n-nodes-base.wait",
      "position": [
        832,
        48
      ],
      "webhookId": "b9883ceb-0655-451f-865d-15702bece4c3",
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "826077be-7a44-48b1-b23d-9061199fc290",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "content": "。"
      },
      "typeVersion": 1
    },
    {
      "id": "cb339e04-fdbd-458b-841a-f295c7802f9a",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        96
      ],
      "parameters": {
        "color": 6,
        "content": "。"
      },
      "typeVersion": 1
    },
    {
      "id": "d8c50d9c-f33b-4490-b25f-b7862d65dd4c",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        -256
      ],
      "parameters": {
        "color": 5,
        "height": 176,
        "content": "获取最终完整的订单数据行,包括确认的 Chat ID。"
      },
      "typeVersion": 1
    },
    {
      "id": "bd70e237-75a9-4bdc-80ef-760a1c027c47",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        -272
      ],
      "parameters": {
        "color": 4,
        "height": 176,
        "content": "将 Chat ID 和产品列表格式化为易于使用的结构,用于最终消息。"
      },
      "typeVersion": 1
    },
    {
      "id": "5fb92642-5c3d-48c0-8ab8-deb3fef8c264",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        -544
      ],
      "parameters": {
        "color": 5,
        "content": "将完整订单信息记录到指定的 Google Sheet(CRM)中。"
      },
      "typeVersion": 1
    },
    {
      "id": "36ff95d6-b3b4-4388-90f3-95e87e3cb629",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2208,
        -272
      ],
      "parameters": {
        "color": 5,
        "height": 176,
        "content": "在 Zoho CRM 中自动为新订单生成发票。"
      },
      "typeVersion": 1
    },
    {
      "id": "3362d046-225e-4efa-8ea9-3227d35c82f6",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -272
      ],
      "parameters": {
        "color": 4,
        "content": "通过 Telegram 向客户发送最终的模板化订单确认消息。"
      },
      "typeVersion": 1
    },
    {
      "id": "0a61c4b5-13fa-476f-a00d-ca693ec60760",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -1056
      ],
      "parameters": {
        "width": 1024,
        "height": 736,
        "content": "# JotForm 设置指南"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "24b0b0d7-3c2d-4fc6-aa45-344c34171922",
  "connections": {
    "Mark as Waited": {
      "main": [
        [
          {
            "node": "Get Order Row to Check ChatId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 Minutes": {
      "main": [
        [
          {
            "node": "Mark as Waited",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If ChatId Found": {
      "main": [
        [
          {
            "node": "Set ChatId and Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Organize & Generate Order ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get ChatId Row(s)": {
      "main": [
        [
          {
            "node": "If ChatId Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Order Data": {
      "main": [
        [
          {
            "node": "Get Order Row to Check ChatId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Zoho Invoice": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Empty ChatId Rows": {
      "main": [
        [
          {
            "node": "Update ChatId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch (ChatId Check)": {
      "main": [
        [
          {
            "node": "Get ChatId Row(s)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 5 Minutes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set ChatId and Products": {
      "main": [
        [
          {
            "node": "Create Zoho Invoice",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append/Update CRM Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Organize & Generate Order ID": {
      "main": [
        [
          {
            "node": "Insert Order Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Order Row to Check ChatId": {
      "main": [
        [
          {
            "node": "Switch (ChatId Check)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger (Get ChatId)": {
      "main": [
        [
          {
            "node": "Get Empty ChatId Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个高级难度的通用自动化工作流。适合高级用户,包含 16+ 个节点的复杂工作流

需要付费吗?

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

工作流信息
难度等级
高级
节点数量32
分类-
节点类型12
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Abdullah Alshiekh

Abdullah Alshiekh

@abdullah01

🚀 Automation pro building AI-powered workflows with n8n. 💼 Special focus on real use cases 🔧 Love clean, flexible, and business-ready automations.

外部链接
在 n8n.io 上查看 →

分享此工作流