Rescue trials that never activated
Open a Zendesk ticket for customer success three days before a trial ends, if the account never activated. A PostgreSQL trigger with a computed clock.
- PostgreSQL
- Zendesk
- Braze
- Customer success
- once per account
The trigger
One read-only SELECT against PostgreSQL. Rowfire polls it for new rows, and the rule fires once per account.
SELECT a.id AS account_id,
a.name AS account,
a.owner_name,
a.owner_email,
a.trial_ends_at,
a.trial_ends_at - interval '3 days' AS nudge_at
FROM accounts a
JOIN plans p ON p.id = a.plan_id
WHERE p.name = 'Trial'
AND a.activated_at IS NULL
AND a.is_internal = falseThis is an absence: no code runs when a trial fails to activate, so the application has nothing to emit. The query finds it instead.
The clock is nudge_at, three days before the trial ends, and the key is
account_id. The rule rescue_stalled_trial fires once per account, so
nobody is chased twice.
For the team or for the customer
- Customer success: a Zendesk ticket with the owner’s name and email, so someone reaches out personally. In the demo’s 120 days, that’s 87 tickets.
- Lifecycle: a Braze
trial_stalledcustom event, which starts an automated rescue campaign.
Both can subscribe to the same trigger. Run them in shadow first, then promote.
Questions
Nothing happens in the app when a trial stalls. How does this fire?
The clock is computed in the query: nudge_at, three days before trial_ends_at. When a poll sees nudge_at pass for a row that still matches, the rule fires.
Can it start a Braze campaign instead of a ticket?
Yes. Attach a Braze action that sends a trial_stalled custom event, and let the campaign in Braze take it from there.