跳转到内容

Stripe 支付失败实时告警

第 6 部分 · 案例 3.2 · 🛒 电商 SaaS

难度 🟢 简单 · 耗时 ~15 分钟 · 核心节点 Stripe Trigger × IF × Slack

支付失败 = 失去客户。让团队第一时间知道、并按金额分级处理是基本功。这个 workflow 监听 Stripe payment_failed 事件,>$50 进 #payments-critical 频道(需要立刻人工跟进),其他进 #payments,统一落库到 Airtable 做后续分析。

  • SaaS / 电商:丢一单可能丢一个客户终身价值
  • 财务团队需要月度失败原因统计
  • 高价单需要客服主动联系挽回
▦ workflow stripe-failures.workflow.json Lv.1
stripe-trigger.txt
Events: [payment_intent.payment_failed] Credentials: Stripe Secret Key n8n 自动在 Stripe 注册 webhook endpoint。
if-amount.txt
Conditions: Value 1: ={{ $json.data.object.amount }} ← Stripe 用 cents Operator: > Value 2: 5000 ← 即 $50.00
slack-critical.txt
Channel: #payments-critical Text: 🚨 HIGH-VALUE payment failed Customer: {{ $json.data.object.customer }} Amount: ${{ $json.data.object.amount / 100 }} Reason: {{ $json.data.object.last_payment_error.message }}

两条分支(critical / normal)都汇到 Airtable 表里做后续分析:

airtable-log.txt
Operation: Create Record Table: failed_payments Fields: customer_id: ={{ $json.data.object.customer }} amount: ={{ $json.data.object.amount / 100 }} reason: ={{ $json.data.object.last_payment_error.message }} failed_at: ={{ $now.toISO() }}
📋 stripe-failures.workflow.json