8
n8n 中文网amn8n.com

使用Clearbit丰富新Discourse成员并在Slack中通知

中级

这是一个Sales, Support领域的自动化工作流,包含 12 个节点。主要使用 Slack, Filter, Webhook, Clearbit 等节点。 使用Clearbit丰富新Discourse成员并在Slack中通知

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
  },
  "nodes": [
    {
      "id": "8916c4a2-00a1-4c57-a661-0433a71ab316",
      "name": "过滤掉常见个人邮箱",
      "type": "n8n-nodes-base.filter",
      "notes": "Saves on Enrichment credits",
      "position": [
        1000,
        360
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "31a3f64f-cce1-44c3-938c-f18e85c670f3",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.body.user.email }}",
              "rightValue": "@gmail."
            },
            {
              "id": "60087832-5f76-4dcc-bfe6-c899b3623af7",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.body.user.email }}",
              "rightValue": "@yahoo."
            },
            {
              "id": "7fd74d31-ef3d-4a06-aee1-202ade476c10",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.body.user.email }}",
              "rightValue": "@hotmail."
            },
            {
              "id": "4f86817c-53ec-4a80-a961-b4c9bd0c8f7c",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.body.user.email }}",
              "rightValue": "@proton."
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "bf4c1985-71ae-4bb2-86e0-8f795f89620e",
      "name": "无 Clearbit 增强可用",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1520,
        520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0ee7d23a-f6c7-4651-9f4c-b4b041326145",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        540
      ],
      "parameters": {
        "color": 7,
        "width": 314.8866754976157,
        "height": 119.43509109499996,
        "content": "**👈 可选**"
      },
      "typeVersion": 1
    },
    {
      "id": "93d1b345-2954-4bb2-8c13-510bb48f730a",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1660,
        120
      ],
      "parameters": {
        "color": 7,
        "width": 194,
        "height": 101,
        "content": "**可选 👇**"
      },
      "typeVersion": 1
    },
    {
      "id": "ad2823cf-861f-4302-8c8a-51700fbe9602",
      "name": "使用 Clearbit 增强用户信息",
      "type": "n8n-nodes-base.clearbit",
      "notes": " Clearbit returns a 404 error (and in n8n empty output payload) when email is not found",
      "onError": "continueErrorOutput",
      "position": [
        1220,
        360
      ],
      "parameters": {
        "email": "={{ $json.body.user.email }}",
        "resource": "person",
        "additionalFields": {}
      },
      "credentials": {
        "clearbitApi": {
          "id": "fJAEKGUyTHSl0EpC",
          "name": "max@n8n.io (use carefully!)"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "60c5727e-3e9e-48dd-8534-8b89ede90594",
      "name": "获取公司信息",
      "type": "n8n-nodes-base.clearbit",
      "position": [
        1500,
        280
      ],
      "parameters": {
        "domain": "={{ $json.employment.domain }}",
        "additionalFields": {}
      },
      "credentials": {
        "clearbitApi": {
          "id": "fJAEKGUyTHSl0EpC",
          "name": "max@n8n.io (use carefully!)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f5abe4a5-bbe9-4024-a448-c855d7bd8f54",
      "name": "过滤高价值线索",
      "type": "n8n-nodes-base.filter",
      "position": [
        1700,
        280
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "90e62611-28d9-465a-b98e-bf866589363e",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.metrics.employees }}",
              "rightValue": 30
            },
            {
              "id": "06c5fd69-1423-4442-bd8f-f61e5c119a39",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.metrics.alexaGlobalRank }}",
              "rightValue": 100000
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "fd6cab51-0146-401d-b2ef-75780b6e8bd7",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        11.812931088613368
      ],
      "parameters": {
        "color": 6,
        "width": 312.11707638995097,
        "height": 309.60234316641487,
        "content": "### 增强新 Discourse 成员信息,然后为高价值线索在 Slack 中通知"
      },
      "typeVersion": 1
    },
    {
      "id": "5a2e98f1-c681-4a2e-b88c-473069a12b9a",
      "name": "当有新 Discourse 用户时",
      "type": "n8n-nodes-base.webhook",
      "position": [
        640,
        360
      ],
      "webhookId": "06e900e8-9a4f-4786-bd79-928459c36e68",
      "parameters": {
        "path": "abde7a49-208b-4bce-bcb9-910c4e529b06",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "baa0ed59-75a2-4cdb-a540-073bf505bc43",
      "name": "在频道中发布消息",
      "type": "n8n-nodes-base.slack",
      "position": [
        1900,
        280
      ],
      "parameters": {
        "text": "Test message!",
        "select": "channel",
        "blocksUi": "={\n\t\"blocks\": [\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\": \"A high value lead just signed up on our Discourse community 👇\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"context\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"image\",\n\t\t\t\t\t\"image_url\": \"{{ $('Enrich user with Clearbit').item.json[\"avatar\"] }}\",\n\t\t\t\t\t\"alt_text\": \"User's profile avatar\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*{{ $('Enrich user with Clearbit').item.json[\"name\"][\"fullName\"] }}*, *{{ $('Enrich user with Clearbit').item.json[\"employment\"][\"title\"] }}* at *{{ $('Enrich user with Clearbit').item.json[\"employment\"][\"name\"] }}* ({{ $json[\"category\"][\"industry\"] }})\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"actions\",\n\t\t\t\"block_id\": \"actionblock789\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"button\",\n\t\t\t\t\t\"text\": {\n\t\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\t\"text\": \"Open LinkedIn Profile\"\n\t\t\t\t\t},\n\t\t\t\t\t\"style\": \"primary\",\n\t\t\t\t\t\"url\": \"https://www.linkedin.com/{{ $('Enrich user with Clearbit').item.json[\"linkedin\"][\"handle\"]}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"button\",\n\t\t\t\t\t\"text\": {\n\t\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\t\"text\": \"Email {{ $('Enrich user with Clearbit').item.json[\"name\"][\"givenName\"] }} \"\n\t\t\t\t\t},\n\t\t\t\t\t\"url\": \"mailto:{{ $('On new Discourse user').item.json[\"body\"][\"user\"][\"email\"] }}\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#team-design"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "114",
          "name": "n8n Slack"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3f9687f4-0bb4-4e46-9beb-e37eb632bb95",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        520
      ],
      "parameters": {
        "color": 7,
        "width": 330.80402248919853,
        "height": 159.6208789325232,
        "content": "**1. ☝️ 设置 `On new Discourse user` 触发器和 Discourse 中的 Webhook**"
      },
      "typeVersion": 1
    },
    {
      "id": "3223fcb7-dddb-4566-a6c3-340bd1a8b3e3",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1900,
        120
      ],
      "parameters": {
        "color": 7,
        "width": 249.15806405688022,
        "height": 124.16286220264169,
        "content": "**2. 👇 设置 `Post message in Channel` 节点**"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Get company info": {
      "main": [
        [
          {
            "node": "Filter for high value leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On new Discourse user": {
      "main": [
        [
          {
            "node": "Filter out common personal emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich user with Clearbit": {
      "main": [
        [
          {
            "node": "Get company info",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No clearbit enrichment available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter for high value leads": {
      "main": [
        [
          {
            "node": "Post message in Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter out common personal emails": {
      "main": [
        [
          {
            "node": "Enrich user with Clearbit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 销售, 客户支持

需要付费吗?

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

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

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

作者
Max Tkacz

Max Tkacz

@max-n8n

Principal Product Designer @ n8n

外部链接
在 n8n.io 查看

分享此工作流