Should support and billing be able to trigger or replay production jobs from a dashboard? Let's argue about it
Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run Every serious product eventually has a support or billing person who needs a job to run now: resend the receipt, retry
Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run
Every serious product eventually has a support or billing person who needs a job to run now: resend the receipt, retry the failed dunning charge, kick the provisioner, replay a webhook the provider already gave up on. The choices are: an engineer runs it from a console, or there is a button. The button is faster and more consistent. It is also a way to run production side effects with less friction than deploys usually have.
I have been on teams that refused the button for a year and became a ticket bottleneck, and teams that shipped a wide-open "run job" form and doubled a payroll export. The interesting argument is not "should a button exist", it is who it is for, and what it is allowed to do.
Let's argue about it.
The case for a support-facing replay button
The request is already happening. If you don't build it, you get Slack messages, a shared admin shell, or a SQL snippet in a runbook that someone will one day run twice. A button with auth, an audit log, and the same code path as the scheduler is the grown-up version of that.
Engineers are slow and expensive at this. "Please resend Friday's invoice to this account" should not require a deploy, a console, or an on-call page at 17:40. Billing and support can close the loop in one step if the job is safe.
A good button improves the jobs themselves. To expose "resend invoice", you have to name the job, give it a stable key, and make it idempotent. That work pays off for retries and deploys too. Hidden, engineer-only scripts stay unsafe longer.
You can limit the blast radius. A button that takes an invoice_id is a different product from a button that takes a job class and a JSON payload. The first is a business action. The second is a shell.
The case against, or at least against a generic one
Side effects don't care who clicked. A non-idempotent "retry payment" clicked twice, or clicked on the wrong customer, is a charge. A "rebuild analytics" clicked in production because the staging and prod dashboards look similar is a very long evening. The safer the team feels about the button, the more often it will be used in the dangerous cases.
Permissions get copied, not designed. The first version is "billing can resend invoices". The fifth version is "anyone with admin can run any job", because it was easier to reuse the component. I have seen this happen without malice.
Audit logs are only useful if someone reads them, and if they contain enough. "User X ran job Y" without the arguments, the previous state, and the result is a decoration.
Some jobs should not have a human shortcut. Legal holds, random-payout jobs, bulk-email to the whole list: making them one click away is a risk, even with a confirm modal. Confirm modals are not a security boundary.
Where I've landed
I want named business actions, not a generic job runner, in the hands of the teams that already have the corresponding responsibility.
-
Each button is one job, with a typed id (
invoice_id,user_id,event_id), not a free-form payload. Support can "resend receipt for invoice 123". They cannot "runChargeAll.performwith this JSON". - The action uses the same code and the same idempotency keys as the scheduler. If Friday's job already sent the receipt, the button is a no-op and says so. If it didn't, the button does exactly what Friday's job would have done.
- Role-based access, with a written list. Billing can retry billing jobs. Support can resend email and replay a user's webhook delivery. Nobody gets a "run anything" tool in production without being an engineer, and even then I prefer a CLI with flags over a web form that accepts a class name.
- Every click is audited: who, what, arguments, time, result, and a link to the job run. A weekly sample of the log is part of the same team's routine, not only a thing you grep after an incident.
- Dangerous jobs require a second person or are not exposed. Bulk sends, mass reruns, and anything that moves money in a batch stay off the dashboard, or behind a two-person approval.
A replay button is only as safe as the job's idempotency and the record of what already ran. delay.run keeps a log of each HTTP job attempt and retries failed runs, which is the same evidence a dashboard action should look at before it claims 'resent' or 'already sent'.
The parts I'm still unsure about
- Staging data in production UIs. If your admin tool can be pointed at more than one environment, the button needs a very loud label. I still don't fully trust loud labels.
- Customers triggering their own replays ("resend me the email"). That's often fine for email, and rarely fine for payments. The same infrastructure can serve both; the policy shouldn't.
- Rate limits on the button. Support working through a backlog of 200 "resend" tickets will look like a job storm. Should the button enqueue, not run inline? I think yes, but then the UI has to explain "queued", not "done".
A quick experiment
List the last 20 times someone asked an engineer to "just rerun that". How many of those are a named, idempotent action you would be willing to put behind a role? If the answer is "most of them", you are overdue a dashboard. If the answer is "almost none, they were all special", a button would not have helped, and a generic runner would have been a mistake.
Related reading
- Case study (hypothetical): a unique constraint on the job queue stalled every nightly email for three days, and only the web app was monitored
- How to replay failed webhooks safely: store the raw request, then re-run it with a 40-line Python script
- Once a delayed job is queued, should the user be able to cancel it? Let's argue about it
- Should a failed job retry forever, stop after N attempts, or wait in a dead-letter queue for a human? Let's argue about it
Who can replay a production job in your shop today — engineers only, billing, support — and have you already had a double-run from a well-meant click?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.