Skip to content

WorkflowBacklog

A WorkflowBacklog runs an ordered list of recipes under one deadline. Each item renders an immutable recipe into an ordinary WorkflowRun. The backlog records the recipe digest and every attempted run.

A backlog can run general-purpose agent workflows (such as rollout validation, incident checks, or audits) without a Git repository, optionally setting spec.scope to coordinate overlapping blast radii through hierarchical PathLease scopes. When a backlog sets repository and targetBranch instead, it supplies a run-wide Git lease to each child run and advances a confirmed Git checkpoint from the last published commit.

The rollout validation recipe collects telemetry and evaluates SLO thresholds with a successWhen gate. The rollout backlog runs that recipe in order across canary and us-east rings with no Git repository.

Terminal window
kubectl --namespace team-a apply -f config/samples/workflow-recipe-rollout-validation.yaml
kubectl --namespace team-a create -f config/samples/workflowbacklog-rollout.yaml
kubectl --namespace team-a get workflowbacklog checkout-rollout-validation --watch

The sample pub/sub recipe builds a Go consumer that writes events to a database. It accepts a topic, event schema, table, and deduplication key. The sample backlog binds the recipe to a remote and an AgentSet containing a backend group. Give the builder read access to the source and write access to candidate branches.

The sample verifier image checks the consumer’s storage contract with an independent suite. It exercises the write, redelivery, and outage recovery paths with a test store. Register the built image by digest under controller.verifiers.go-pubsub. Use a verifier with a broker and database fixture when the acceptance contract also covers live adapters.

Set the backlog repository URL and inputs, then apply the documents.

Terminal window
kubectl --namespace team-a apply -f config/samples/workflow-recipe-pubsub.yaml
kubectl --namespace team-a create -f config/samples/workflowbacklog.yaml
kubectl --namespace team-a get workflowbacklog checkout-delivery --watch

Store a YAML recipe in a key of an immutable ConfigMap in the backlog’s namespace. Give each recipe revision its own ConfigMap name. A recipe declares these fields.

Field Purpose
inputs Optional list of required input names. The item supplies exactly these strings.
timeout The child WorkflowRun timeout.
mode, reads, writes Repository-backed or scoped backlogs. The run-wide PathLease. Use ${parameterName} in paths to substitute a declared input.
steps Workflow steps with ordinary dependsOn relationships. Repository-backed recipes end with a verified land step; general-purpose recipes use agent steps and non-Git verify Jobs.

A step’s optional recipePath has up to four slash-separated components ending in the step name. It groups the execution record without changing dependency order. Agent steps receive inputs as a JSON object, and verify.params values substitute ${parameterName} from the item’s declared inputs. Output contracts accept either inline output.schema or output.schemaFrom pointing to an immutable ConfigMap in the backlog’s namespace (the referenced schema content is included in recipeDigest so the contract stays fixed across attempts). When the backlog configures repository and targetBranch, it supplies the repository, target branch, and optional gitCredentialsSecretRef to the lease and landing, and the landing must depend on all other steps, including its named verifier. When spec.scope is set, recipes that declare writes receive a non-Git spec.lease under that scope. When neither repository nor scope is set, recipes omit mode, reads, writes, land, and Git candidate fields on verify.

Each backlog has a deadline, up to 24 hours. It creates one WorkflowRun at a time and records the run’s identity and final outcome before advancing. After a controller restart it reads the same WorkflowRun by name and UID. A verifier infrastructure error retries the same candidate within the verifier step’s budget. A run rejected by a verifier (VerificationRejected) or a step gate (GateRejected) can get a new attempt if the item has repairAttempts remaining. The new attempt receives the latest rejection diagnostic, any prior candidate SHA, and the cumulative priorAttempts history of earlier rejected attempts so repairs preserve earlier fixes.

A backlog reports Paused when the current item needs an operator. It retains completed items and any confirmed publication. Resolve the reported problem and create a backlog for the remaining work. For repository-backed backlogs, if another writer moves the target, the next run fails its base check and the backlog pauses. Set spec.cancel: true to stop the active child and retain the record. The backlog waits for the child to settle before it reports Canceled or TimedOut.