Pipeline Handoff (Inter-Agent State)
pipeline_handoffWrite and read structured data across pipeline phases to coordinate multi-step workflows.
Instructions
Structured inter-agent communication for pipeline workflows.
USE WHEN: Orchestrators need to exchange structured data between pipeline phases. Each phase writes its output; the next phase reads it. All data persists in .cortex/.session/{id}/{pipeline}/.
WORKFLOW (simplified):
pipeline_handoff(operation="init", pipeline="commit")
pipeline_handoff(operation="write", pipeline="commit", phase="preflight", data='{"status":"complete","snapshot_ref":"abc123"}')
pipeline_handoff(operation="read", pipeline="commit", phase="preflight") → reads phase data
pipeline_handoff(operation="read", pipeline="commit") → reads full pipeline state (all phases)
pipeline_handoff(operation="clear", pipeline="commit")
EXAMPLES:
pipeline_handoff(operation="init", pipeline="commit")
pipeline_handoff(operation="write", pipeline="commit", phase="checks", data='{"status":"passed","coverage":0.94}')
pipeline_handoff(operation="read", pipeline="commit", phase="checks")
pipeline_handoff(operation="read", pipeline="commit")
pipeline_handoff(operation="clear", pipeline="commit")
Legacy aliases (write_task, read_task, write_result, read_state) still work.
RETURNS: JSON with {status, ...} for write ops; JSON file content for reads.
Args:
operation: init | write | read | read_log | status | mark_running
| clear | snapshot | rollback
(legacy: write_task, read_task,
write_result, read_state)
pipeline: Pipeline name (e.g. "commit", "implement"). Default: "default".
phase: Phase name (e.g. "preflight", "checks"). Required for write.
For read: if given, reads that phase; if omitted, reads full state.
data: Payload for write and init. Accepts JSON string or native object.
When the JSON includes free-text fields such as context or
summary, write compact technical prose (see cortex://rules,
Agent-Internal Communication): no filler or hedging; keep file
paths and error messages verbatim.
paths: Paths to snapshot for operation="snapshot". Can be passed via
this argument or via data={"paths":[...]} for arg-stripping clients.
snapshot_id: Snapshot id for operation="rollback". Can be passed via
this argument or via data={"snapshot_id":"..."}.
ctx: MCP context (auto-provided).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| paths | No | ||
| phase | No | ||
| pipeline | No | default | |
| operation | No | read_state | |
| snapshot_id | No |