guide
guide8 min read

How we're orchestrating Cost, Usage Intelligence and Pipeline agents together

Who detects, who decides, who acts, and where a human signs off when three agents share one job

Orchestrating Cost, Usage Intelligence and Pipeline agents together works when each agent owns exactly one verb: the Usage Intelligence Agent detects what nobody queries, the Cost Agent decides what is worth changing, and the Pipeline Agent acts on the pipelines that produce the waste. The raw material for the detection step already exists in most warehouses; Snowflake, for example, records which objects each query touched in its ACCESS_HISTORY view. What is usually missing is the chain of custody between finding a cold table and safely stopping the job that builds it.

Key Takeaways

  • •One job, three verbs: Usage Intelligence detects, Cost decides, Pipeline acts. No agent does two of the three.
  • •Every handoff carries a structured payload (table, evidence window, dollar estimate, downstream consumers), not a chat summary.
  • •Reads are autonomous; writes sit behind an approval point whose strictness you set per domain.
  • •Each agent fails closed: if one is unavailable, the chain stops and reports, it never skips ahead.
  • •The Orchestration Agent coordinates the sequence, but it holds no domain logic of its own.

Why orchestrating Cost, Usage Intelligence and Pipeline agents together beats running them one at a time

The shared job is simple to state: find warehouse spend that serves no consumer, prove it, and remove it without breaking anything downstream. Each half of that job is something a single tool does today. Cost dashboards show where credits go. Query-history reports show which tables are cold. Orchestrators and transformation tools show which job builds which table. The engineer then joins those three views in their head, usually in a ticket, usually a week later.

In our opinion that human join is the expensive part. A cost report that says a warehouse is oversized does not say whether the nightly job feeding it is still needed. A cold-table list does not say what it costs to keep refreshing. And a pipeline tool can pause a job but has no idea whether anyone reads the output. Three agents that share context close the loop, and since every Data Workers agent is an MCP server, an engineer can drive the whole chain from Claude Code or Cursor with questions like "What tables haven't been queried in 90 days?" and "How much are we spending on Snowflake this month?"

Who detects, who decides, who acts

We split the roles by the kind of evidence each agent is allowed to produce. This keeps the audit trail legible: when something is removed, you can point to which agent claimed what.

The Usage Intelligence Agent detects. It reads who queried what across the warehouse, scores tables hot or cold, and nominates deprecation candidates. It makes a factual claim only: "no query has read this table in the evidence window, and these objects depend on it." It does not mention money and it does not propose action.

The Cost Agent decides. It takes the candidate list and prices it: storage held, compute spent refreshing it, and the share of a warehouse's spend it represents. It also runs its own detection on things usage data cannot see, such as idle warehouses and oversized compute, across Snowflake, BigQuery and Databricks. Its output is a ranked recommendation with an estimated saving and a proposed change. Deciding here means ranking and recommending; the approval point below is where a human or policy confirms.

The Pipeline Agent acts. It owns the jobs across Airflow, Dagster, Prefect, dbt and Fivetran, so it is the only agent that can pause a schedule, drop a model from a dbt project, or stop a connector sync. It receives an approved change, applies it, and reports back what it touched.

Sitting above all three, the Orchestration Agent sequences the work and routes each payload. We kept it deliberately thin: it knows the order of the handoffs and the approval policy, and nothing about warehouses or DAGs.

The handoff table

Each row is one handoff. The context column is the contract: if a field is missing, the receiving agent rejects the payload rather than guessing.

HandoffFrom → ToContext passedApproval point
1. NominateUsage Intelligence → CostTable or warehouse, evidence window, last query time, distinct users, downstream dependentsNone (read-only)
2. PriceCost → OrchestrationEstimated storage and compute saved, confidence, proposed change type (pause, resize, drop, reduce frequency)None (read-only)
3. AuthorizeOrchestration → human or policyRanked change list, evidence from step 1, saving from step 2, blast radiusRequired for writes in Pro; set per domain
4. ExecuteOrchestration → PipelineApproved change, target job and tool, rollback instructionsInherited from step 3
5. VerifyPipeline → Usage Intelligence and CostObjects changed, run IDs, timestampNone (read-only)
6. Close outCost → OrchestrationRealized versus estimated saving, any new consumer seen after the changeNone (read-only)

Step 5 is the one teams skip when they wire this up by hand. After the Pipeline Agent acts, Usage Intelligence watches for a query against the removed or paused object, and Cost compares the real bill against its estimate. If a new reader appears, the chain flags it immediately instead of waiting for a stakeholder to complain.

What a single run looks like

Here is a concrete walk-through. An engineer asks from the terminal: "What tables haven't been queried in 90 days, and what would it save to stop building them?"

  • •Usage Intelligence returns forty candidate tables with their last query time and dependents. Thirty-one have no dependents; nine feed views that are themselves unread.
  • •Cost prices each one. Most are small, but three are refreshed hourly on a large warehouse. Those three lead the ranked list; the rest are batched.
  • •The Orchestration Agent presents the list. Because the domain is set to "approve every write," it stops and waits.
  • •The engineer approves the three hourly refreshes and rejects one table they know a quarterly report needs.
  • •The Pipeline Agent pauses the schedules for the two approved jobs and removes the third from the dbt project, recording rollback steps for each.
  • •Usage Intelligence and Cost watch the following weeks and report whether any reader appeared and what the bill actually did.

Note that the rejected table teaches the chain something. Rejections are recorded with the reason, so the next nomination pass can suppress that table or lengthen its evidence window. We covered how Data Workers keeps this kind of context current in a separate post on our context layer, and the same store backs the rejection memory here.

Approval points and the autonomy dial

Reads never need approval, and the open-source edition (dw-claw, Apache 2.0) is read-only by default, so steps 1, 2, 5 and 6 can run on a laptop with no risk to production. Writes arrive with Pro, which adds approval workflows and audit trails. The only mandatory write checkpoint is step 3.

What we do not hard-code is how strict that checkpoint is. Our Autonomous Data Conductor exposes a per-domain autonomy dial. A team might leave production marts on "approve every change," move a sandbox warehouse to "auto-apply and notify," and keep anything touching PII on manual review. The dial is a policy the Orchestration Agent reads, not a different code path, so turning it up later does not require re-plumbing the chain.

Two guardrails hold regardless of the dial. First, any change with a non-empty downstream consumer list is escalated to a human. Second, every executed change carries rollback instructions captured before the write, not reconstructed after.

What happens when one agent fails

We design for failure at each node, because a multi-agent chain that fails open is worse than a human with a spreadsheet. The rule is the same everywhere: stop, say where, and never substitute a guess.

Agent failsWhat the chain doesWhy
Usage Intelligence unavailable or query history incompleteHalts before step 1 and reports the gapWithout evidence of non-use, any deprecation is a guess
Cost Agent unavailableReturns the usage candidates unpriced and takes no actionThe list is still useful to a human; execution waits for a decision
Pipeline Agent fails mid-changeStops, reports objects already touched, and runs the captured rollback if the change is half-appliedA partial change leaves pipelines in an unknown state
Orchestration Agent unavailableEach agent can still be invoked directly over MCPThe domain agents do not depend on the coordinator to answer questions

Because the agents are independent MCP servers, the last row matters in practice: an outage in the coordinator degrades the system to three useful tools, not to nothing. You can read more about the protocol itself in the MCP specification.

What this does not do

We should be clear about limits. Usage evidence is only as good as the query history the warehouse retains; a table read once a year for an audit will look cold in a 90-day window, which is why the evidence window and the rejection memory exist. Cost estimates are estimates until step 6 compares them with the bill. And none of this replaces a data owner's judgment on tables with regulatory retention. The chain makes the evidence cheap to assemble; it does not make the decision for you.

Frequently Asked Questions

Can the Cost Agent act on its own findings without the Usage Intelligence Agent? Yes. Idle warehouses and oversized compute are visible from billing and warehouse metrics alone, and the Cost Agent can recommend a resize directly. The handoff from Usage Intelligence matters when the question is whether a table or job should exist at all, because that requires evidence of who reads it.

Which agent should be allowed to write to production? Only the Pipeline Agent. Keeping writes in one agent means one audit trail, one place to enforce approvals, and one place to attach rollback instructions. Detection and pricing stay read-only.

Do we need the Orchestration Agent to run this? No. You can invoke each agent from Claude Code or Cursor and pass the payloads yourself. The Orchestration Agent automates the sequencing, applies the approval policy consistently, and records the run, which becomes valuable once the chain runs on a schedule instead of on demand.

What happens if a deprecated table turns out to be needed? Step 5 watches for new reads on anything changed. If a query hits a paused or removed object, the chain flags it and offers the rollback captured before the change. The Pipeline Agent can restore the schedule or model, and the rejection is recorded so that table is not nominated again without new evidence.

Is this safe to try on a production warehouse? The open-source edition is read-only by default, so you can run detection and pricing against production without any write path existing. Execution is a Pro feature gated by approval workflows.

If you want to see the chain on your own warehouse, start with read-only mode and ask the terminal which tables nobody has queried in 90 days. The Usage Intelligence and Cost handoffs run end to end without touching a single pipeline.