Skip to content
Nawap BastolaAI engineer
All work05 of 062026Commissioned build

OpsPilot

An AI operations inbox that turns each incoming email or document into a case with evidence, a proposed action, and a person who has to say yes.

My role
AI engineer
For
Commissioned by a contractor, under NDA
When
2026
Status
Demo runs on synthetic data
Stack
LangChainFastAPIn8nNext.js
OpsPilot · 1:22Silent walkthrough

The 82 second recording runs on a fictional property maintenance company. Every name, document, policy and amount in it is synthetic demo data. It is not a production deployment.

01

The situation

Support questions, sales leads and supplier invoices all land in the same inbox. Someone reads each one, works out what it is, finds the right policy, and hopefully routes it correctly. Most AI automation requests I get are this same lifecycle wearing a different costume. Receive a messy event, decide what it means, pull it into structured data, get context, propose an action, pause when it is risky, update a system, keep a record.

OpsPilot was commissioned by a contractor and customised to their workflow. The version here is the reusable core, demonstrated on a fictional property maintenance company with three intake types. Service inquiries become leads, warranty and scheduling questions become support cases, and supplier invoices go through validation.

02

How it works

The diagram is the pipeline. The frames below it are taken from the recording.

  1. IntakeGmail, uploads, forms and webhooks arrive through an n8n workflow that owns triggers, auth and retries and nothing else.
  2. StoreCaseA FastAPI service stores the raw object immutably and opens a durable case with a status.
  3. Classify and extractThe model identifies the intent and pulls schema bound facts. Invoice line items go to a deterministic validator.
  4. RetrieveVersioned company policy is searched and the relevant passages are attached as evidence.
  5. GateDraftA response or action is drafted with citations. If nothing clears the evidence threshold, the case escalates instead of guessing.
  6. GatePolicy engineDeterministic rules decide whether the action can auto run, needs approval, or is blocked.
  7. GateApproveA person reviews the exact payload. The approval is bound to its hash, so an edited action needs a new approval.
  8. StoreExecute and recordAn n8n execution workflow calls the connector and every step writes an append only audit event.
Operations inbox listing emails and PDFs as cases with intent, status and time received

Everything lands in one inbox

Email and document intake is classified on arrival. Each row is a case with a type, an intent and a status.

Support case showing the classification, three cited warranty policy passages and a draft response

A support case with its evidence

A warranty question is matched against the policy library. The retrieved passages sit beside the draft reply, each with a relevance score.

Case marked insufficient supporting information with no draft and the evidence scores below threshold

Escalate instead of guessing

When no policy passage clears the evidence threshold, no reply is drafted. The case goes to a person with the reason attached.

Invoice line items beside a list of deterministic validation rules with one arithmetic rule failing

Validate an invoice with code

Extracted line items pass through deterministic rules. Here the items do not add up to the stated subtotal and the case stops for review.

Proposed action showing the exact spreadsheet row and archive path with approve and reject buttons

Approve the exact payload

After correction, the proposed action shows the precise rows it will write. Approval is bound to that payload, so nothing executes if it changes.

Audit trail timeline for one case from intake to completion with linked artifacts

Read the audit trail

Every classification, validation, correction, approval and execution is an append only event with who and when.

Daily operations summary with case counts, human review count and a volume by hour chart

End the day with a summary

A daily view counts cases, human reviews and errors prevented. The figures shown are the synthetic demo’s.

03

Decisions that mattered

  1. n8n for integration, never for business logic

    Workflows own triggers, credentials and retries. Prompts, validation and approval decisions live in the API, so the canvas never becomes the place where the business rules hide.

  2. Deterministic rules beside the model

    Invoice arithmetic, duplicate checks, vendor authorisation and payload validation are ordinary code. The model classifies, extracts and drafts, and does not get the last word.

  3. Approvals bound to a payload hash

    An approval references the hash of the exact action. Edit the action after approval and the execution step refuses it.

  4. Cite evidence or escalate

    A drafted answer must cite retrieved policy. Below the evidence threshold the system escalates with the reason rather than producing a plausible reply.

  5. Audit before autonomy

    The audit log and the human approval path were built before any auto run rules, so autonomy can be widened case type by case type with a record behind it.

04

Where it landed

People only touch the cases that need judgment, and every one of those decisions has an audit event behind it. The same lifecycle handles support questions and supplier invoices with different handlers and one case model.

What holds
  • Invoice arithmetic checked by code, not the model
  • Approvals bound to the exact payload hash
  • Unsupported answers escalate instead of guessing
What stayed open
  • The public demo is not a production deployment and this page does not claim one.
  • The first cut shipped two handlers. Sales leads, Gmail intake, calendar and CRM connectors were designed for the next version.
  • Acceptance thresholds in the spec are targets, not measured results.
05

Notes from the build

Written in my own words, after the fact. Opinions, not claims.

I wrote the design for this as a spec first, about eight hundred lines, before touching code. The useful part was the boundary table. Which component owns what, and more importantly what each one must not own. Most of the bugs I have seen in automation projects are boundary violations, like business rules that quietly migrated into a workflow canvas.

The payload hash idea came from imagining the worst case, an approved action edited after the fact. It is a small amount of code and it removes a whole category of argument about who approved what.

Working under an NDA pushed me to build the synthetic company properly. Fake data that is too clean makes a demo look like a toy, so the invoices have real arithmetic mistakes and the policy library has gaps on purpose.

Nawap Bastola · 2026