Wake an agent from Stripe events
Have an agent follow up on failed payments, new subscriptions or refunds. Create a Stripe trigger with Stripe's own signing secret and connect it.
On this page
A Stripe trigger wakes an agent when something happens in your Stripe account: an invoice payment fails, a subscription is cancelled, a charge is refunded. The agent can chase the failed payment, update your records, or brief you on who left.
For how triggers work in general (rules, Act or Propose only, the delivery log), see let an event wake your agent.
Before you start#
- An agent that has finished setting up.
- Access to the Developers area of your Stripe Dashboard.
1. Add the endpoint in Stripe#
Stripe's own guide is receive Stripe events in your webhook endpoint, and every event is described in types of events.
- In the Stripe Dashboard, open the webhooks area under Developers and add a new endpoint (Stripe may call it an event destination).
- Select the events you want, for example
invoice.payment_failed. - For the endpoint URL, enter a temporary address for now, such as your own website. You replace it in step 3.
- Save, then reveal and copy the endpoint's Signing secret (
whsec_…).
2. Create the trigger in Qoren#
- Open the agent, click Settings, then Connections, scroll to Triggers and click Add a trigger.
- Name it in What is this for?, for example "Failed invoices".
- Under Where does it come from?, pick Stripe (1).
- Under Which events?, pick the same events you chose in Stripe (2).
- Write the rules: what the agent should do with each event.
- Paste Stripe's
whsec_…secret into Already have a signing secret? (3).
123- Click Create trigger, and copy the Webhook URL from the card that appears. It is shown only once. The Signing secret on the card is the Stripe secret you pasted.
The events offered for Stripe are checkout.session.completed, payment_intent.succeeded, payment_intent.payment_failed, invoice.paid, invoice.payment_failed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted and charge.refunded. You can type any other Stripe event type and press Enter.
3. Point Stripe at the trigger#
- Back in Stripe, open the endpoint you created and edit its URL.
- Replace the temporary address with the Webhook URL from Qoren and save.
Check that it works#
- Cause a real event in Stripe's test mode, or send one with the Stripe CLI's
stripe triggercommand (see trigger webhook events with the Stripe CLI). It should appear in the trigger's Deliveries. - Send a test event in the Qoren trigger sends a made-up Stripe-shaped sample straight to the agent, so you can check your rules without touching Stripe.
- Nothing in Deliveries? Stripe shows the response for each attempt on the endpoint. A refused signature means the secret in Qoren is not this endpoint's secret: create the trigger again with the right one.
What the agent receives#
Stripe puts the event type in the body, so the trigger matches on names like invoice.payment_failed. The agent gets your rules and the full event object Stripe sent, labelled as data from outside, and replies with a short summary for the delivery log.
Qoren checks Stripe's signed timestamp and refuses anything older than five minutes, so an old delivery replayed by someone else is rejected. When Stripe retries an event, Qoren recognises its event id and does not run the agent twice.
Frequently asked questions#
Why can't I just use the secret Qoren makes?
Stripe signs every event with the endpoint's own secret and does not let you set it. Qoren has to check the signature with that same secret, so you paste Stripe's secret in when you create the trigger.
Can I test with Stripe's test mode?
Yes. Test mode endpoints have their own signing secret, so create a separate trigger for them with that secret.
Which events should I pick?
Only the ones your rules use. Each event that reaches the agent is a paid turn, and some Stripe events fire often.