Subscription Past-Due & Trial Ending Notifier
Subscription Past-Due & Trial Ending Notifier
Released in v0.1.222, this workflow keeps organisation owners and admins informed about critical subscription state changes — unpaid invoices and approaching trial expirations — without requiring manual monitoring of the Stripe dashboard.
Overview
The notifier is split into two independent sub-workflows:
| Sub-workflow | Trigger | Purpose |
|---|---|---|
| Past-due / unpaid alert | stripe/customer.subscription.updated event | Immediate notification when a subscription becomes past due or unpaid |
| Trial-ending warning | Daily cron at 09:00 UTC | Advance warning when a trial is within 7 days of expiry |
Past-Due / Unpaid Alert
How it works
Every time Stripe fires a customer.subscription.updated webhook, the workflow inspects the new status field on the subscription object. If the status is either past_due or unpaid, the following actions are taken immediately:
- In-app error notification — an urgent, error-level notification is created in the platform for the affected organisation. It is surfaced to all members holding an
owneroradminrole. - Email notification — an email is dispatched to every
ownerandadminin the organisation, prompting them to update their payment method or settle the outstanding invoice.
Notification recipients
Only members with the owner or admin role within the organisation receive these notifications. Standard members are not notified.
Triggered statuses
| Stripe status | Notification sent? |
|---|---|
past_due | ✅ Yes |
unpaid | ✅ Yes |
| Any other status | ❌ No |
Trial-Ending Warning
How it works
A scheduled job runs every day at 09:00 UTC. It queries all subscriptions that meet both of the following criteria:
statusequalstrialingcurrentPeriodEndis within the next 7 days
For each qualifying subscription, a warning notification is sent to the organisation's owners and admins.
Deduplication
The workflow uses the reminderLog pattern to track which subscriptions have already received a trial-ending warning. Each subscription is sent the warning at most once, regardless of how many subsequent daily sweeps find it still within the 7-day window. This prevents repeated notifications for the same approaching expiry.
Schedule
Cron: 0 9 * * *
Timezone: UTC
Frequency: Daily
Entities
| Entity | Role |
|---|---|
subscriptions | Source of status and currentPeriodEnd data |
organizations | Scopes notifications to the correct org |
orgMembers | Identifies owner / admin recipients |
notifications | Stores and surfaces in-app alerts |
Notes
- The past-due alert is real-time — it fires as soon as the Stripe webhook is received.
- The trial-ending warning is advisory — it does not take any automated action on the subscription itself.
- Both sub-workflows are independent; a subscription that becomes
past_dueduring a trial period will trigger the past-due alert immediately and is also subject to the trial-ending sweep.