Turn failed Stripe payments into owned Pylon tickets

When a Stripe charge or invoice payment fails, open a Pylon issue assigned to the account's CSM, tag it for finance review, and post a Slack alert.

Agentic Task
StripePylonSlackFinanceCustomer SupportNotifications & AlertsData Sync

Build an agent workflow that turns failed Stripe payments into owned, tagged Pylon issues plus a Slack alert, so silent revenue leakage becomes a tracked ticket within minutes.

Trigger: Stripe failed payment events. The workflow should fire on Stripe's Failed Payment event (a charge fails) and on Invoice Payment Failed (a subscription or invoice payment attempt fails). One workflow handling both is fine.

On each failed event, the agent should:

1. Gather Stripe context. Use Stripe's Retrieve Charge to pull the failure reason, amount, currency, and customer id. Use Retrieve Customer to get the customer's email, name, and any metadata. If the event is an invoice payment failure, also use Retrieve Invoice to get the invoice number, hosted invoice URL, and next payment retry date.

2. Look the customer up in Pylon. Use Search Accounts in Pylon, matching first by the customer's email domain or external_id, then by the customer's email address as a fallback. If a match is found, also use List Users in Pylon to resolve the assigned CSM or account owner on that account.

3. Create a Pylon issue. Use Pylon's Create Issue with a clear title like "Failed payment: <customer name> — <amount> <currency>". Add the tag billing-failed-payment (and any account-level tags worth carrying forward). Assign the issue to the matched CSM when there is one, otherwise leave it unassigned and note that explicitly. The description should be a structured block including: customer name and email, Stripe customer id, amount and currency, failure reason and decline code, invoice number and hosted invoice URL if applicable, the next Stripe retry date, and a short draft outreach message the CSM can copy and send (polite, references the failure reason in plain English, suggests updating the card or contacting support). If no Pylon account matched, still create the issue with all of the above inline so the team has full context.

4. Post a Slack alert. Use Slack's Send a Message in the finance or customer success channel (let the user choose at setup time). Keep it short: customer name, amount, failure reason, assigned CSM (or "unassigned, needs triage"), and a link to the new Pylon issue. Bold the amount and the CSM name so it's scannable.

Edge cases to handle: if the customer is self-serve and has no Pylon account, still create the Pylon issue and still post in Slack, flagged as "new contact, no Pylon account." If a Pylon issue already exists for this customer with the billing-failed-payment tag and is still open, add an internal note to that issue with the new failure details instead of opening a duplicate, and mention in Slack that an existing ticket was updated.

Tone for the draft outreach message: warm, direct, no jargon. One paragraph, two or three sentences. No em dashes.

Additional information

What does this prompt do?
  • Listens for failed Stripe charges and failed invoice payments and reacts within minutes.
  • Looks up the customer in Pylon and opens a tagged support issue with the failure reason, amount, and a draft outreach message.
  • Assigns the issue to the customer's CSM, or flags it for triage when no Pylon account exists yet.
  • Posts a short alert in your finance or customer success Slack channel with a link to the new Pylon issue.
What do I need to use this?
  • A Stripe account that records charges and invoices.
  • A Pylon workspace where customer accounts and CSM ownership live.
  • A Slack workspace with a finance or customer success channel ready to receive alerts.
How can I customize it?
  • Change which Slack channel receives the alert, or route different failure reasons to different channels.
  • Adjust the Pylon tag (the default is billing-failed-payment) so finance can filter by quarter, plan, or amount.
  • Edit the draft outreach message tone, or add a manager CC for invoices above a certain dollar amount.

Frequently asked questions

What if the customer is not in Pylon yet?
The agent still creates a Pylon issue with the customer's email, name, and Stripe context inline so your team can follow up, and it flags the issue as unassigned in the Slack alert so triage knows to claim it.
Does this run on every failed charge, including retries?
Yes, every failed charge and failed invoice payment opens a Pylon issue. If you only want one ticket per customer per dunning cycle, you can tell the agent to look for an open billing-failed-payment issue first and add a comment instead of opening a duplicate.
How does the agent decide who to assign the Pylon issue to?
It reads the matched account in Pylon and assigns the issue to the listed CSM or account owner. If no owner is set, it leaves the issue unassigned and notes that in Slack so a manager can route it.
Will this work for one-off charges as well as subscription invoices?
Yes. Stripe sends a failed event for both standalone charges and subscription invoices, and the agent handles both, pulling the right context for each.
Can I change the tag or add more than one?
Yes. The agent uses a billing-failed-payment tag by default, and you can swap it or layer in extra tags like high-value or trial-customer based on the amount or plan.

Stop letting failed payments slip through the cracks.

Connect Stripe, Pylon, and Slack once, and Geni converts every failed charge into an owned ticket within minutes.