AI PLAY玩法更新持续收录
← 回到更新流

2026-10-16 · 原文发布日

成交后没付款?AI审计跟进并推送Slack预警

一个n8n免费模板:每小时检查GoHighLevel里已成交但金额大于零的商机,结合Stripe实际收款、对话记录和任务状态计算已付与欠款,构建跟进缺失、客户未回复、任务逾期等确定性标记,交给Gemini输出严重级别、证据和建议跟进话术;需要预警时发到Slack并写入Google表格去重,避免重复提醒。

原文要点

原模板每小时运行,抓取GoHighLevel指定pipeline/stage中closed-won且金额大于0的商机;先用Google Sheets的Notification Log按opportunity_id去重,再取联系人最近对话、消息历史和未完成任务,查Stripe客户charges计算成交后已付与未付。上下文里生成无跟进、跟进过期、客户未回、任务逾期、部分付款、应升级等确定性标记,交Gemini输出含severity/evidence/建议话术的JSON;需预警则发Slack并写回表格。配置要改pipelineId、stageId、locationId,Stripe查找原为固定email,需换成正确客户。

这次做成什么

做一个可审计的“成交未收款”每小时巡检练习:用合成商机、Stripe收款、对话和任务数据算欠款,生成确定标记,让模型只输出严格JSON,再决定是否发Slack并写Notification Log去重。

准备什么

  • n8n可运行实例与Schedule Trigger可用
  • GoHighLevel OAuth2凭据及locationId/pipelineId/stageId
  • Stripe测试模式密钥与可查询charges权限
  • Google Gemini或PaLM API凭据
  • Slack Bot凭据与目标channel
  • Google Sheets服务账号与Notification Log写入权限

具体怎么做

  1. 建去重日志表

    在Google Sheets建Notification Log,列至少含opportunity_id、notified_at、severity、last_status;n8n用Google Sheets节点按opportunity_id lookup,存在则跳过,避免同一商机每小时重复提醒。

  2. 拉取成交商机并过滤

    Schedule Trigger设每小时;HTTP请求GoHighLevel opportunities接口,查询参数替换为你的locationId、pipelineId、stageId;Filter节点保留status=closed-won且monetaryValue>0,再排除已在Notification Log出现的id。

  3. 聚合三类证据

    对每个商机并行取:GHL conversations与messages按contactId取最新方向和时间;tasks按contactId取open且dueDate早于当前;Stripe先按客户email查customer,再list charges,累计created>=closeDate且paid=true金额,未付=金额-已付。

  4. 计算确定标记再调AI

    Function/Code节点生成布尔flags:no_rep_follow_up、stale_follow_up、unanswered_customer_reply、overdue_tasks、partial_payment、escalation_due;把金额、天数、flags作为上下文发给Gemini,要求只返回规定JSON,不允许寒暄。

  5. 分支输出与写回

    IF节点读取verdict.alert_needed;true则Slack postMessage到预警频道,文本含金额、证据和建议话术,随后append/update Notification Log;false只写last_status=ok不发消息。失败分支把HTTP状态写入同一表便于排查。

可直接复制的材料

Gemini审计 verdict 提示词

本站独立编写示例;模型名、字段名需与原模板节点核对,不产生可导入n8n文件。

你是B2B收款审计助手。只输出一个JSON对象,不要Markdown,不要解释。输入字段:opportunity_id, deal_value, paid_since_close, outstanding, days_since_close, last_customer_reply_at, last_rep_follow_up_at, open_overdue_tasks, flags。规则:severity只能是none|low|medium|high;outstanding>0且escalation_due=true为high;outstanding>0且unanswered_customer_reply=true或overdue_tasks=true至少medium;仅partial_payment=true为low;无欠款为none。alert_needed在severity为medium或high时true。evidence数组最多4条,必须引用输入字段。customer_message用中文,语气礼貌,包含应付金额和一个明确下一步。schema={"severity":"","alert_needed":false,"evidence":[""],"customer_message":"","internal_note":""}

合成测试数据

金额单位为分;created对应成交后日期;email/customer/token均换成你的测试隔离数据。

{"opportunity":{"id":"opp_901","contactId":"ct_221","monetaryValue":12000,"currency":"USD","status":"closed-won","closedAt":"2026-10-01T09:00:00Z","email":"buyer@example.test"},"ghl_messages":[{"direction":"inbound","at":"2026-10-10T10:00:00Z"},{"direction":"outbound","at":"2026-10-03T08:00:00Z"}],"tasks":[{"id":"t1","status":"open","dueDate":"2026-10-08"}],"stripe_charges":[{"customer":"cus_test_1","amount":500000,"currency":"usd","paid":true,"created":1791158400}]

字段映射配置

REPLACE_*必须替换;不要提交真实密钥;模板未提供下载时不可伪称可导入JSON。

{"ghl":{"locationId":"REPLACE_LOCATION_ID","pipelineId":"REPLACE_PIPELINE_ID","stageId":"REPLACE_STAGE_ID","closedWonStatus":"closed-won","linkBase":"https://app.gohighlevel.com/v2/location/REPLACE_LOCATION_ID/contacts/"},"stripe":{"lookupBy":"contact.email","paidOnly":true,"since":"opportunity.closedAt"},"sheets":{"spreadsheetId":"REPLACE_SPREADSHEET_ID","sheet":"Notification Log","dedupeKey":"opportunity_id","columns":["opportunity_id","notified_at","severity","last_status"]},"slack":{"channel":"#finance-alerts"}}

输入与输出示例

本站虚构演示,非原作者运行结果;未声称已调用接口。

输入

商机opp_901成交额12000美元,10月1日成交;Stripe成交后仅一笔已付5000美元;客户10月10日来消息后销售未再跟进;任务t1截止10月8日仍open。

对应输出

{"severity":"high","alert_needed":true,"evidence":["outstanding=7000","unanswered_customer_reply=true","overdue_tasks=1","stale_follow_up=true"],"customer_message":"您好,您的订单尚有余款7000美元未结清。请今天回复是否按原链接付款,或需要我重发账单与分期方案。","internal_note":"通知财务并安排24小时内电话跟进"}

做完检查这些

  • 同一opportunity_id第二次运行被Notification Log拦截且不重复发Slack
  • paid_since_close只累计created不早于closedAt且paid=true的charges
  • severity为medium或high时alert_needed=true且Slack与表格各有一条一致记录
  • 模型输出能通过JSON.parse且不含Markdown代码块

容易卡住的地方

  • Stripe原文用固定email查客户,接真实数据前必须改为联系人邮箱映射
  • GHL的pipelineId/stageId/locationId错会拉到空列表或错管道
  • 金额单位混用美元与分会直接导致欠款误判
  • Slack发送成功但表格写回失败会形成重复提醒,需同一事务式检查

原文与作者资料 ↗

本站借助AI整理来源事实,独立编写中文操作指南与示例。示例不代表实际运行结果;来源效果尚未由本站独立复现。付费模板与模型、服务费用分别计算。

原文标题
Audit sales payment follow-ups with HighLevel, Stripe, Gemini and Slack
原作者
iamvaar
原始发布日期
2026-10-15T21:15:12.434Z
来源
https://n8n.io/workflows/21019