8
n8n 中文网amn8n.com

在Slack中通过弹出模态框列出近期ServiceNow事件

高级

这是一个Support领域的自动化工作流,包含 29 个节点。主要使用 If, Set, Sort, Limit, Slack 等节点。 在Slack中通过弹出模态框列出近期ServiceNow事件

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8"
  },
  "nodes": [
    {
      "id": "a9a92b8a-05cf-4d9e-ae01-be3b17346893",
      "name": "解析 Webhook",
      "type": "n8n-nodes-base.set",
      "position": [
        -560,
        660
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e63f9299-a19d-4ba1-93b0-59f458769fb2",
              "name": "response",
              "type": "object",
              "value": "={{ $json.body.payload }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "f999011b-e54d-4514-94ec-4d544af4d145",
      "name": "关闭模态弹窗",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -160,
        1120
      ],
      "parameters": {
        "options": {},
        "respondWith": "noData"
      },
      "typeVersion": 1.1
    },
    {
      "id": "a16d64a0-fe07-4cae-b458-a91937e57a4e",
      "name": "路由消息",
      "type": "n8n-nodes-base.switch",
      "position": [
        -380,
        660
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Request Modal",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.response.callback_id }}",
                    "rightValue": "search_recent_incidents"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Submit Data",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "65daa75f-2e17-4ba0-8fd8-2ac2159399e3",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.response.type }}",
                    "rightValue": "view_submission"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Block Actions",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c242cee2-7274-4e02-bfbe-d0e999d30ea7",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.response.type }}",
                    "rightValue": "block_actions"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "none"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "54fa31d5-7259-4c19-8891-8b559af87959",
      "name": "ServiceNow 模态窗口",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        560
      ],
      "parameters": {
        "url": "https://slack.com/api/views.open",
        "method": "POST",
        "options": {},
        "jsonBody": "=  {\n    \"trigger_id\": \"{{ $('Parse Webhook').item.json['response']['trigger_id'] }}\",\n    \"external_id\": \"Search SNOW Incidents\",\n    \"view\": {\n\t\"title\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Search SNOW Incidents\",\n\t\t\"emoji\": true\n\t},\n\t\"submit\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Search\",\n\t\t\"emoji\": true\n\t},\n\t\"type\": \"modal\",\n\t\"external_id\": \"search_snow_incidents\",\n\t\"close\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Cancel\",\n\t\t\"emoji\": true\n\t},\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"block_id\": \"greeting_section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \":wave: Hey there!\\n\\nUse this form to search ServiceNow for incidents based on their priority and state. Both of these properties are required to search incidents properly.\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\",\n\t\t\t\"block_id\": \"divider_1\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"priority_selector\",\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"external_select\",\n\t\t\t\t\"placeholder\": {\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"Priority of Incidents to Search\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t},\n\t\t\t\t\"action_id\": \"priority_select\",\n\t\t\t\t\"min_query_length\": 0\n\t\t\t},\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"Priority Selector\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"state_selector\",\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"external_select\",\n\t\t\t\t\"placeholder\": {\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"State of Incidents to Search\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t},\n\t\t\t\t\"action_id\": \"state_select\",\n\t\t\t\t\"min_query_length\": 0\n\t\t\t},\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"State Selector\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Please select a channel where the results will be posted.\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"actions\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"channels_select\",\n\t\t\t\t\t\"placeholder\": {\n\t\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\t\"text\": \"Select a channel\",\n\t\t\t\t\t\t\"emoji\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"action_id\": \"actionId-1\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "slackApi"
      },
      "credentials": {
        "slackApi": {
          "id": "K04E2FxPZozHux9J",
          "name": "ServiceNow Bot"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d16de218-b99b-4d13-9655-8fe1a329e01f",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -760,
        660
      ],
      "webhookId": "e03c7d39-1dce-4ac5-8db8-2b4511a85a07",
      "parameters": {
        "path": "e03c7d39-1dce-4ac5-8db8-2b4511a85a07",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "57ee358a-d409-42e7-8200-4475c4c59263",
      "name": "发送 200 响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -160,
        1660
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "86b0fd85-b3d5-456c-8f59-0f29f283969f",
      "name": "ServiceNow",
      "type": "n8n-nodes-base.serviceNow",
      "position": [
        100,
        1120
      ],
      "parameters": {
        "options": {
          "sysparm_query": "=incident_state={{ $json.response.view.state.values.state_selector.state_select.selected_option.value }}^priority={{ $json.response.view.state.values.priority_selector.priority_select.selected_option.value }}",
          "sysparm_display_value": "all"
        },
        "resource": "incident",
        "operation": "getAll",
        "returnAll": true,
        "authentication": "basicAuth"
      },
      "credentials": {
        "serviceNowBasicApi": {
          "id": "wjkWiUNQxo5PzTIb",
          "name": "ServiceNow Basic Auth account"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "95fcd7f1-ac3a-4128-8b4a-84b636487d9e",
      "name": "频道 - 通知用户无匹配事件",
      "type": "n8n-nodes-base.slack",
      "position": [
        960,
        1360
      ],
      "webhookId": "5d1ecba8-d03b-47cc-9d30-fd631e7816c1",
      "parameters": {
        "text": "=No incidents were found with a state of {{ $('Parse Webhook').item.json.response.view.state.values.state_selector.state_select.selected_option.text.text }} and priority of {{ $('Parse Webhook').item.json.response.view.state.values.priority_selector.priority_select.selected_option.text.text }}.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Parse Webhook').item.json.response.view.state.values.pWqkN['actionId-1'].selected_channel }}"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "K04E2FxPZozHux9J",
          "name": "ServiceNow Bot"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7f638817-6f97-42a9-9027-dd0d5fb6f560",
      "name": "私信 - 通知用户无匹配事件",
      "type": "n8n-nodes-base.slack",
      "position": [
        960,
        1600
      ],
      "webhookId": "5d1ecba8-d03b-47cc-9d30-fd631e7816c1",
      "parameters": {
        "text": "=No incidents were found with a state of {{ $('Parse Webhook').item.json.response.view.state.values.state_selector.state_select.selected_option.text.text }} and priority of {{ $('Parse Webhook').item.json.response.view.state.values.priority_selector.priority_select.selected_option.text.text }}.",
        "user": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Parse Webhook').item.json.response.user.id }}"
        },
        "select": "user",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "K04E2FxPZozHux9J",
          "name": "ServiceNow Bot"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f3a21223-9e74-4066-af9f-6b94f69cb01f",
      "name": "是否找到事件?",
      "type": "n8n-nodes-base.if",
      "position": [
        360,
        1120
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fcdf9a8e-6359-4a3e-bf4e-e1834945727b",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('ServiceNow').item.json.number.value }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e27438cb-ba24-4a3b-8fe8-52b7d39cb1e0",
      "name": "无匹配 - 是否选择了频道?",
      "type": "n8n-nodes-base.if",
      "position": [
        580,
        1480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a0b79298-b93f-4ed3-b53b-5c28dfdb2699",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Parse Webhook').item.json.response.view.state.values.pWqkN['actionId-1'].selected_channel }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "de7d3155-1c6d-43a1-9cc0-4900d176fd3e",
      "name": "按最近时间排序",
      "type": "n8n-nodes-base.sort",
      "position": [
        580,
        580
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "order": "descending",
              "fieldName": "number.value"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "19f529c7-bfe6-4713-8ed3-d80ecc0078de",
      "name": "保留前 5 个事件",
      "type": "n8n-nodes-base.limit",
      "position": [
        740,
        580
      ],
      "parameters": {
        "maxItems": 5
      },
      "typeVersion": 1
    },
    {
      "id": "9b095ad5-dedc-43e6-9ab3-947b90e7145d",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        920,
        580
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9a236a69-3ea5-46f5-8f2d-f7421bff638a",
      "name": "格式化事件详情",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        680
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "62388dab-28d4-40fa-a9f9-90d68c5dc491",
              "name": "incident_details",
              "type": "string",
              "value": "={\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"<https://dev206761.service-now.com/nav_to.do?uri=incident.do?sys_id={{ $json.sys_id.value }}|*{{ $json.task_effective_number.value }}*>\\n{{ $json.short_description.display_value }}\\n*Opened by:* {{ $json.caller_id.display_value }}\\n*Date Opened:* {{ $json.opened_at.display_value }}\\n*Severity:* {{ $json.severity.display_value }}\\n*Priority:* {{ $json.priority.display_value }}\\n*State:* {{ $json.incident_state.display_value }}\\n*Category:* {{ $json.category.display_value }}\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6e15b991-d9d5-4244-a3db-dbd37c248303",
      "name": "格式化 Slack 消息",
      "type": "n8n-nodes-base.set",
      "position": [
        1320,
        500
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "90720996-88cc-4e47-b5bb-d5570c15f95c",
              "name": "slack_output",
              "type": "string",
              "value": "={\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"block_id\": \"greeting_section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \":wave: Hey there!\\n\\nHere are the incident summaries you requested with a state of {{ $('Parse Webhook').item.json.response.view.state.values.state_selector.state_select.selected_option.text.text }} and priority of {{ $('Parse Webhook').item.json.response.view.state.values.priority_selector.priority_select.selected_option.text.text }}.\\nA total of {{ $('ServiceNow').all().length }} incident(s) were found. If more than 5 were found only the 5 most recent will be listed. You can <https://dev206761.service-now.com/now/nav/ui/classic/params/target/incident_list.do%3Fsysparm_query%3Dincident_state%253D{{ $('Parse Webhook').item.json.response.view.state.values.state_selector.state_select.selected_option.value }}%255Epriority%253D{{ $('Parse Webhook').item.json.response.view.state.values.priority_selector.priority_select.selected_option.value }}%26sysparm_first_row%3D1%26sysparm_view%3Dess|click here> to view all of the matching incidents in ServiceNow.\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{{ $('Concatenate Incident Details').item.json.concatenated_incident_details }}\n\t]\n}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "08182589-800d-4ce6-8654-fc53d2ee56c3",
      "name": "连接事件详情",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1140,
        500
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "incident_details",
              "aggregation": "concatenate"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "86b698d2-2854-4393-8ee8-76f8e7b01586",
      "name": "私信 - 发送匹配事件",
      "type": "n8n-nodes-base.slack",
      "position": [
        1880,
        720
      ],
      "webhookId": "5d1ecba8-d03b-47cc-9d30-fd631e7816c1",
      "parameters": {
        "text": "=",
        "user": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Parse Webhook').item.json.response.user.id }}"
        },
        "select": "user",
        "blocksUi": "={{ $('Format Slack Message').item.json.slack_output }}",
        "messageType": "block",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "K04E2FxPZozHux9J",
          "name": "ServiceNow Bot"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cbd8fbc3-d589-4625-99b5-a98e6a41d4bb",
      "name": "频道 - 发送匹配事件",
      "type": "n8n-nodes-base.slack",
      "position": [
        1880,
        520
      ],
      "webhookId": "5d1ecba8-d03b-47cc-9d30-fd631e7816c1",
      "parameters": {
        "text": "=",
        "select": "channel",
        "blocksUi": "={{ $('Format Slack Message').item.json.slack_output }}",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Parse Webhook').item.json.response.view.state.values.pWqkN['actionId-1'].selected_channel }}"
        },
        "messageType": "block",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "K04E2FxPZozHux9J",
          "name": "ServiceNow Bot"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c3ed618f-b65e-4df2-80c0-90b2e2be3783",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -709.4873251551015
      ],
      "parameters": {
        "color": 7,
        "width": 709.3965558024038,
        "height": 887.8719128264411,
        "content": "![Slack](https://uploads.n8n.io/templates/servicenowmodalinterface.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "69f47cb7-84c6-4037-b3ba-8364ec572fde",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -798.751282964615,
        190.55356752462308
      ],
      "parameters": {
        "color": 7,
        "width": 579.6865154062818,
        "height": 647.0013506366993,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "622f63e4-fd03-4a76-bb2d-04a2daea9a46",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        188.05676141451897
      ],
      "parameters": {
        "color": 7,
        "width": 710.3172669178614,
        "height": 563.0861092667175,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "16d7f224-7792-4e9f-ae5c-1c0b6a39e703",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        760
      ],
      "parameters": {
        "color": 7,
        "width": 709.0896745965773,
        "height": 550.5825149622945,
        "content": "![Servicenow](https://uploads.n8n.io/templates/servicenow.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "3f52816d-db59-4574-b82e-8a9ca854e049",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        526.5720643091352,
        908.7025500703817
      ],
      "parameters": {
        "color": 7,
        "width": 714.3631681325317,
        "height": 911.8420872184945,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "22943cc9-c79c-4465-ac9e-040d5f49a879",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        1328.507039277291
      ],
      "parameters": {
        "color": 7,
        "width": 709.4188646504804,
        "height": 492.8100521251637,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "95d4d5e1-5f6b-4107-a55d-51e70c25c055",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528.3624557345836,
        26.66938195987973
      ],
      "parameters": {
        "color": 7,
        "width": 956.6393374313541,
        "height": 870.8771447693905,
        "content": "![n8n](https://uploads.n8n.io/templates/n8n.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "2d55c76a-f7ba-46ec-acc1-13f54b22b2ee",
      "name": "是否选择了频道?",
      "type": "n8n-nodes-base.if",
      "position": [
        1580,
        580
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a0b79298-b93f-4ed3-b53b-5c28dfdb2699",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Parse Webhook').item.json.response.view.state.values.pWqkN['actionId-1'].selected_channel }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "70792926-097f-4f2b-b3b4-afc7bad60ea6",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        27.218710650838375
      ],
      "parameters": {
        "color": 7,
        "width": 657.1120966423081,
        "height": 870.9953951550463,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "0ae7f5bf-7a78-42f6-95aa-c0f685e63c40",
      "name": "响应 Slack Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -100,
        560
      ],
      "parameters": {
        "options": {},
        "respondWith": "noData"
      },
      "typeVersion": 1.1
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Parse Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ServiceNow": {
      "main": [
        [
          {
            "node": "Were Incidents Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Webhook": {
      "main": [
        [
          {
            "node": "Route Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Message": {
      "main": [
        [
          {
            "node": "Respond to Slack Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Close Modal Popup",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Concatenate Incident Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Incident Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Close Modal Popup": {
      "main": [
        [
          {
            "node": "ServiceNow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort by Most Recent": {
      "main": [
        [
          {
            "node": "Retain First 5 Incidents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message": {
      "main": [
        [
          {
            "node": "Was a Channel Selected?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Were Incidents Found?": {
      "main": [
        [
          {
            "node": "Sort by Most Recent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Matches - Was a Channel Selected?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Incident Details": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Was a Channel Selected?": {
      "main": [
        [
          {
            "node": "Channel - Send Matching Incidents",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DM - Send Matching Incidents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Slack Webhook": {
      "main": [
        [
          {
            "node": "ServiceNow Modal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retain First 5 Incidents": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Concatenate Incident Details": {
      "main": [
        [
          {
            "node": "Format Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Matches - Was a Channel Selected?": {
      "main": [
        [
          {
            "node": "Channel - Notify User no Incidents Matched",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DM - Notify User no Incidents Matched",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 客户支持

需要付费吗?

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

工作流信息
难度等级
高级
节点数量29
分类1
节点类型13
难度说明

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

作者
Angel Menendez

Angel Menendez

@djangelic

Angel Menendez is a Staff Developer Advocate at n8n.io, specializing in low-code tools for cybersecurity workflows. From Puerto Rico, Angel's tech journey began by helping his father translate technical books. He later started a web development business and transitioned from a career as a flight attendant to cybersecurity engineering. His workflows have saved companies significant time. Outside work, Angel enjoys time with his two sons, riding electric bikes, reading, and exploring new places.

外部链接
在 n8n.io 查看

分享此工作流