Stripe Failed Payment Alert
Check Stripe for recent charges and alert on failed payments.
Use case
Failed card charges are easy to miss until churn shows up in your MRR. This workflow pulls your most recent Stripe charges, filters out the ones that failed, and sends a single digest notification to your team so someone can follow up before the customer silently lapses — kicking off dunning, asking for an updated card, or retrying the charge manually.
What it does each run
- fetch_charges (
stripe) — calls the Stripe APIlist_chargesoperation (most recent 100 charges). The Stripe connector publishes exactly two outputs:result(the raw Stripe JSON response as a string) andstatus(the HTTP status code). Note:list_chargesdoes not filter by status — it returns all recent charges, paid and failed alike. - summarize_failures (
anthropic) — consumes{{fetch_charges.result}}and{{fetch_charges.status}}, keeps only charges whosestatusisfailed(orpaid: false), and produces a concise markdown digest (count, amount, customer email, failure reason). Publishesanswer. - alert_team (
message) — drops{{summarize_failures.answer}}into the notification body and sends it to all subscribers of theintouchuser. If nothing failed, the digest says so and you still get a clean-run confirmation.
The workflow is also wired with an error notification: if the Stripe fetch or the AI
step fails (bad credential, API outage, rate limit), the intouch user is
alerted via alertOnError.
Required credentials / setup
This workflow's apiKey properties are set to the placeholder
<set via credential>. Supply the real values at install time via an InTouch
credential (recommended) or a runtime environment variable — never hardcode a
key in the YAML.
Stripe API key
Provide your Stripe secret API key (sk_live_... or sk_test_...) for the
fetch_charges task's apiKey. A read-only restricted key with access to the
Charges resource is sufficient and recommended. Stripe authenticates with a
secret API key, not OAuth — no browser consent step is required. Generate the
key in the Stripe Dashboard under Developers → API keys.
AI provider API key
Provide an API key for any supported AI provider (Anthropic, OpenAI, Gemini, Mistral, Ollama or OpenRouter) for the summarize_failures task's apiKey (the AI step to filter and summarize the charge list).
Any supported AI provider works here. This template ships configured for the
anthropic tool; swap that task's tool to openai, gemini, mistral, ollama or
openrouter to use the provider you already have, and point its credential at your
own key. The step is a plain summarise/classify call — nothing in it is vendor
specific. See requires.ai in the manifest.
Subscribers
Make sure at least one contact is attached to the intouch user on a
channel you watch (email, Slack, Discord, Telegram, etc.) so the alert lands
where the team will see it.
Scheduling
Run it on a daily schedule. To check more frequently, schedule it hourly — the workflow always pulls the most recent 100 charges, so a busy account may want a tighter cadence so failures aren't pushed out of the window.