How discordcreater/trase-project works
wfk is a small durable Python workflow engine, demonstrated by document triage. A caller starts or resumes a spec through the CLI; the engine orders ingest, extract, classify, and notify, persisting transitions and outputs so interrupted work can resume. Tools perform document processing, classification records its decision, and notification uses an effects ledger plus an idempotency-aware receiver. Operators can inspect status and event history or replay the log to check stored state. Edges reflect README statements and shown calls; internal store details and some engine control paths are only partially excerpted.
Main entry points: engine.py Execution engine · cli.py CLI commands · store.py SQLite store · faults.py Fault wrappers
Components 14
Invocation
- CLI commands
wfk/cli.py
Workflow Runtime
- Workflow specs
wfk/spec.py - Execution engine
wfk/engine.py - Fault wrappers
wfk/faults.py
Triage Work
- Ingest document
wfk/tools.py - Extract text
wfk/tools.py - Classify document
wfk/tools.py - Send notification
wfk/tools.py - File notifier
wfk/tools.py
Durable State
- SQLite store
wfk/store.py - Effect ledger
wfk/store.py - Append-only events
wfk/store.py - Replay checker
wfk/engine.py
Other components
- Operator
Connections 26
- Operator → CLI commands: invokes
README.md - CLI commands → Execution engine: builds and calls
wfk/cli.py - CLI commands → Workflow specs: loads spec
wfk/cli.py - CLI commands → Fault wrappers: configures
wfk/cli.py - CLI commands → SQLite store: opens
README.md - Execution engine → Workflow specs: reads
wfk/engine.py - Execution engine → SQLite store: reads and writes
wfk/engine.py - Execution engine → Ingest document: dispatches
README.md - Execution engine → Extract text: dispatches
README.md - Execution engine → Classify document: dispatches
README.md - Execution engine → Send notification: dispatches
README.md - Ingest document → Extract text: passes output
README.md - Extract text → Classify document: passes output
README.md - Classify document → Send notification: passes output
README.md - Classify document → Execution engine: records decision
wfk/engine.py - Send notification → Execution engine: runs effect
wfk/engine.py - Execution engine → Effect ledger: claims and records
README.md - Execution engine → File notifier: sends keyed effect
README.md - File notifier → Effect ledger: deduplication outcome
README.md - SQLite store → Append-only events: appends transitions
README.md - CLI commands → SQLite store: reads status and history
wfk/cli.py - CLI commands → Replay checker: requests replay
wfk/cli.py - Replay checker → SQLite store: compares rebuilt state
wfk/engine.py - Fault wrappers → Ingest document: wraps tools
wfk/faults.py - Fault wrappers → File notifier: wraps sink
wfk/faults.py - Fault wrappers → SQLite store: crashes after commit
wfk/faults.py