A production-style AI agent workflow engine that converts natural-language ERP tasks into executable browser automations with full audit trails, screenshots, and failure recovery.
Type a task in plain English, and the Agent will:
- Understand your intent (create customer, search order, export report...)
- Plan a step-by-step workflow
- Execute via Playwright on a real web app
- Record every step with screenshots and logs
- Retry on failure and report results
Demo Task:
workflow-agent run "Create a new customer named Acme Corp with contact Alice, email alice@acme.com, and region APAC."Output:
Task ID: task_a3f7d2e1
Status: success β
Steps: 4
- open_customer_page β success (320ms)
- fill_customer_form β success (810ms)
- submit_form β success (450ms)
- verify_customer_created β success (200ms)
Screenshots: 8 artifacts captured
Artifacts: artifacts/task_a3f7d2e1/
git clone https://github.com/13331800076/ai-agent-workflow-automation.git
cd ai-agent-workflow-automation
make install # pip install + playwright browser
make test # run 28 tests to verify
make cli-demo # run a live demo taskdocker-compose up -d
curl -X POST http://localhost:8000/tasks/run \
-H "Content-Type: application/json" \
-d '{"user_input": "Find order PO-1001"}'| MiniERP Dashboard | Agent Execution Trace | Task Artifacts |
|---|---|---|
![]() |
![]() |
![]() |
(Placeholder β run make cli-demo to generate your own screenshots)
User Task
β
Task Parser (Intent + Entities)
β
Workflow Planner (Step-by-Step Plan)
β
Tool Router β Playwright Executor
β
MiniERP Web App (Real Browser Automation)
β
Execution Logger + Screenshot Recorder
β
Retry Handler / Failure Recovery
β
Final Report + Artifacts
Why this matters: Most AI agent demos are "LLM β Browser" black boxes. This project shows structured, testable, auditable agent engineering.
| Feature | Description |
|---|---|
| π― Task Parsing | Rule-based NLU (v1) + extensible for LLM (v2) |
| π Workflow Planning | Fixed per-intent plans that are deterministic and testable |
| π οΈ Tool Calling | 5 enterprise tools: customer, order, report, form, field-diff |
| π Playwright Execution | Headless browser automation with stable data-testid selectors |
| πΈ Screenshot Audit | Before/after/failure screenshots for every step |
| π Structured Logs | Per-task JSON audit trail: plan.json, execution.log, result.json |
| π Retry & Recovery | Automatic retry on element-not-found and download failures |
| π§ͺ Tested | 28 tests: unit, integration, E2E Playwright |
| π³ Docker Ready | docker-compose up and go |
| π₯οΈ CLI + API | workflow-agent CLI + FastAPI REST endpoints |
This project is a reference implementation for anyone building:
- AI Agent platforms that need structured execution + observability
- RPA / Automation tools with natural language interfaces
- ERP/CRM automation with audit trails for compliance
- Test automation frameworks that need visual traceability
- LLM application engineering portfolios for job interviews
| Layer | Technology |
|---|---|
| Web App | FastAPI + Jinja2 + SQLite |
| Agent Engine | Python 3.11+ + Pydantic |
| Browser Automation | Playwright (async) |
| Testing | pytest + pytest-asyncio + pytest-playwright |
| Quality | ruff + mypy |
| CI/CD | GitHub Actions |
| Deployment | Docker + Docker Compose |
# 1. Create a customer
workflow-agent run "Create a new customer named Acme Corp with contact Alice, email alice@acme.com, and region APAC."
# 2. Search an order
workflow-agent run "Find order PO-1001 and summarize its status."
# 3. Export a report
workflow-agent run "Export the monthly sales report for May 2026."
# 4. Verify field values
workflow-agent run "Check whether customer Acme Corp has the expected region APAC and contact Alice."
# 5. Fill a form
workflow-agent run "Fill in the supplier onboarding form with company Acme Corp, tax ID TX-2026-001, region APAC."# Health check
curl http://localhost:8000/health
# Run a task
curl -X POST http://localhost:8000/tasks/run \
-H "Content-Type: application/json" \
-d '{"user_input": "Find order PO-1001"}'
# Get task result
curl http://localhost:8000/tasks/{task_id}
# Get task artifacts (screenshots + logs)
curl http://localhost:8000/tasks/{task_id}/artifactsEvery task generates a complete audit trail:
artifacts/task_a3f7d2e1/
βββ task.json # Task metadata
βββ plan.json # Generated workflow plan
βββ execution.log # Step-by-step log with timestamps
βββ result.json # Final result summary
βββ screenshots/
βββ 01_open_customer_page_before.png
βββ 02_open_customer_page_after.png
βββ 03_fill_customer_form_before.png
βββ 04_fill_customer_form_after.png
βββ ...
- v1.0: Rule-based parser + fixed workflow planner + Playwright tools + audit logs
- v1.1: LLM-powered parser for flexible natural language
- v1.2: LangGraph / LangChain integration for dynamic planning
- v1.3: Attachment upload and approval workflow tools
- v1.4: Configurable selectors (support multiple ERP systems)
- v1.5: Web dashboard for viewing execution traces
- v1.6: Batch task execution from CSV/JSON
- v2.0: Cloud deployment with task queue (Redis + Celery)
See CONTRIBUTING.md for guidelines.
Quick start for contributors:
make install # setup
make test # verify everything works
make lint # code style
make type # type checkingMIT License β see LICENSE for details.
If this project helps you, please consider giving it a star! It motivates continued development and signals to the community that this is a useful reference.
Built as a practical reference for AI Agent Engineer / Applied AI Engineer roles. Inspired by real-world needs for testable, auditable, and recoverable agent automation.
Not just a chatbot. A workflow engine.


