Back to projects

Automation

Internal automation console for operations

An operations team moved data between tools by hand. We built a console where approved jobs run with logs, retries, and a human pause switch.

Next.jsAPI RoutesPrismaZodVercel
Internal automation console for operations product interface

Client challenge

Nightly copy-paste between CRM, spreadsheets, and a billing tool created inconsistent records. Failures were discovered days later when a customer noticed. Nobody could answer which run succeeded without reading chat history.

Constraints

  • Could not replace the CRM in phase one
  • Jobs must be pauseable by non-engineers
  • Every external write needed an audit entry
  • Vendor rate limits were tight during business hours

Engineering decisions

Job table as source of truth

Each automation run is a row with status, attempts, and payload summary. The UI never invents state the database does not know.

Idempotent workers

Retries use idempotency keys so a double-click or crashed worker does not create duplicate CRM notes.

Approval-minded high-risk actions

Writes that email customers or alter billing fields require an explicit confirm step until error rates are boring.

Architecture

Next.js admin UI over API routes. Prisma job and attempt models. Workers claim jobs with leasing. Zod validates payloads at the edge. Structured logs include job id for traceability.

Implementation

We implemented three high-frequency jobs first: contact sync, status reconciliation, and nightly digest. The console shows queue depth, last success, and failure reasons in plain language. Operators can pause a job type without redeploying.

InterfacesWeb apps, portals, admin consolesApplication servicesAuth, domain rules, validation, jobsData & eventsPostgres, object storage, audit logsIntegrationsCRM, email, payments, model APIs

Tradeoffs

  • Did not introduce a heavy workflow engine—Postgres jobs were enough
  • Limited historical retention of payloads to control storage and PII surface
  • Deferred fancy charts in favor of a reliable table + filters

Lessons learned

  • Visibility beats cleverness for ops trust
  • Pause switches prevent 2 a.m. incidents from cascading
  • Start with the jobs that fail noisily, not the ones that look impressive in demos

Outcome

Manual transfers dropped for the covered flows. Failures surface the same day with enough context to retry or escalate. The team gained a path to add jobs without inventing a new ops ritual each time.

Future improvements

Candidates include webhook-driven triggers, richer dead-letter handling, and per-tenant concurrency budgets.

Screenshots

Internal automation console for operations interface 1
Internal automation console for operations interface 2

More work

Facing a similar constraint set?

Tell us about the workflow, the tools involved, and what “done” means for the first release.

Talk about an ops console