| description | Current guide to apflow feature specifications, capability groups, and recommended reading paths. |
|---|
This section contains implementation-oriented feature specifications for apflow. They explain why major capabilities exist, which modules they touch, and which tests cover important behavior.
Use these pages as design and maintenance context. For end-user workflow documentation, start with Task Orchestration, REST / HTTP API, and Built-in Scheduler.
apflow capabilities are registered once in the apcore Registry and exposed through multiple protocol faces:
- apcore Bridge describes module registration and protocol reuse.
- MCP and A2A operations provides discovery and invocation examples, embedded server adapters, approval behavior, and accounting precision constraints for Run, budget, and usage modules.
- REST / HTTP API describes the registry-driven REST/OpenAPI surface, unified server, streaming, auth, webhook trigger, and scheduler integration.
- Function Executor describes the decorator path for turning Python functions into executable apflow modules.
The execution model is built around task trees, dependency DAGs, reusable workflows, and scheduled run instances:
-
Runs, retries, and accounting explains immutable accepted Runs, retry scope, result reuse, and usage history.
-
Durable submission and recovery provides API/CLI steps for creation receipts, dispatch, and new retry Runs.
-
Public budget and usage operations covers shared token scopes, evidence, event delivery, and consumer acknowledgements.
-
TaskCreator Relaxation explains multi-root task forests and why
create_task_tree_from_array()allows them. -
Built-in Scheduler explains the direct-DB poll loop, schedule modules, webhook triggers, distributed dispatch-only mode, and run history.
Durability and budget controls live in the execution path, so they apply whether tasks are invoked by Python, CLI, REST, MCP, A2A, or the scheduler:
- Durable Execution covers checkpoint/resume, retry, and circuit breaker behavior.
- Cost Governance covers token budgets, policy evaluation, downgrade chains, and usage reporting.
These pages explain the current persistence baseline and the v2 slimming work that shaped the repository:
- Storage Migration documents the move to SQLite as the embedded default and PostgreSQL for distributed deployments.
- Project Slimming documents removal of obsolete v1 layers and the shift to apcore protocol adapters.
For a new operator:
For an integrator building executors or protocol surfaces:
For a maintainer working on execution semantics:
- Task execution path:
TaskExecutorandTaskManagerare shared by REST, MCP, A2A, CLI, scheduler, and Python callers. Execution behavior should be changed once in the shared path rather than reimplemented per protocol. - Structure tree vs execution DAG:
parent_idis the organization and reuse tree;dependenciesis the execution-order DAG. These are intentionally separate concepts. - Durability and governance: Checkpoint/retry/circuit breaker and budget/policy enforcement both attach to task execution. Changes in one area should be tested against the other.
- Storage backends: SQLite is the zero-config embedded default. PostgreSQL is required for distributed worker coordination.
- Docs status: Feature specs are implementation context, not the sole source
of current user-facing behavior. Keep guides, architecture pages,
llms.txt, and README aligned when feature specs change.