Dev.to WebDev 🛠 Dev 👁 0 📖 5 min read

Free trials that convert to paid: a 12-point checklist for the scheduled jobs behind them (reminders, charges, downgrades)

Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run A free trial looks like a feature on the pricing page. Under the hood it's a small set of scheduled jobs: a reminder

Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run

A free trial looks like a feature on the pricing page. Under the hood it's a small set of scheduled jobs:

  • a reminder a few days before the trial ends,
  • a conversion that charges the card (or asks for one),
  • a downgrade or lock-out if payment doesn't happen,
  • and sometimes a "we miss you" follow-up afterwards.

Each one runs once per customer, at a time that depends on when they signed up, and each one directly affects whether a customer trusts you. Get the reminder wrong and you look sneaky. Get the charge wrong and you have refunds and chargebacks. Get the downgrade wrong and paying customers get locked out.

Here's the checklist I'd use.

The timeline

1. Store the trial end as an exact instant, not a date. trial_ends_at = 2026-12-01T14:32:10Z, computed once at signup. "14 days" from a date column means midnight in some time zone you didn't choose, and customers in UTC+10 lose most of their last day.

2. Decide what "end of trial" means to the customer, and show it. "Your trial ends on 1 December at 14:32 your time" is unambiguous. Show it in the app and in every email, in the customer's time zone. If you round to end-of-day, say so and actually do it in their zone.

3. Schedule from the stored instant, per customer. One delayed job per trial event (reminder, conversion, downgrade), each keyed by customer and event type. A single nightly batch that "converts everyone whose trial ended today" makes the actual timing depend on when the batch runs and how long it takes, and one failure delays everyone.

The reminder

4. Send the reminder early enough to act on. Three days before is common; some regulations and card network rules effectively require advance notice for trials that convert to paid. Check the rules for your markets and your payment provider's requirements.

5. Re-check state when the job runs. By the time the reminder fires, the customer may have already upgraded, cancelled, or deleted their account. The job should load current state and do nothing if the reminder no longer applies. Never trust what was true at scheduling time.

6. Make it idempotent. Store "reminder sent for trial X" before or atomically with sending. A retried job must not send a second reminder.

Every one of these steps is a delayed job that has to fire on time, once, and survive a deploy. delay.run holds the delayed HTTP callback outside your app, retries it if your endpoint fails, and keeps a log of every attempt, so “did the reminder go out?” has an answer.

The conversion

7. Let the payment provider do the charge if it can. Most providers support trials natively: the subscription starts with a trial, and the provider charges automatically at the end, with its own retries and authentication flows. Your job then becomes reacting to webhooks (invoice.paid, invoice.payment_failed), not running the charge. Fewer moving parts.

8. If you charge yourself, use an idempotency key. Derive it from the trial ID, so a retried conversion job can never charge twice. Handle 3-D Secure and other authentication: a charge that needs customer action isn't a failure, it's a "send them a link" state.

9. Plan for payment failure before it happens. A declined card at conversion is common. Decide the grace period (immediately downgrade, or keep access for a few days while retrying), and schedule the retries and the final downgrade as separate jobs.

The downgrade

10. Downgrade from current state, not from the schedule. When the downgrade job fires, check: has the customer paid since? Is there a successful invoice? Has support extended the trial manually? Only then remove access. A downgrade job that fires after a late successful payment is the worst possible bug here, because it locks out someone who just paid you.

11. Make extensions and cancellations reschedule cleanly. When support extends a trial by a week, the old reminder, conversion and downgrade jobs must be cancelled or superseded, and new ones scheduled. Storing a version on the trial and having each job check it ("I was scheduled for version 2, current is 3, exit") is a simple, robust pattern.

Observability

12. Have a daily reconciliation report. A query that lists trials that ended more than an hour ago and are still in "trialing" state, customers with access but no active subscription, and customers with a paid subscription but downgraded access. Each row is a job that didn't run, ran twice, or ran in the wrong order. On a healthy system the report is empty.

Test the whole timeline in minutes, not weeks

Nobody wants to wait 14 days to find out whether the downgrade job works. Make the trial length and every offset (reminder at -3 days, grace period of 3 days) configuration, not constants, and run an end-to-end test in staging with a trial of five minutes and offsets of one minute. Watch each job fire, extend the trial halfway through to check that rescheduling works, then let a test card decline to check the failure path. It's a 20-minute test that catches most of the bugs above.

The short version

  • Exact instants, shown to customers in their own time zone.
  • One delayed job per customer per trial event, not a nightly batch.
  • Every job reloads state, checks a version, and is idempotent.
  • Let the provider charge where possible.
  • Reconcile daily.

If you'd rather not run the delayed-job part yourself, delay.run is built for exactly that: schedule the HTTP call for the trial-end instant, retry on failure, and keep the run history.

Related reading

How do you run trial expiry today: provider-managed trials, a nightly batch, or per-customer jobs? And what's gone wrong with it?

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.