8
n8n 中文网amn8n.com

使用Google Sheets、Forms和Gmail通知自动化多步骤入职流程

高级

这是一个HR, Multimodal AI领域的自动化工作流,包含 31 个节点。主要使用 If, Set, Code, Form, Gmail 等节点。 使用Google Sheets、Forms和Gmail通知自动化多步骤入职流程

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "id": "bdb2c014-ce81-4e05-bfd1-e6ca9a42fb0f",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2240,
        2462
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "73376d8c-21d3-47b3-af14-3872147ce7af",
      "name": "生成消息表",
      "type": "n8n-nodes-base.code",
      "position": [
        -1800,
        2362
      ],
      "parameters": {
        "jsCode": "const steps = $input.all().map((item) => item.json);\n\nconst result = steps.reduce((acc, step) => {\n  const { step: stepIndex, Type, ...rest } = step;\n  if (!acc[stepIndex]) {\n    acc[stepIndex] = {};\n  }\n  if (!acc[stepIndex][Type]) {\n    acc[stepIndex][Type] = {};\n  }\n  acc[stepIndex][Type] = rest;\n  return acc;\n}, {});\n\nreturn result;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "46747e54-1288-4887-aa08-d37cc835f57e",
      "name": "读取MSG状态行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1580,
        2362
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit?usp=drivesdk",
          "cachedResultName": "Standardized messages status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gdLmm513ROUyH6oU",
          "name": "Google Sheets account"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.6
    },
    {
      "id": "0d67cbd3-d0f5-45a7-9057-289a97be871a",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "disabled": true,
      "position": [
        -2240,
        2262
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2526926e-8a12-4e5c-a588-03e9f03bb334",
      "name": "如果完成4",
      "type": "n8n-nodes-base.if",
      "position": [
        -260,
        2562
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "02a63c32-dbed-48d6-a459-2d12969c6524",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.check }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "75188ae4-001c-4a84-89fd-b9d9f3d9f608",
      "name": "表单",
      "type": "n8n-nodes-base.form",
      "position": [
        -1800,
        1860
      ],
      "webhookId": "77ad7d58-abf8-4133-96f7-0a117a157b59",
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "Thanks a lot for entering your information"
      },
      "typeVersion": 1
    },
    {
      "id": "2db39637-6703-4691-ad62-1aabb8429357",
      "name": "保存注册数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2020,
        1860
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "submittedAt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "submittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "formMode",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "formMode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "step",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "step",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit?usp=drivesdk",
          "cachedResultName": "Standardized messages status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gdLmm513ROUyH6oU",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "824c1b36-bff3-4165-821a-9e2425c0a067",
      "name": "读取消息",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2020,
        2362
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/17_fUSV9zJo8Ya6ulvCOon2wjoeEmOwDFrpK1Xxa9gmw/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "17_fUSV9zJo8Ya6ulvCOon2wjoeEmOwDFrpK1Xxa9gmw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/17_fUSV9zJo8Ya6ulvCOon2wjoeEmOwDFrpK1Xxa9gmw/edit?usp=drivesdk",
          "cachedResultName": "Standardized Messages"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gdLmm513ROUyH6oU",
          "name": "Google Sheets account"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.6
    },
    {
      "id": "d3dcba73-305b-4faf-94ae-8f6d53a9f708",
      "name": "更新行状态为已完成",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -260,
        2120
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "completed",
            "row_number": "={{ $('Read MSG status Rows').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "submittedAt",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "submittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "formMode",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "formMode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "step",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "step",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit?usp=drivesdk",
          "cachedResultName": "Standardized messages status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "VVX0td9tCoaQ6bwK",
          "name": "New credentials to new project"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "8a89a0c4-0dae-4139-91c3-b05678722d10",
      "name": "执行某些操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -700,
        2220
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e336dac1-00e4-4149-8e00-d3e207a99549",
      "name": "检查操作是否完成",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -700,
        2562
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "159ebeb8-efc0-4489-be43-7fe7e05597ca",
      "name": "创建下一步",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        400,
        2462
      ],
      "parameters": {
        "columns": {
          "value": {
            "step": "={{ $('Read MSG status Rows').item.json.step + 1 }}",
            "Email": "={{ $('Read MSG status Rows').item.json.Email }}",
            "status": "=sent",
            "Last Name": "={{ $('Read MSG status Rows').item.json['Last Name'] }}",
            "First Name": "={{ $('Read MSG status Rows').item.json['First Name'] }}"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "submittedAt",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "submittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "formMode",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "formMode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "step",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "step",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1yJ1JaUq4BNMWpBKl9E6Z-lkwcnZA7xQxc-zy4-TDeM0/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit?usp=drivesdk",
          "cachedResultName": "Standardized messages status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gdLmm513ROUyH6oU",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "082323c8-a6ec-475d-ad37-74df2cad4757",
      "name": "发送消息",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -2240,
        2960
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "email"
            },
            {
              "name": "subject"
            },
            {
              "name": "content"
            },
            {
              "name": "variables",
              "type": "object"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "fccbeab1-3536-409a-b68a-4bcf63a14f05",
      "name": "Gmail2",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1800,
        2960
      ],
      "webhookId": "4deca0da-c9ea-4707-bd1e-7f334b86a4a4",
      "parameters": {
        "sendTo": "={{ $('Send message').item.json.email }}",
        "message": "={{ $json.msg }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $('Send message').item.json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "DLjspol9TLgpGaXa",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "15c53cfe-963c-4ff3-8126-204c9c01f00e",
      "name": "向用户发送消息",
      "type": "n8n-nodes-base.executeWorkflow",
      "onError": "continueErrorOutput",
      "position": [
        -480,
        2220
      ],
      "parameters": {
        "mode": "each",
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "EORpbQwSc80AYgSs"
        },
        "workflowInputs": {
          "value": {
            "email": "={{ $('Read MSG status Rows').item.json.Email }}",
            "content": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].sent.Content }}",
            "subject": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].sent['Email subject'] }}",
            "variables": "={{ $('Set variables').item.json.variables }}"
          },
          "schema": [
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variables",
              "type": "object",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "variables",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": true,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "17b9e0b9-9be8-4086-86d2-6b5f3e43096e",
      "name": "向管理员发送消息",
      "type": "n8n-nodes-base.executeWorkflow",
      "onError": "continueErrorOutput",
      "position": [
        -260,
        2320
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "EORpbQwSc80AYgSs"
        },
        "workflowInputs": {
          "value": {
            "email": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error['Email Reponsible'] }}",
            "content": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error.Content }}",
            "subject": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error['Email subject'] }}",
            "variables": "={{ $('Set variables').item.json.variables }}"
          },
          "schema": [
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variables",
              "type": "object",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "variables",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a007cd85-93d8-48bb-8921-ffdb5b653491",
      "name": "向用户1发送消息",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -40,
        2462
      ],
      "parameters": {
        "mode": "each",
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "EORpbQwSc80AYgSs"
        },
        "workflowInputs": {
          "value": {
            "email": "={{ $('Read MSG status Rows').item.json.Email }}",
            "content": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].completed['Content'] }}",
            "subject": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].completed['Email subject'] }}",
            "variables": "={{ $('Set variables').item.json.variables }}"
          },
          "schema": [
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variables",
              "type": "object",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "variables",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9fc1fc41-0776-4fc5-a4c1-efc5129e3b12",
      "name": "设置变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -1360,
        2362
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7bcd18e7-d1aa-4f9b-8bc6-3114cee5a2b2",
              "name": "variables",
              "type": "object",
              "value": "={{ { email: $('Read MSG status Rows').item.json['First Name']+'.'+$('Read MSG status Rows').item.json['Last Name'] +'@yourcompany.com', error: \"This has been ean error\" } }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "72bd115d-d8ec-43d4-93d0-bbd3eedbbba1",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        -2020,
        2960
      ],
      "parameters": {
        "jsCode": "\nlet template = $input.first().json.content\nlet variables = $input.first().json.variables\nlet msg = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, variableName) => {\n    return variables.hasOwnProperty(variableName) \n        ? variables[variableName] \n        : match; // if variable not found, leave as is\n});\n\nreturn {msg}"
      },
      "typeVersion": 2
    },
    {
      "id": "99146b8e-8f06-4c1c-94ff-abf68cf2fa29",
      "name": "向管理员1发送消息",
      "type": "n8n-nodes-base.executeWorkflow",
      "onError": "continueErrorOutput",
      "position": [
        -40,
        2662
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "EORpbQwSc80AYgSs"
        },
        "workflowInputs": {
          "value": {
            "email": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error['Email Reponsible'] }}",
            "content": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error['Content'] }}",
            "subject": "={{ $('Generate message table').item.json[$('Read MSG status Rows').item.json.step].error['Email subject'] }}",
            "variables": "={{ $('Set variables').item.json.variables }}"
          },
          "schema": [
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variables",
              "type": "object",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "variables",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "691dc84a-67aa-4df2-9ccf-43b24ef21a4d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2300,
        1680
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 340,
        "content": "## 这是起始点"
      },
      "typeVersion": 1
    },
    {
      "id": "fe9f14e5-6ddf-4354-9596-d4cb3f933664",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -920,
        2178
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Step 1",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e27fcf86-b911-4fb8-b578-5e634dcaa652",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 1
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 2",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1e77bdfb-5aad-45c5-a9ef-6882d0c448e9",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 2
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 3",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6cb7728e-4ee2-446a-8822-12c1b98d5aca",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 4",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "193098e4-0fa4-4805-ac37-8512bd8ce33b",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 4
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 5",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "efe9e13c-4a52-456a-b927-29694fe9b0da",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 5
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "7fef0239-7179-4ac2-8b6b-df3e0ff68ba6",
      "name": "开关1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -920,
        2520
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Step 1",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e27fcf86-b911-4fb8-b578-5e634dcaa652",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 1
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 2",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1e77bdfb-5aad-45c5-a9ef-6882d0c448e9",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 2
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 3",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6cb7728e-4ee2-446a-8822-12c1b98d5aca",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 4",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "193098e4-0fa4-4805-ac37-8512bd8ce33b",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 4
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Step 5",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "efe9e13c-4a52-456a-b927-29694fe9b0da",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.step }}",
                    "rightValue": 5
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "add73124-2a49-4b9b-b732-ff51c519b631",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        2060
      ],
      "parameters": {
        "height": 340,
        "content": "## 案例设置"
      },
      "typeVersion": 1
    },
    {
      "id": "6ad12fb7-9e21-443a-bc2a-1f3f582fbe95",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        2420
      ],
      "parameters": {
        "height": 400,
        "content": "## 案例设置"
      },
      "typeVersion": 1
    },
    {
      "id": "e25b6577-80ef-4419-ba65-8d7baa5c7bb4",
      "name": "### 替换 Airtable 连接",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2300,
        2040
      ],
      "parameters": {
        "color": 4,
        "width": 2940,
        "height": 800,
        "content": "## 主工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "61697f64-a7f5-44b3-97f2-aa99104d61e0",
      "name": "切换步骤类型",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1140,
        2362
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "sent",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d2891710-d6d4-47d9-aecd-8e3a9e1f8454",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.status }}",
                    "rightValue": "=sent"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "completed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9713a3ff-b93b-4b18-9e12-666d398351b6",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Read MSG status Rows').item.json.status }}",
                    "rightValue": "completed"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "c35de795-5fc3-4e6d-a87b-a98d467e7f74",
      "name": "调试模式设置结果",
      "type": "n8n-nodes-base.set",
      "position": [
        -480,
        2562
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c5376105-41c5-4cee-ac3f-665bda0a996d",
              "name": "check",
              "type": "boolean",
              "value": true
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3d3ce9ce-83d1-4e07-8f09-a4248e9e8759",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2300,
        2860
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 260,
        "content": "## 子工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "e0a9ac24-c20a-4209-a896-55da6dd158e3",
      "name": "更新行状态为已通过",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        2460
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "passed",
            "row_number": "={{ $('Read MSG status Rows').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "submittedAt",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "submittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "formMode",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "formMode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "step",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "step",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1yJ1JaUq4BNMWpBKl9E6Z-lkwcnZA7xQxc-zy4-TDeM0/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HBLJNt8hAXNkqj6lfwQilBr9FCRxjT3j0r0Ni6cgoYA/edit?usp=drivesdk",
          "cachedResultName": "Standardized messages status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gdLmm513ROUyH6oU",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9d5ca28d-01a3-405c-a3a9-f9de83ba174e",
      "name": "注册",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -2240,
        1860
      ],
      "webhookId": "fc69bf4d-938e-48e4-a2e1-91f599c0d61a",
      "parameters": {
        "options": {
          "path": "onboarding"
        },
        "formTitle": "Welcome to our company",
        "formFields": {
          "values": [
            {
              "fieldLabel": "First Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Last Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "requiredField": true
            },
            {
              "fieldName": "step",
              "fieldType": "hiddenField",
              "fieldValue": "1"
            },
            {
              "fieldName": "status",
              "fieldType": "hiddenField",
              "fieldValue": "sent"
            }
          ]
        },
        "formDescription": "Please enter you data here"
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Gmail2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Do some action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do some action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do some action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do some action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do some action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Check if action done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check if action done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check if action done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check if action done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check if action done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Registration": {
      "main": [
        [
          {
            "node": "Save registration Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If completed4": {
      "main": [
        [
          {
            "node": "Send msg to user1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send msg to admin1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Messages": {
      "main": [
        [
          {
            "node": "Generate message table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set variables": {
      "main": [
        [
          {
            "node": "Switch type of step",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Do some action": {
      "main": [
        [
          {
            "node": "Send msg to user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create next step": {
      "main": [
        []
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send msg to user": {
      "main": [
        [
          {
            "node": "Update row to completed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send msg to admin",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send msg to user1": {
      "main": [
        [
          {
            "node": "Update row to passed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch type of step": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if action done": {
      "main": [
        [
          {
            "node": "Debug mode set result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read MSG status Rows": {
      "main": [
        [
          {
            "node": "Set variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row to passed": {
      "main": [
        [
          {
            "node": "Create next step",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Debug mode set result": {
      "main": [
        [
          {
            "node": "If completed4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate message table": {
      "main": [
        [
          {
            "node": "Read MSG status Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save registration Data": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row to completed": {
      "main": [
        []
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Read Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人力资源, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量31
分类2
节点类型14
难度说明

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

作者
PollupAI

PollupAI

@zeerobug

We create bespoke AI solutions, automations and agents that help your business as it scales.

外部链接
在 n8n.io 查看

分享此工作流