Learn. Suggest. Automate. A self-learning workflow engine that observes your work, recognizes patterns, and progressively automates routine tasks — starting with end-to-end global export operations.
┌──────────────────────────────────────────────────────┐
│ UNIVERSAL WORKFLOW ENGINE │
│ (Pattern Learning · Intent Routing · Autonomy) │
├──────────────────────────────────────────────────────┤
│ EXPORT DOMAIN LAYER │
│ (Orders · Documents · Compliance · Incoterms) │
├──────────────────────────────────────────────────────┤
│ COUNTRY RULE PLUGINS │
│ (54 Africa + EU + Asia + Americas) │
└──────────────────────────────────────────────────────┘
| Level | Mode | Description |
|---|---|---|
| 1 | Observer | Logs every action, builds event history |
| 2 | Advisor | Detects patterns, suggests next steps |
| 3 | Semi-Auto | Prepares & executes with approval |
| 4 | Autonomous | Runs routine workflows, humans handle exceptions |
# Clone & setup
git clone https://github.com/your-org/workflow-engine.git
cd workflow-engine
chmod +x scripts/setup.sh
./scripts/setup.sh
# Run
python -m api.mainworkflow-engine/
├── core/ # Universal workflow engine
│ ├── engine.py # Main orchestrator
│ ├── router.py # Intent classification & routing
│ ├── models.py # Base data models
│ ├── observer.py # Action logging & event capture
│ ├── autonomy.py # Autonomy level management
│ └── scheduler.py # Step scheduling & dependency resolution
├── domain/
│ └── export/ # Export-specific domain logic
│ ├── models.py # ExportOrder, Document, Shipment
│ ├── workflows.py # Standard export workflow templates
│ ├── documents.py # Document generation engine
│ ├── compliance.py # Sanctions, restrictions, validations
│ ├── incoterms.py # Incoterm rules & obligations
│ ├── dangerous_goods.py # IATA DGR / IMO IMDG logic
│ └── transport.py # Sea/Air/Road transport logic
├── plugins/
│ └── countries/ # Country-specific rule plugins
│ ├── base.py # CountryPlugin base class
│ ├── registry.py # Plugin loader & registry
│ ├── ng.py # Nigeria
│ ├── cm.py # Cameroon
│ ├── eg.py # Egypt
│ ├── gh.py # Ghana
│ ├── ke.py # Kenya
│ ├── za.py # South Africa
│ ├── tg.py # Togo
│ ├── sn.py # Senegal
│ ├── ci.py # Côte d'Ivoire
│ ├── tz.py # Tanzania
│ ├── ma.py # Morocco
│ ├── dz.py # Algeria
│ ├── et.py # Ethiopia
│ ├── de_export.py # Germany (export side)
│ └── generic.py # Fallback for uncovered countries
├── learning/ # ML & pattern recognition
│ ├── pattern_detector.py # Sequence mining & pattern extraction
│ ├── workflow_learner.py # Learns from completed workflows
│ ├── feedback_loop.py # Approval/rejection tracking
│ └── predictor.py # Next-step prediction
├── storage/ # Persistence layer
│ ├── event_store.py # Event sourcing
│ ├── pattern_store.py # Learned patterns
│ └── vector_store.py # ChromaDB integration
├── api/ # FastAPI REST interface
│ ├── main.py # App entry point
│ ├── routes/
│ │ ├── orders.py # Export order endpoints
│ │ ├── workflows.py # Workflow management
│ │ ├── plugins.py # Country plugin info
│ │ ├── learning.py # Learning & pattern endpoints
│ │ └── dashboard.py # Dashboard data endpoints
│ └── middleware.py # Auth, logging, CORS
├── config/
│ ├── settings.py # Global settings
│ └── constants.py # Enums, static data
├── scripts/
│ ├── setup.sh # One-click setup
│ └── seed_data.py # Seed sample data
├── tests/ # Test suite
│ ├── test_engine.py
│ ├── test_plugins.py
│ └── test_workflows.py
└── requirements.txt
Full plugin support with ECTN/BESC, SONCAP, PVoC, CargoX eBL, and country-specific compliance matrices.
Germany (ATLAS/GTS), with extensible plugins for other EU origins.
Generic plugin handles basic export requirements. Add specific plugins as needed.
These always require human approval:
- Financial transactions (bank documents, LC)
- Customs submissions (ATLAS, destination customs)
- Sanctions-related decisions
- Payment releases
Each country is a single Python file implementing CountryPlugin. Adding a new country = adding one file. No engine changes needed.
The system logs every action sequence from completed exports. After observing enough repetitions (configurable, default: 5), it builds predictive models for similar future orders.
MIT