The story
From inbox to order folder
The workflow checks the order inbox every minute. It accepts only messages from an allow-list of known senders, keeps the PDF attachments and confirms that each document contains the terms that mark a genuine order.
Every order is stored in Google Drive. The workflow reads the order number and the project number from the document and creates a dedicated folder for that order, so all outputs end up in one place.
Short Telegram messages report when a run starts, which order was processed and when it has finished.
Three agents, three outputs
Instead of one general-purpose prompt, the pipeline uses three agents, each with a narrow task and a fixed output format:
Production documents. One agent prepares every part as a block for the job documents. A fixed page layout keeps three parts per page, so no part is split across a page break. The result is written to a Google Doc.
Delivery-note table. A second agent produces the logistics view: position, customer order number, item text, part code, quantity, unit and delivery date, with a free column for remarks.
Production list. A third agent extracts every order position as structured JSON: position, quantity, material, description, dimensions, drawing number, material grade, manufacturing note and delivery date.
A production list that follows shop-floor rules
The structured data is written to Google Sheets through the Sheets API, formatted, exported as an Excel file and saved in the order folder. The temporary working file is removed afterwards.
The production list has 18 columns and follows the sort order the shop floor uses, with rules per part type: compensation pieces by thickness, segments by their S value, support plates by A3, spacers in their own block by A, and spacer rings and unassignable sizes at the end. Equal values keep the order of the original document.
All dimensions are retained, and the full manufacturing notes appear under them. The latest release adds a delivery date for every order position, including partial quantities, taken directly from the order; missing dates stay empty rather than being guessed.
Guardrails before automation
An automated pipeline is only useful if it stops when something is wrong. The workflow therefore checks its inputs and outputs at several points:
Documents without the required order keywords are rejected. Agent output must be valid JSON. If no production positions are recognised, the workflow stops instead of creating an empty production list.
The order text is treated strictly as data: instructions that appear inside a document are not followed. New releases are tested locally against previous orders and targeted test cases for each part type, then with real order PDFs in the live workflow.
In production, and still growing
The pipeline has run in production since early 2026. It is developed in versioned releases as the client's requirements evolve; the most recent change request added the delivery date for each order position.
The next stage extends the agents beyond order intake: into production itself and into automated invoicing.
