Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run Lifecycle

A run (a job in the API) is one execution of a template against a workspace. It starts from the UI, a VCS webhook, a schedule, a run trigger, the CLI or the API.

Status of a run

Status
Meaning

pending

Created and waiting to be admitted.

queue

Admitted and sent to an executor.

running

A step is executing.

waitingApproval

The plan is done and the template, or a soft-mandatory policy, needs a person to approve.

approved

Approved; the apply step follows.

completed

All steps finished.

noChanges

The plan found nothing to change, so there is nothing to approve or apply.

failed

A step failed, or a hard-mandatory policy blocked the run.

rejected

Someone discarded the run at approval.

cancelled

Cancelled before it finished.

pending, queue, running, approved and waitingApproval are active: a workspace runs one job at a time, so later runs wait behind an active one. A run that is waiting for approval holds the workspace queue until someone approves, discards or cancels it.

From click to plan

Before admission, user-created runs must pass plan permission and the workspace's run restrictions. In 2.34.0, those controls can restrict apply/destroy branches and ungated applies, with a separate destroy permission.

Two queues apply. Runs are serialized per workspace, and across the cluster they are admitted in first-in, first-out order, so a busy workspace never lets a newer run overtake an older eligible one, and it does not block other workspaces. If no executor is ready, the run stays pending and is retried; it does not fail. Runs that stay open too long are closed by run limits.

Steps in a run

A template is a list of steps. The common Plan and Apply template is:

Each step runs in a fresh clone of the repository, usually on a different executor. The apply step therefore applies the saved plan from the plan step. Files the plan built can be carried across with plan artifacts. The executor's working directory and extension handling are described in Terraform Execution Flow.

Output and state

  • State is written to your storage backend through the backend configuration Terrakube generates for each run. See Terraform State.

  • Logs stream live through Redis while a step runs and are saved to storage when it ends. Final structured results survive an API outage. See Job Output.

  • After an apply that changed state, run triggers queue runs in dependent workspaces and notifications are sent.

Last updated

Was this helpful?