Refinement Mid-Stream — Cleaning Up Dirty Data Without Touching App Code
Unstructured text enters SaaS systems every day—typos in line items, rushed internal notes, or unprofessional language typed into draft invoices before they go out to customers. Fixing this usually means manual proofreading, custom app modules, or heavy sync jobs into a secondary database.
In this week’s demo, we showcase Type 3 Orchestration: refining data in flight. We intercept an Odoo invoice post, run its line notes through an AI refinement service, write the clean text directly back to Odoo, and notify the operator via the green bar—all without installing a single Odoo module or touching a database schema.
What’s happening in the demo
We start with a draft customer invoice (2Inv #13) containing typos, informal wording, and profanity across multiple line items. When the operator clicks Confirm, PolySaaS catches the outgoing POST request in flight on the passthrough.
Behind the scenes, our RefineOdooInvoiceDescription atomic service goes to work:
- Targeted text extraction: The atomic service inspects the invoice narration and individual line-note fields via Odoo RPC.
- Guardrailed AI refinement: Spelling, grammar, and profanity are corrected while strictly preserving all financial amounts, quantities, and SKUs.
- Selective write-back: Dirty note lines like “now we seee if this gets refucking fined” automatically become “Now we will see if this gets refined.” Product lines like
polysaas-inventory-seedremain untouched. - Real-time status feed: The PolySaaS header immediately surfaces the result to the operator with an
orch: refinedDoseMessage.
Why this matters
This is the core promise of mid-stream proxy orchestration: same document, cleaner data, zero application bloat.
Because Odoo remains the sole system of record, there are no parallel invoice tables created inside PolySaaS. The transaction executes safely, idempotency checks prevent infinite update loops, and if the AI service ever times out, the posting fails soft—ensuring core billing operations are never blocked.
What’s next
With GET-based data extraction (Type 1), capture-for-analysis (Type 2), and mid-stream refinement (Type 3) locked in, we are moving on to Type 4: embedding custom dynamic UI components directly into the passthrough stream.
Ready to orchestrate your stack without custom code?
Stop spending developer hours building custom integrations and maintaining brittle database syncs. PolySaaS lets you capture, refine, and orchestrate workflows across your entire software stack—100% configured, never coded, and with zero footprint inside your SaaS applications.
“`