8
n8n 中文网amn8n.com

使用Slack和Gmail的安装预约审批工作流

中级

这是一个Ticket Management, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 If, Set, Gmail, Slack, FormTrigger 等节点。 使用Slack和Gmail表单自动化安装预约审批

前置要求
  • Google 账号和 Gmail API 凭证
  • Slack Bot Token 或 Webhook URL
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "F3ZBYce4AMuybZcF",
  "meta": {
    "instanceId": "efe08e2da7cae43f565dfacaafdb0e67025886141ccd3ddbe001880f7b5ecf5b"
  },
  "name": "使用 Slack 和 Gmail 的安装预约审批工作流",
  "tags": [],
  "nodes": [
    {
      "id": "57b8a226-402b-42cf-b6bb-090195a862d9",
      "name": "表单触发器:安装预约",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -16,
        496
      ],
      "webhookId": "711021d0-5405-4e16-a638-16e32c093f39",
      "parameters": {
        "options": {},
        "formTitle": "Installation Schedule Booking Form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Full Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email Address",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone Number",
              "requiredField": true
            },
            {
              "fieldType": "=date",
              "fieldLabel": "Booking Date",
              "fieldOptions": {
                "values": [
                  {}
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Preferred Time (PST)",
              "fieldOptions": {
                "values": [
                  {
                    "option": "09:00"
                  },
                  {
                    "option": "11:00"
                  },
                  {
                    "option": "14:00"
                  },
                  {
                    "option": "16:00"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "formDescription": "Installation Schedule Booking Form"
      },
      "typeVersion": 2.2
    },
    {
      "id": "9f165f71-d038-49d0-8277-41c42a8ab0af",
      "name": "设置字段:配置变量",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        496
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1c5bdf30-d39c-42ac-a780-dc5c35a6aa17",
              "name": "CUSTOMER_NAME",
              "type": "string",
              "value": "={{ $('Form Trigger: Installation Booking').item.json['Full Name'] }}"
            },
            {
              "id": "3b70d00a-c884-4721-b9cb-018ed47e4818",
              "name": "CUSTOMER_EMAIL",
              "type": "string",
              "value": "={{ $('Form Trigger: Installation Booking').item.json['Email Address'] }}"
            },
            {
              "id": "4c70d00a-c884-4721-b9cb-018ed47e4819",
              "name": "CUSTOMER_PHONE",
              "type": "string",
              "value": "={{ $('Form Trigger: Installation Booking').item.json['Phone Number'] }}"
            },
            {
              "id": "5c70d00a-c884-4721-b9cb-018ed47e4820",
              "name": "BOOKING_DATE",
              "type": "string",
              "value": "={{ $('Form Trigger: Installation Booking').item.json['Booking Date'] }}"
            },
            {
              "id": "6c70d00a-c884-4721-b9cb-018ed47e4821",
              "name": "BOOKING_TIME",
              "type": "string",
              "value": "={{ $('Form Trigger: Installation Booking').item.json['Preferred Time (PST)'] }}"
            },
            {
              "id": "7c70d00a-c884-4721-b9cb-018ed47e4822",
              "name": "SLACK_CHANNEL_ID",
              "type": "string",
              "value": "#installations"
            },
            {
              "id": "8c70d00a-c884-4721-b9cb-018ed47e4823",
              "name": "COMPANY_NAME",
              "type": "string",
              "value": "Your Company Name"
            },
            {
              "id": "9c70d00a-c884-4721-b9cb-018ed47e4824",
              "name": "CONTACT_PERSON",
              "type": "string",
              "value": "Your Name"
            },
            {
              "id": "10c70d00a-c884-4721-b9cb-018ed47e4825",
              "name": "RESCHEDULE_LINK",
              "type": "string",
              "value": "https://your-booking-form-url.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9242d614-bc41-4dd9-9b68-ff2938d128d4",
      "name": "Slack:请求审批",
      "type": "n8n-nodes-base.slack",
      "position": [
        496,
        496
      ],
      "webhookId": "99741701-02dc-46e6-b578-d492b7de6983",
      "parameters": {
        "select": "channel",
        "message": "=🔧 **New Installation Request**\n\n👤 **Customer:** {{ $json.CUSTOMER_NAME }}\n📧 **Email:** {{ $json.CUSTOMER_EMAIL }}\n📞 **Phone:** {{ $json.CUSTOMER_PHONE }}\n\n📅 **Requested Date/Time:** {{ $json.BOOKING_DATE }} at {{ $json.BOOKING_TIME }} PST\n\n❓ **Do we have an available installer for this slot?**",
        "options": {},
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "disapproveLabel": "No installer available"
          }
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "7331465f-d0d0-47a2-8451-5aab04607305",
      "name": "条件:检查审批状态",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        496
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d0117e5a-8b9a-407a-8412-1c7decbdd759",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "Approve"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a751b5f3-ed2e-4a93-b061-539688520478",
      "name": "Gmail:发送确认邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        992,
        384
      ],
      "webhookId": "3052ddc4-ba25-47ca-bb42-c7a55652901a",
      "parameters": {
        "sendTo": "={{ $('Set Fields: Configuration Variables').item.json.CUSTOMER_EMAIL }}",
        "message": "=Hi {{ $('Set Fields: Configuration Variables').item.json.CUSTOMER_NAME }},\n\nGreat news! We've confirmed your installation appointment.\n\n📅 **Date:** {{ $('Set Fields: Configuration Variables').item.json.BOOKING_DATE }}\n⏰ **Time:** {{ $('Set Fields: Configuration Variables').item.json.BOOKING_TIME }} PST\n\nOur installer will contact you shortly to confirm final details and provide any preparation instructions.\n\nIf you need to make any changes, please contact us as soon as possible.\n\nBest regards,\n{{ $('Set Fields: Configuration Variables').item.json.CONTACT_PERSON }}\n{{ $('Set Fields: Configuration Variables').item.json.COMPANY_NAME }}",
        "options": {},
        "subject": "=✅ Installation Confirmed - {{ $('Set Fields: Configuration Variables').item.json.BOOKING_DATE }}",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "852c2a56-3558-44ac-9af9-1cd28bedb52b",
      "name": "Gmail:发送重新安排邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        992,
        592
      ],
      "webhookId": "13839f70-e63f-4ec3-b526-00aa455fd899",
      "parameters": {
        "sendTo": "={{ $('Set Fields: Configuration Variables').item.json.CUSTOMER_EMAIL }}",
        "message": "=Hi {{ $('Set Fields: Configuration Variables').item.json.CUSTOMER_NAME }},\n\nThank you for your interest in our installation services.\n\nUnfortunately, we don't have an installer available for your requested time slot:\n📅 **Date:** {{ $('Set Fields: Configuration Variables').item.json.BOOKING_DATE }}\n⏰ **Time:** {{ $('Set Fields: Configuration Variables').item.json.BOOKING_TIME }} PST\n\nPlease reschedule your appointment using this link:\n🔗 {{ $('Set Fields: Configuration Variables').item.json.RESCHEDULE_LINK }}\n\nWe apologize for any inconvenience and look forward to serving you at a different time.\n\nBest regards,\n{{ $('Set Fields: Configuration Variables').item.json.CONTACT_PERSON }}\n{{ $('Set Fields: Configuration Variables').item.json.COMPANY_NAME }}",
        "options": {},
        "subject": "=⏰ Please Reschedule Your Installation",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "665cac83-98f4-4789-ab7a-11754f9bc0fa",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -208
      ],
      "parameters": {
        "width": 736,
        "height": 672,
        "content": "## 🔧 安装预约审批工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "0abbb78d-aaac-41ca-aab5-ca1653b43b2c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        672
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 1**"
      },
      "typeVersion": 1
    },
    {
      "id": "faf5a165-9a69-42c9-be57-abb67e209269",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        672
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 2**"
      },
      "typeVersion": 1
    },
    {
      "id": "a89a9974-8b5a-4c5c-b79f-88df7961493a",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        672
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 3**"
      },
      "typeVersion": 1
    },
    {
      "id": "5cf683dc-bbdc-4f59-ac2b-aacb72efe823",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        672
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 4**"
      },
      "typeVersion": 1
    },
    {
      "id": "4d48f4a4-d01b-4e39-b3f5-23e6d101bd06",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        272
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 5A**"
      },
      "typeVersion": 1
    },
    {
      "id": "c8f5c8fc-9fb0-481a-9070-5b4f285aa97e",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        768
      ],
      "parameters": {
        "width": 200,
        "height": 140,
        "content": "**步骤 5B**"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bb882f11-e83f-4520-ae9a-c62690c0abf2",
  "connections": {
    "Slack: Request Approval": {
      "main": [
        [
          {
            "node": "If: Check Approval Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If: Check Approval Status": {
      "main": [
        [
          {
            "node": "Gmail: Send Confirmation Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail: Send Reschedule Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form Trigger: Installation Booking": {
      "main": [
        [
          {
            "node": "Set Fields: Configuration Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Fields: Configuration Variables": {
      "main": [
        [
          {
            "node": "Slack: Request Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 工单管理, 多模态 AI

需要付费吗?

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

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

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

作者
Chris Rudy

Chris Rudy

@chrisrudy

DTC Marketing consultant with over 6 years of experience and over $25m in ad spend managed

外部链接
在 n8n.io 查看

分享此工作流