Picture the workflow: a project manager at a busy construction company receives a PDF with hundreds of pending work orders. Each order must be manually reviewed, validated, and closed in the system. This is a click-by-click nightmare.
For our client, this process was unsustainable. Their team spent hours weekly on a task that was time-consuming, requiring multiple steps per order. It was error-prone, as manual data entry always is. It was unscalable; as the business grew, the backlog grew faster. Most importantly, it was frustrating. Skilled staff were stuck on repetitive admin tasks instead of high-value work.
They needed a robust automation solution. That’s where SmythOS came in.
The Solution: An Intelligent Multi-Agent System
We built an AI-powered automation system using Smythos. It transforms work order processing from a manual slog into an instant, reliable operation.
What It Does
The system accepts a PDF file of work orders. It then performs the following steps automatically.
- First, it intelligently extracts all work order numbers. This logic handles complex cases like numbers split across lines or containing embedded spaces.
- Next, it validates each work order by checking its status, type, and completion requirements. Eligible work orders are automatically closed in the client’s system.
- Finally, the system logs every action to a Google Sheet for a complete audit trail and reports a comprehensive summary, highlighting any exceptions.
This entire flow requires zero manual intervention.
The Architecture: Two Agents Working in Harmony
We designed a multi-agent architecture to divide responsibilities. This separation of concerns is key to building a maintainable, reliable, and scalable system.
Work Order Manager (The Orchestrator): This agent acts as the main interface. It accepts PDF files or direct work order IDs from users. It handles the initial extraction using advanced pattern recognition and creates the Google Sheet for logging. It then delegates the processing tasks to the handler agent. Once processing is complete, it gathers the results and presents the final summary to the user.
Work Order Handler (The Processor): This agent is the workhorse. It receives batches of work orders from the manager. For each order, it fetches detailed information from the target system. It then determines completion eligibility based on specific business rules and executes the closure operations. This agent also manages errors, retries, and detailed status logging.
Exploring the Technical Magic: How We Made It Bulletproof
Building automation is one thing. Building reliable automation that never loses a work order is another. Here is how we achieved near-perfect reliability.
1. Intelligent PDF Extraction
Work order data in PDFs is rarely clean. Our extraction logic was built to handle multiple edge cases. Work orders might be split across lines (e.g., 239858 + 28 = 23985828). They might be separated by spaces (e.g., 241510 62 = 24151062).
The text is also filled with noise like dates (09/24/2025) or phone numbers ((832) 386-0049). Our pattern recognition logic correctly identifies the 6-8 consecutive digits of a true work order while filtering out this noise.
2. Multi-Level Validation
The agent performs multi-level validation at every stage of the process. It confirms all work orders were found after extraction and verifies data was retrieved for every order after fetching details. The system then ensures all orders were categorized after the eligibility check and validates successful completion after closure attempts.
Before logging to Google Sheets, it confirms report completeness and verifies all rows were written after the append. If any validation fails, the system automatically retries up to 3 times before marking an exception.
3. Smart Batch Processing
Processing a PDF with hundreds of work orders at once is risky. The system automatically chunks large requests into batches of 20. It processes each chunk sequentially, validates its completeness, and logs the results incrementally to Google Sheets.
The system never moves to the next batch until the current one is fully processed and validated. This ensures reliability without overwhelming system APIs.
4. Comprehensive Error Handling
Not all work orders can be closed. The system categorizes every single outcome clearly.
- ✅ Closed means it was successfully completed.
- ❌ Failed means a system error occurred, even after retries.
- ⚠️ Cannot Complete indicates missing data, like required crew notes.
- ❌ Rejected means the work order type is not supported for auto-closure.
- ❌ Invalid means the work order ID doesn’t exist.
Each status includes a user-friendly explanation, not technical jargon, so stakeholders understand the result.
5. Audit Trail with Google Sheets
Every work order processed is logged to a Google Sheet. The log includes the Work Order ID, its final status (e.g., Closed, Failed), and a detailed reason if it was not closed. This provides complete transparency and creates an easy-to-follow audit trail for handling exceptions.
The Implementation: From Concept to Production
Building this system required careful integration with the client’s existing tech stack.
System Integration
The agent needed to communicate with multiple systems. We built robust integrations with the company’s work order management system via its APIs.
We also integrated with the Google Sheets API for logging and the Microsoft Graph API for notifications and user management. This included proper authentication, error handling, and retry logic for each external endpoint.
Prompt Engineering
The heart of our AI agents lives in meticulously crafted prompts. These prompts define the exact API response structures and field names to expect. They lay out the step-by-step processing logic, including all validation checks.
The prompts also dictate error handling strategies, data transformation rules, and user communication guidelines. We iterated on these prompts multiple times, incorporating real-world API responses and edge cases found in testing.
Sequential Processing with Smythos
We used Smythos to implement a strictly sequential workflow. Each step must be completed fully before the next one begins. Validation gates prevent the process from continuing if an issue is detected.
Automatic retries are handled internally without causing user-facing delays. The system maintains state across all work orders. This sequential approach, combined with Smythos’s skill orchestration, ensures high reliability.
The Results: Time Saved, Accuracy Improved
The impact was immediate and dramatic. The time savings were the most obvious win. A process that took hours of manual work per batch now finishes in seconds. This redirected skilled staff to higher-value tasks.
Accuracy improved significantly. Manual entry errors were eliminated. The new system provides consistent, validated processing with a full audit trail, meaning zero work orders are lost or missed.
The system is also scalable. Previously, processing time grew linearly with work order volume. Now, the system handles 10 or 1,000 work orders with the same reliability.
Finally, it delivered transparency. Instead of limited visibility, the client has complete Google Sheets logs tracking every single work order. This makes auditing and exception handling simple.
Key Lessons Learned
This project taught us valuable lessons about building production-ready AI automation. These lessons made the difference between a system that merely works in testing and one that thrives under real-world pressure.
Lesson #1: Validation is critical, and you can never have too much.
Our multi-level validation strategy caught edge cases that would have broken a simpler system, preventing costly rollbacks and maintaining stakeholder trust. Without it, malformed data could have cascaded through the system, corrupting records and requiring manual intervention to clean up.
Lesson #2: User-friendly error messages are essential.
Stakeholders need clear explanations like “Unable to close this work order due to a system error,” not cryptic API error codes. When errors inevitably occur, transparent communication preserves confidence in the system rather than eroding it. Technical jargon creates panic; plain language creates understanding.
Lesson #3: Automatic retries are mandatory for production systems.
Network hiccups and transient API errors are inevitable; treating them as permanent failures would mean unnecessary manual work and frustrated users. Our retry logic turned what would have been dozens of failed operations into seamless successes.
Lesson #4: Smart batch chunking is key to processing large datasets reliably.
Processing 200 orders at once is fragile and creates an all-or-nothing scenario where a single failure can derail everything. Processing in batches of 20 with incremental logging proved robust, allowing us to recover gracefully from errors and resume exactly where we left off.
Lesson #5: Audit trails build trust and accountability.
The Google Sheet log gave stakeholders confidence that nothing was lost in the automation process. They could verify any action, trace any decision, and feel assured that the system was working as intended, turning what could have been a “black box” into a transparent, trustworthy tool.
Lesson #6: Finally, separation of concerns in our two-agent architecture made the system far easier to debug, test, and maintain.
By isolating data retrieval from business logic execution, we could troubleshoot issues faster, update components independently, and onboard new team members more easily. What seemed like added complexity upfront paid dividends in long-term maintainability.
Why Smythos Made the Difference
Building this system with traditional code would have been complex. We would have needed to write custom state management to track hundreds of work orders. We would manually implement retry logic for every API call and build an extensive error-handling framework.
Smythos enabled us to define complex agent behavior through natural language prompts. The platform handled the state management and orchestration automatically. This allowed our team to focus on the business logic, not the infrastructure. We could iterate rapidly based on real-world testing and deploy a production-ready system in a fraction of the time.
The Bottom Line
What started as a painful, manual process is now a seamless, automated workflow. The client’s team no longer dreads processing work orders. They simply upload a PDF and receive a complete Google Sheet report seconds later. This project showcases the power of well-designed AI agents to eliminate repetitive work, freeing humans to focus on what matters.Want to know more about how SmythOS can help your organization, like we were able to with this partner? Reach out to our team for more information. Want to get involved with the SmythOS community? Join us on Discord, check out our GitHub Repos, and help build the future of Agentic AI.
