Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(flows): add README for the flows module

Steven Enamakel765c6e553a20
diff --git a/crates/openhuman-core/src/flows/README.md b/crates/openhuman-core/src/flows/README.md
index ce590bef0f..b109680c9c 100644
--- a/crates/openhuman-core/src/flows/README.md
+++ b/crates/openhuman-core/src/flows/README.md
@@ -36,7 +36,7 @@ from always-compiled code.
## Public surface
- `pub mod ops` (split into submodules under `ops/`, e.g. `ops/execution.rs`, `ops/resume.rs`, `ops/builder.rs`, `ops/triggers.rs`, `ops/drafts.rs`, `ops/discovery.rs`, `ops/wiring_warnings.rs`, `ops/inference_readiness.rs`) — CRUD (`flows_create/get/list/update/delete/duplicate/import/validate`), revision history (`flows_get_history`, `flows_rollback`), run lifecycle (`flows_run`, `flows_run_detached`, `flows_resume`, `flows_cancel_run`, `flows_list_runs`, `flows_list_all_runs`, `flows_get_run`, `flows_prune_runs`), `flows_set_enabled` (only `schedule` triggers need an enable-time binding — `cron::add_flow_schedule_job` / `cron::remove_job`; `app_event` flows are matched at dispatch time against enabled flows, and `webhook` binding is logged as not implemented), builder (`flows_build`, `flows_build_cancel`, `flows_search_tool_catalog`, `flows_get_tool_contract`, `flows_list_connections`, `flows_required_connections`, `flows_approval_manifest`), discovery (`flows_discover`, `flows_list_suggestions`, `flows_dismiss_suggestion`, `flows_mark_suggestion_built`), drafts (`flows_draft_create/get/update/list/delete/promote`), and boot/periodic reconciliation (`sweep_orphaned_running_runs_on_boot`, `reconcile_schedule_triggers_on_boot`, `sweep_expired_parked_runs`).
-- `pub mod bus` (split `bus_part_01..02.rs`) — three subscribers, all constructed in `core/jsonrpc.rs`: `FlowTriggerSubscriber` (the trigger → run bridge: `DomainEvent::FlowScheduleTick` and `ComposioTriggerReceived` are matched against enabled flows' trigger nodes and spawn `ops::flows_run`; `WebhookIncomingRequest` is observed and logged only — webhook dispatch is not implemented), `FlowRunDigestSubscriber` (on a successful `FlowRunFinished`, writes a run digest into the flow's private memory namespace), and `DedupCommitSubscriber` (on `FlowRunFinished`, commits or rolls back every `dedup` node's tentative key set). `extract_trigger_kind` / `extract_trigger_config` are reused by `ops` to decide what `flows_set_enabled` and `flows_update` must bind or rebind.
+- `pub mod bus` (split into `bus/trigger.rs`, `bus/run_digest.rs`, `bus/dedup_commit.rs`) — three subscribers, all constructed in `core/jsonrpc.rs`: `FlowTriggerSubscriber` (the trigger → run bridge: `DomainEvent::FlowScheduleTick` and `ComposioTriggerReceived` are matched against enabled flows' trigger nodes and spawn `ops::flows_run`; `WebhookIncomingRequest` is observed and logged only — webhook dispatch is not implemented), `FlowRunDigestSubscriber` (on a successful `FlowRunFinished`, writes a run digest into the flow's private memory namespace), and `DedupCommitSubscriber` (on `FlowRunFinished`, commits or rolls back every `dedup` node's tentative key set). `extract_trigger_kind` / `extract_trigger_config` are reused by `ops` to decide what `flows_set_enabled` and `flows_update` must bind or rebind.
- `pub mod medulla_bridge` — backs the medulla harness protocol's workflow plane (`platform::socket::medulla::workflows::WorkflowBridge`) with this store: projects saved `Flow`s onto the wire `WorkflowDescriptor`, serves the three read RPCs, and runs a `workflow_builder` copilot turn with host-enforced approval guards (creates always `require_approval: true`, updates never lower it, automatic-trigger creates are saved disabled).
- `pub mod catalogue` — lists saved flows as `Workflow` entries with `WorkflowScope::Flow` in the shared skill catalogue, so `skill_search` sees one list instead of skills and flows separately.
- `pub mod node_contracts` — host overlay on `tinyflows::catalog`'s node-kind contracts: attaches host-specific facts (which `tool_call` slugs resolve to Composio vs. native `oh:` tools, which trigger kinds actually dispatch here) without touching the portable contracts. Re-exports `all_node_kind_contracts`, `node_kind_contract`, `NODE_KINDS`, `ConfigField`, `PortSpec`, `NodeKindContract`.