How aravindanm20/coflowai works
CoFlowAi is a Python framework for running agents and workflows under deterministic execution controls. A developer defines an agent or workflow and submits it through the app; workflows are compiled before execution, then the runtime applies policy and state controls while coordinating model calls, tools, context, and approvals. Results can be streamed, checkpointed, resumed, replayed, or forked. The README documents distributed workers, durable stores, and observability; those branches are represented at subsystem level where implementation details were not sampled.
Main entry points: runtime.py Execution Runtime · app.py Application API · store.py State and Checkpoints · agent.py Agent
Components 24
Developer API
- Application API
coflowai/app.py - Agent
coflowai/agents/agent.py - Workflow
coflowai/workflows/workflow.py - Execution Result
coflowai/core/result.py
Execution Control
- Workflow Compiler
coflowai/workflows/compiler.py - Execution Runtime
coflowai/runtime/runtime.py - Policy and Budgets
coflowai/policies/policy.py - Execution Context
coflowai/core/context.py - Human Approval
coflowai/approvals/approval.py - Tool Execution
coflowai/tools/executor.py - Tool Registry
coflowai/tools/registry.py
Agent Reasoning
- Model Gateway
coflowai/models/gateway.py - Model Registry
coflowai/models/registry.py - Model Providers
coflowai/providers - Context Builder
coflowai/context/builder.py - Memory
coflowai/memory/base.py
Events and Durability
- Event Engine
coflowai/events/event.py - State and Checkpoints
coflowai/state/store.py - Persistence Adapters
coflowai/persistence/sqlite.py - Replay and Fork
coflowai/runtime/replay.py
Operations
- Observability
coflowai/observability/logger.py - Distributed Workers
coflowai/distributed/worker.py - Plugin Loading
coflowai/plugins/loader.py
Other components
- Developer / Caller
Connections 30
- Developer / Caller → Application API: submits execution
- Application API → Execution Runtime: runs executable
coflowai/app.py - Application API → Model Registry: configures models
coflowai/app.py - Application API → Tool Registry: configures tools
coflowai/app.py - Application API → State and Checkpoints: configures state
coflowai/app.py - Application API → Event Engine: configures events
coflowai/app.py - Workflow → Workflow Compiler: compiles graph
coflowai/workflows/workflow.py - Execution Runtime → Policy and Budgets: enforces limits
coflowai/runtime/runtime.py - Execution Runtime → Execution Context: creates context
coflowai/runtime/runtime.py - Execution Runtime → State and Checkpoints: saves checkpoints
coflowai/runtime/runtime.py - Execution Runtime → Event Engine: records execution
coflowai/runtime/runtime.py - Execution Runtime → Human Approval: handles decisions
coflowai/runtime/runtime.py - Execution Runtime → Execution Result: returns result
coflowai/runtime/runtime.py - Execution Runtime → Observability: emits telemetry
coflowai/runtime/runtime.py - Workflow → Human Approval: adds approval gate
coflowai/workflows/workflow.py - Agent → Context Builder: builds prompt context
coflowai/agents/agent.py - Agent → Model Gateway: requests model
- Agent → Tool Execution: dispatches tool calls
- Agent → Memory: uses memory
coflowai/agents/agent.py - Tool Execution → Tool Registry: resolves tools
coflowai/tools/executor.py - Model Gateway → Model Registry: resolves provider
coflowai/models/gateway.py - Model Gateway → Model Providers: calls adapter
- Execution Context → Policy and Budgets: checks budgets
coflowai/core/context.py - Execution Context → Event Engine: emits events
coflowai/core/context.py - State and Checkpoints → Persistence Adapters: persisted by adapters
coflowai/persistence/sqlite.py - Replay and Fork → State and Checkpoints: loads checkpoints
- Distributed Workers → Execution Runtime: executes jobs
coflowai/distributed/worker.py - Distributed Workers → State and Checkpoints: uses checkpoints
coflowai/distributed/worker.py - Application API → Plugin Loading: loads plugins
coflowai/app.py - Application API → Execution Result: returns execution
coflowai/app.py