A workflow is a tool
A compiled pipeline deploys as an MCP tool, so the next agent that meets the same case calls a deterministic fix instead of reasoning again.
The situation
An agent fixed an edge case once by calling three tools in sequence: rotate, extract, validate. The next time the same case appears, it should not spend tokens rediscovering the sequence.
The recipe
Once the sequence is compiled into a YAML pipeline and activated, the mcp-workflows-longtail server offers it as a tool. An agent checks for a compiled solution first:
{ "status": "active" }{ "workflow_name": "rotate-and-extract", "input": { "document": "page1_upside_down.png", "rotation": 180 }, "async": false}get_workflow returns a pipeline’s input schema and activity manifest. With async: false the call waits for the result (default limit 120000 ms); with async: true it returns a job_id. Only pipelines in active status run.
The cycle that produces these tools:
- A workflow calls tools as durable activities.
- It escalates when confidence is low.
- A triage agent calls the same tools dynamically to fix the case.
- The successful sequence compiles into a deterministic pipeline.
- The pipeline becomes a tool, and the next run takes the direct path.
The guarantee
A compiled pipeline is deterministic tool-to-tool data piping: no model call, no token cost, the same steps every run. It inherits the invoking workflow’s principal and credentials through the DAG. See MCP.
Related patterns
Agents and MCP
Tools as durable activities
Register an MCP server and its tools become checkpointed workflow activities: retried on failure, replayed from cache after a crash.
Agents and MCP
Tag-based tool discovery
Tag a server when you register it and every tag-scoped agent run picks up its tools, with no workflow code naming the server.
Agents and MCP
Read-safe workflows
Mark a side-effect-free workflow read-safe and read-scoped keys can run it, while every other workflow stays out of their reach.
The escalation boundary
Human flags, AI remediates
A reviewer who cannot fix the input marks it for triage, and a tool-calling workflow repairs it and runs the original step again.
