Skip to content

Plan and apply by hand

Every Turf™ run is the same loop. A start verb stops at the round’s plan gate; plan plans the round and stops at its approval point; apply with the plan’s digest approves and applies that plan. At the approval point you can also decline the plan, and at any stage you can cancel the run.

✦Your agentin Claude Code
You
Plan kind-crd, but don’t apply anything yet.
Agent
  • up→awaiting_plan
  • plan→awaiting_approval

Plan: 1 to add, 2 deferred to a later round.

+ kind_cluster.demo
name: turf-crd-demo-1
node_image: kindest/node:v1.29.7

The CRD and the custom resource wait for the cluster’s endpoint and plan in later rounds. The plan is waiting at its approval point; nothing is applied until you say so.

You
Decline it. I want a newer node image first.
Agent
  • apply (decline)→declined

Declined: nothing was applied, and the workspace is free. Give me the image and I’ll plan again with it as node_image.

TOOL RESULTapply→declined
convergence_id: "…" kind: up ended: true
outcome: declined
rounds: [ { round: 1, status: "cancelled", planned: 3, deferred: 2, applied: 0 } ]

illustrative · the shape of a session, not a transcript

Ask for the step you want, in words:

  • “Plan it, but don’t apply” stops at the approval point and shows you the plan.
  • “Apply it” approves that plan. The agent calls apply with the plan’s digest.
  • “No” or “decline it” declines the plan. Nothing of it is applied.
  • “Cancel the run” ends it wherever it stands.

The agent presents each plan in the same shape /turf:up uses and asks “Ready to apply these changes?” for anything that is not low-risk. It never resends an old digest: if the run now waits on another plan, it reads that plan and asks again.

The plan gate. up, destroy, refresh, import and invoke each start a convergence and stop at round 1’s plan gate (awaiting_plan), with nothing planned. Each apply that leaves work deferred stops at the next round’s plan gate.

plan plans the round and stops at its approval point (awaiting_approval). The result carries the plan’s counts, its resource (plan.uri: the OpenTofu® JSON plan, as tofu show -json prints it, sensitive values redacted) and its digest (plan.digest). show reads the document. refresh, replace, refresh_addresses and refresh_drift are that round’s options alone. A round with nothing to apply needs no approval: plan runs it through to the next plan gate or the end.

apply with the digest is the approval, of that plan and no other. A digest of any other plan is refused, and nothing is applied. The apply stops at the next round’s plan gate, at a turf action (awaiting_actions), or at the run’s end.

Decline with apply and decline: true (and a reason, recorded on the round). Nothing of the plan is applied, the run ends declined, and the workspace is free. Calling neither apply nor decline leaves the paused run holding the state lock.

Cancel with cancel and a cause. It names the run by its workspace (workspace_alias), never by a convergence_id, and works at any stage. What is in flight finishes, nothing new starts, and the run ends cancelled. A cancel still finishing at the server’s deadline returns with cancelling: true; apply with the run’s convergence_id follows it to its end.

The server’s deadline. Every call returns within it. A long plan or apply comes back planning or applying with ended: false: the run goes on in the engine, and next names the call that follows it.

rounds[].approval records how each round’s plan came to be applied: asked, unneeded (nothing to consent to) or planfile.

plan:

Argument Meaning
convergence_id The run, from any of its results. Omit it to name the run by its workspace.
workspace_alias Without convergence_id: the workspace whose run to plan. Omit it for the default.
refresh Read each managed object first (default true); false plans against the state as recorded. This round only.
replace Addresses to replace in this round, as tofu plan -replace. An up’s plan only.
refresh_addresses Managed resource instance addresses this round reads before planning. Every other row plans from its record, and one that then plans a change is read and planned again. An up’s plan only, never with refresh: false. This round only.
refresh_drift true reads what the workspace’s open drift notices name; with refresh_addresses, both sets. With nothing open the round reads every object. An up’s plan only, never with refresh: false. This round only. When notices are open, the note at an up’s first plan gate names it.

With either of the last two, the result carries refresh_scope: what was read, and as skipped how many rows were planned unread. See A scoped refresh.

apply:

Argument Meaning
convergence_id The run that vended the plan or listed the turf actions. To approve or pick up a run it may be omitted for the workspace it holds; decline and action_results need it.
workspace_alias Without convergence_id: the workspace whose run to continue.
plan_digest plan.digest from the result that vended the plan: the plan you approve.
decline At awaiting_approval: decline instead. Never with plan_digest or action_results.
reason With decline: why, recorded on the round.
action_results At awaiting_actions: a result for every open request, by key. See Answering a turf action.
planfile Apply a planfile instead, with its digest. See Plan now, apply later.

With no digest, no decline and no results, apply answers nothing: a run waiting at a plan gate or an approval point is handed back as it stands, and one planning or applying is followed.

cancel:

Argument Meaning
workspace_alias The workspace whose run to stop. Omit it for the default.
cause Why, recorded on the run.

Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.

© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub