Argo Workflows runs DAGs of containers from start to finish. It isn't CI (that's Tekton's job here) and it isn't continuous reconciliation (that's what operators do). It's imperative orchestration with dependencies, retries, and parameters, making it the right engine for multi-step provisioning: validate the request, create the resources, register them elsewhere, and notify.

needsmake core

Orientation

competency 3.2 · workflows for self-service provisioning

Run to completion, not converge forever. That distinction powers the whole decision table in section 3.6, and it's why a workflow fits "stamp this out once on request" and fails at "keep this true for the next three years".

Lab note

Workflows installs with the gitops layer, and the controller only watches the argo and default namespaces. If you create a Workflow anywhere else, it'll sit untouched forever and look like a broken controller.

The model

entrypoint · templates · parameters

Every Workflow has an entrypoint and a list of templates. Templates come in distinct flavors, and choosing the right one is half the authoring skill:

Template typeDoesUse for
containerRuns a container imageAnything with a CLI
scriptRuns inline code with an interpreter; stdout becomes the step's resultValidation, quick glue, computed values
resourceCreates, applies, patches, or deletes a Kubernetes object, optionally waiting on a success conditionThe provisioning workhorse
dagRuns tasks ordered by dependencies (or depends)The one to default to
stepsRuns sequential groups (- runs in parallel inside a group, - - runs serially between groups)Simple linear flows
suspendPauses execution until resumed manually or after a durationApproval gates

Parameters flow in via {{workflow.parameters.x}} and between tasks via outputs ({{tasks.a.outputs.result}}). You can gate conditional branches with when and fan a template out over a list with withItems or withParam. For larger payloads, artifacts pass S3/MinIO-backed files between steps. They aren't configured in this lab, but keep the mental model sharp: results are small strings, artifacts are files, just like in Tekton.

Reusable pieces: WorkflowTemplate gives you a namespaced library you invoke with workflowTemplateRef or submit from the UI, ClusterWorkflowTemplate does the same cluster-wide, and CronWorkflow puts runs on a schedule. Promoting a bare Workflow into a WorkflowTemplate is what turns a one-off script into a self-service endpoint: suddenly it has a name, typed parameters, and a submit button.

WorkflowTemplate "provision-tenant"   ← the product: named, parameterized, submittable
        │ submit(team=team-d)
        ▼
Workflow (run-to-completion)
   dag:
     check ──▶ namespace ──▶ quota ──▶ register
     (script)    (resource)      (resource)   (container)
        │
        └─ each node = one pod, running as spec.serviceAccountName

RBAC is the part that actually fails

and the Argo-specific wrinkle

Workflow pods run under a ServiceAccount, and a resource template that creates namespaces needs cluster-scoped permissions that default simply doesn't have. What the exam really tests is wiring SA → Role or ClusterRole → binding → spec.serviceAccountName, then recognizing a Forbidden error inside a workflow node as an RBAC issue rather than a broken workflow spec.

The one nobody guesses

Argo's executor reports each step's outcome back through its own CRD, workflowtaskresults.argoproj.io. That means every workflow ServiceAccount needs create,patch on that resource. Leave it out and even a spotless workflow fails, usually before your real permission error ever shows up.

Two other permissions come up often: some setups need get,list,watch on pods to report progress, and artifact-heavy workflows need access to the artifact repository Secret. The rule is the same as section 5.1: grant least privilege, then prove it with kubectl auth can-i --as=system:serviceaccount:<ns>:<sa> before you blame the tool.

Diagnosing a failed workflow

kubectl get workflow <name> -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase, message}'
kubectl get workflow <name> -o jsonpath='{.status.phase}{"\n"}'
kubectl logs -l workflows.argoproj.io/workflow=<name> --all-containers --tail=50
outputcaptured 2026-11-18
$ kubectl get workflow provision-tenant-22wmz -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase, message}'
{
  "displayName": "provision-tenant-22wmz",
  "phase": "Failed",
  "message": null
}
{
  "displayName": "quota",
  "phase": "Omitted",
  "message": "omitted: depends condition not met"
}
{
  "displayName": "namespace",
  "phase": "Failed",
  "message": "main: Error (exit code 64): no more retries Error from server (Forbidden): error when creating \"/tmp/manifest.yaml\": namespaces is forbidden: User \"system:serviceaccount:default:default\" cannot create resource \"namespaces\" in API group \"\" at the cluster scope"
}
$ kubectl get workflow provision-tenant-22wmz -o jsonpath='{.status.phase}{"\n"}'
Failed
$ kubectl logs -l workflows.argoproj.io/workflow=provision-tenant-22wmz --all-containers --tail=50
time=2026-11-18T08:03:31.237Z level=INFO msg="Starting Workflow Executor" argo=true version=v4.1.6 buildDate=2026-10-22T08:12:51Z gitCommit=43021573c5a35cbafae009043c132dfcef43a112 gitTag=v4.1.6 gitTreeState=clean goVersion=go1.26.10
time=2026-11-18T08:03:31.246Z level=INFO msg="Using executor retry strategy" argo=true Steps=5 Duration=1s Factor=1.6 Jitter=0.5
time=2026-11-18T08:03:31.247Z level=INFO msg="Executor initialized" templateName=make-ns buildDate=2026-10-22T08:12:51Z goVersion=go1.26.10 namespace=default gitTreeState=clean version=v4.1.6 argo=true gitCommit=43021573c5a35cbafae009043c132dfcef43a112 includeScriptOutput=false gitTag=v4.1.6 podName=provision-tenant-22wmz-make-ns-921861213 deadline=0001-01-01T00:00:00.000Z
time=2026-11-18T08:03:31.437Z level=INFO msg="Loading manifest" argo=true path=/tmp/manifest.yaml
time=2026-11-18T08:03:31.437Z level=INFO msg="Start loading input artifacts..." argo=true pluginName=""
time="2026-11-18T08:03:31.437Z" level=info msg="Alloc=9915 TotalAlloc=16395 Sys=32458 NumGC=4 Goroutines=3"
time=2026-11-18T08:03:32.767Z level=INFO msg="waiting for signals" argo=true signalPath=/var/run/argo/ctr/main/signal
time=2026-11-18T08:03:32.809Z level=INFO msg="Starting Workflow Executor" buildDate=2026-10-22T08:12:51Z gitCommit=43021573c5a35cbafae009043c132dfcef43a112 gitTag=v4.1.6 gitTreeState=clean goVersion=go1.26.10 argo=true version=v4.1.6
time=2026-11-18T08:03:32.813Z level=INFO msg="Using executor retry strategy" argo=true Steps=5 Duration=1s Factor=1.6 Jitter=0.5
time=2026-11-18T08:03:32.813Z level=INFO msg="Executor initialized" namespace=default podName=provision-tenant-22wmz-make-ns-921861213 deadline=0001-01-01T00:00:00.000Z argo=true gitTag=v4.1.6 goVersion=go1.26.10 templateName=make-ns buildDate=2026-10-22T08:12:51Z version=v4.1.6 includeScriptOutput=false gitCommit=43021573c5a35cbafae009043c132dfcef43a112 gitTreeState=clean
time=2026-11-18T08:03:32.818Z level=WARN msg="failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/" attempt=0 argo=true error="workflowtaskresults.argoproj.io is forbidden: User \"system:serviceaccount:default:default\" cannot create resource \"workflowtaskresults\" in API group \"argoproj.io\" in the namespace \"default\""
time=2026-11-18T08:03:32.818Z level=WARN msg="Non-transient error" argo=true error="workflowtaskresults.argoproj.io is forbidden: User \"system:serviceaccount:default:default\" cannot create resource \"workflowtaskresults\" in API group \"argoproj.io\" in the namespace \"default\""
time=2026-11-18T08:03:32.819Z level=ERROR msg="executor error" argo=true error="workflowtaskresults.argoproj.io is forbidden: User \"system:serviceaccount:default:default\" cannot create resource \"workflowtaskresults\" in API group \"argoproj.io\" in the namespace \"default\""
time=2026-11-18T08:03:32.819Z level=INFO msg="Loading manifest" argo=true path=/tmp/manifest.yaml
… (rest of the executor log omitted)

That node map gives you the whole diagnosis in one JSON blob: every node's phase and exact message. Debugging a failed workflow is just pod debugging plus that single extra layer.

Workflows as a self-service interface

what makes it a product rather than a script
  • Parameters at submit time: a WorkflowTemplate with typed, defaulted, documented parameters is an API. A bare Workflow with hard-coded values is just a script you happened to run inside a pod.
  • Validation before side effects: put a first DAG node up front to reject bad inputs (a name that isn't a valid DNS label, a quota over policy). It acts as admission control one layer earlier, and it's far cheaper than half-provisioning a tenant and rolling back.
  • Idempotency: a re-run shouldn't blow up or double-create resources. Use resource templates with action: apply instead of create, or guard steps with an existence check and when. Workflows don't reconcile, so idempotency is strictly your job.
  • Observability: the Workflow's own status is your audit trail, so ship it somewhere durable. And always verify the outputs, not just the runner: a green workflow that created nothing is still a failure.
  • Triggering: reach for CronWorkflow on schedules, the API or CLI from portals, or Argo Events (not installed here) for event-driven runs. Backstage templates commonly trigger one of these underneath, which is how a web form turns into real infrastructure.
Verify the output, not the runner

Grade every provisioning run twice: confirm the workflow reached Succeeded, and confirm the objects it was supposed to create actually exist with the right spec. Exam graders check the outputs; make checking both a reflex.

The fields that decide behavior

retries, deadlines, exit handlers, locks, cleanup

The six template types above cover everything in this lab. An exam cluster may still hand you one of the other four, so be ready to recognize them on sight:

Template typeDoesWrinkle
httpSends an HTTP request, stores the response body in outputs.result, and checks successCondition against response.statusCode or response.bodyRuns in the per-workflow agent pod, which talks to the controller via the WorkflowTaskSet CRD, so the SA needs an agent role too
containerSetRuns several containers in one pod, ordered with dependencies and sharing an emptyDir workspaceThe container named main must finish last if you want base-layer output artifacts
dataLists artifact paths from a repository (source.artifactPaths) and filters them with transformation[].expressionBare-bones by design: the only supported source today is the artifact repository
pluginHands the step off to an executor plugin (an ExecutorPlugin CR) running in the agent podIt's an admin-installed extension, so if a task mentions a plugin, check that the ExecutorPlugin actually exists

Retries, deadlines, garbage collection

  • retryStrategy. Set limit (as a string, like "3"), retryPolicy, and an optional backoff (duration, factor, maxDuration). The policy decides what counts as retryable: OnFailure retries a main container that exited non-zero (the default), OnError retries controller and init/wait container failures, OnTransientError retries only errors matching Argo's transient list, and Always retries everything. You can narrow it further with an expression over lastRetry.exitCode, lastRetry.status, lastRetry.duration, and lastRetry.message. Since v3.5, if you give an expression without a policy, the expression alone decides.
  • activeDeadlineSeconds. Set it on the workflow spec to cap the entire run, or on a template to cap a single step. When it trips, the node message reads Pod was active on the node longer than the specified deadline. Any workflow that must never hang forever needs this field, not wishful thinking.
  • ttlStrategy (secondsAfterCompletion, secondsAfterSuccess, secondsAfterFailure) cleans up the Workflow object itself, while podGC.strategy (OnPodCompletion, OnPodSuccess, OnWorkflowCompletion, OnWorkflowSuccess) cleans up its pods. You can set cluster-wide defaults for both under workflowDefaults in the controller ConfigMap, and a Workflow's own values always win. Upstream that ConfigMap is workflow-controller-configmap, but the Helm chart prefixes it with the release name, so in this lab it's argo-workflows-workflow-controller-configmap.
  • parallelism caps how many pods can run concurrently per workflow (or globally in the controller ConfigMap).

Exit handlers, hooks, and richer dependencies

spec.onExit: <template> names a template that runs after the entrypoint finishes, win or lose. Inside it, {{workflow.status}} resolves to Succeeded, Failed, or Error, and {{workflow.failures}} lists what broke. That's where notifications, cleanup, and "register the tenant only on success" live. hooks generalize the same idea, giving you workflow-level or template-level hooks.exit plus custom named hooks driven by an expression such as workflow.status == "Running".

Inside a DAG, depends upgrades dependencies into a boolean expression over task outcomes: task-a.Succeeded, .Failed, .Errored, .Skipped, .Omitted, and .Daemoned, combined with &&, ||, and !. A bare task name is shorthand for "succeeded, skipped, or daemoned". Just don't mix dependencies and depends in the same DAG, and remember continueOn disappears once you switch to depends (write .Failed explicitly instead).

spec:
  entrypoint: main
  onExit: notify                      # always runs; sees {{workflow.status}}
  activeDeadlineSeconds: 900
  ttlStrategy: { secondsAfterSuccess: 3600 }
  podGC: { strategy: OnWorkflowSuccess }
  synchronization:
    mutexes: [{ name: provision-lock }]   # one run at a time per namespace
  templates:
    - name: flaky-step
      retryStrategy:
        limit: "3"
        retryPolicy: OnFailure
        backoff: { duration: "10s", factor: "2", maxDuration: "2m" }
      container: { image: alpine:3.20, command: [sh, -c, "exit 1"] }

Locks and resource templates

  • synchronization. mutexes allow a single holder at a time, while semaphores read a limit from a ConfigMap key (configMapKeyRef) and allow N. Both work at the workflow or template level, and both are namespace-scoped unless you configure the database-backed multi-controller variant. A workflow waiting on a lock sits in Pending with a message naming the lock, which is easy to mistake for a scheduling issue. Notice the plural field names (mutexes, semaphores): v3.6 turned them into lists.
  • resource templates. action accepts any kubectl verb (create, apply, patch, delete, get). Add successCondition and failureCondition to poll the created object (like status.succeeded > 0 and status.failed > 3 on a Job) so the step waits for a real outcome. For patch, pick mergeStrategy: strategic|merge|json, keeping in mind that custom resources don't support strategic. Watch out for setOwnerReference: true: it ties the created object's lifetime to the workflow, which is usually the exact opposite of what you want for provisioning.
  • Outputs. outputs.parameters[].valueFrom.path reads a file your container wrote, while outputs.result captures up to 256 kB of stdout (or the HTTP response body). Referencing an output the producer never wrote kills the consuming node unless you supply valueFrom.default or an expression fallback (??).
  • Artifacts without plumbing. A key-only artifact (s3: { key: my-file } and nothing else) inherits its bucket and credentials from the configured artifact repository (artifactRepositoryRef or the controller default). That's how templates stay portable across clusters.
Trap

Argo has used the emissary executor exclusively since v3.4. When a node reports Error (exit code 64), that's the emissary itself failing, not your command. The missing workflowtaskresults RBAC rule from earlier is the usual reason the wait container blows up right after.

The submission surface and what fails on it

templates, cron, events, server, archive, messages

Three ways to reference a template

  • workflowTemplateRef at the top of a Workflow spec runs an entire WorkflowTemplate, with the Workflow's own arguments and entrypoint overriding the template's defaults. argo submit --from workflowtemplate/<name> -p key=value is the CLI form, and the UI's submit button makes the exact same call.
  • templateRef inside a step or task borrows a single template from a WorkflowTemplate (by name + template). Add clusterScope: true to reach a ClusterWorkflowTemplate; leave it off and you'll get a "not found" error from a namespaced lookup.
  • Restrictions. When a controller runs with workflowRestrictions.templateReferencing: Strict, it only accepts Workflows that use workflowTemplateRef. Secure goes a step further and fails a running Workflow if its backing template changes mid-flight. Under either mode, a submitted Workflow can only override an allow-listed set of fields (arguments, entrypoint, ttlStrategy, podGC, and a few more), so setting serviceAccountName or volumes on the submission gets rejected. If a valid field is mysteriously refused at submit time, this is why.

CronWorkflow, the fields that bite

FieldDefaultMeans
schedulesrequiredA list of cron expressions (v3.6+; older manifests use singular schedule)
concurrencyPolicyAllowForbid skips a tick while the previous run is still alive; Replace kills the old run first
startingDeadlineSeconds0Grace window after a missed tick (say, while the controller was down) during which one catch-up run still fires
timezonemachine tzIANA timezone name; DST is honored, so 02:30 can be skipped or run twice
suspendfalseThe GitOps-friendly pause switch; argo cron suspend flips this exact field
successfulJobsHistoryLimit / failedJobsHistoryLimit3 / 1How many finished Workflows to retain

Submitting from outside the shell

The Argo Server exposes POST /api/v1/workflows/{namespace} for direct submissions and POST /api/v1/events/{namespace}/{discriminator} for webhooks. A WorkflowEventBinding turns an incoming webhook into a run: its event.selector evaluates an expression over payload, metadata (lowercased headers), and discriminator, while its submit block names the WorkflowTemplate and maps payload fields into parameters.

Clients authenticate with a ServiceAccount bearer token (Authorization: Bearer ...), and the server's --auth-mode controls how it acts: client (the default since v3.0, using the caller's token), server (acting as the server's own SA), or sso. Under SSO, RBAC maps OIDC groups to ServiceAccounts through the workflows.argoproj.io/rbac-rule and rbac-rule-precedence annotations on each SA. Argo Events (Sensor plus EventSource) is the separate project for turning queues and webhooks into Workflows at scale; this built-in events endpoint is the lightweight option.

The archive

Finished Workflows are ordinary Kubernetes objects, so they vanish as soon as ttlStrategy cleans them up. Setting persistence.archive: true with a PostgreSQL or MySQL connection in the controller ConfigMap copies every completed Workflow (though not its pod logs) into argo_archived_workflows, where you can query them from the UI or argo archive list. When an exam prompt asks you to "keep an auditable record of every provisioning run", that means the archive plus a log shipper for pod output.

Reading failures

Node messageMeansFix lives in
Error (exit code 1)The main container failedYour command; read the pod log
OOMKilled (exit code 137)Hit its memory limitThe template's resources
Pod was active on the node longer than the specified deadlineactiveDeadlineSeconds trippedThe deadline or the step's runtime
No more retries leftretryStrategy.limit exhaustedThe underlying child node's message
... is forbidden: User "system:serviceaccount:..." cannot create resource "workflowtaskresults"Executor RBAC is missingRole and RoleBinding for the workflow SA
child 'name' failedA DAG or steps parent summarizing a child failureDescend into the child node
Error (exit code 64)Emissary executor failureUsually RBAC or image command resolution
Node stays Pending, message names a lock or ConfigMap keyWaiting on synchronizationThe other lock holder, or the semaphore size

Watch for two other silent stalls: a Workflow created in a namespace the controller doesn't watch (in this lab, anything outside argo and default) stays completely blank with no status at all, and a Workflow whose SA lacks pods permissions in server auth mode fails at the server instead of inside a node. Once you've fixed the cause, argo retry resumes a failed Workflow from its failed nodes while argo resubmit starts a clean run. When cancelling, remember that argo stop still runs exit handlers, whereas argo terminate skips them.

How this gets tested

Expect prompts like "make this workflow retry up to three times with backoff", "notify on completion regardless of outcome", "run this nightly and never overlap", or "expose this Workflow so a user can submit it with a parameter". Each maps straight to one knob above: retryStrategy, onExit, CronWorkflow with concurrencyPolicy: Forbid, and promoting to a WorkflowTemplate. Verify by reading status.nodes, not by eyeballing colors in the UI.

Exercises

tick the dot when its check passes

The self-service story from 3.1, made concrete. First the identity:

kubectl -n default create sa provisioner
kubectl create clusterrole tenant-provisioner --verb=create,get --resource=namespaces,resourcequotas
kubectl create clusterrolebinding tenant-provisioner --clusterrole=tenant-provisioner --serviceaccount=default:provisioner
# Argo's executor reports each step's outcome through its own CRD, so every
# workflow SA needs this too; forget it and even a correct workflow fails:
kubectl -n default create role wf-taskresults --verb=create,patch --resource=workflowtaskresults.argoproj.io
kubectl -n default create rolebinding wf-taskresults --role=wf-taskresults --serviceaccount=default:provisioner
outputcaptured 2026-08-26
$ kubectl -n default create sa provisioner
serviceaccount/provisioner created
$ kubectl create clusterrole tenant-provisioner --verb=create,get --resource=namespaces,resourcequotas
clusterrole.rbac.authorization.k8s.io/tenant-provisioner created
$ kubectl create clusterrolebinding tenant-provisioner --clusterrole=tenant-provisioner --serviceaccount=default:provisioner
clusterrolebinding.rbac.authorization.k8s.io/tenant-provisioner created
# Argo's executor reports each step's outcome through its own CRD, so every
# workflow SA needs this too; forget it and even a correct workflow fails:
$ kubectl -n default create role wf-taskresults --verb=create,patch --resource=workflowtaskresults.argoproj.io
role.rbac.authorization.k8s.io/wf-taskresults created
$ kubectl -n default create rolebinding wf-taskresults --role=wf-taskresults --serviceaccount=default:provisioner
rolebinding.rbac.authorization.k8s.io/wf-taskresults created

Then the workflow, a two-node DAG using resource templates:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: provision-tenant-, namespace: default }
spec:
  entrypoint: provision
  serviceAccountName: provisioner
  arguments: { parameters: [{ name: team, value: team-d }] }
  templates:
    - name: provision
      dag:
        tasks:
          - name: namespace
            template: make-ns
          - name: quota
            template: make-quota
            dependencies: [namespace]
    - name: make-ns
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: Namespace
          metadata:
            name: "{{workflow.parameters.team}}"
            labels: { tenant: "{{workflow.parameters.team}}" }
    - name: make-quota
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: ResourceQuota
          metadata:
            name: default-quota
            namespace: "{{workflow.parameters.team}}"
          spec:
            hard: { requests.cpu: "1", requests.memory: 2Gi, pods: "10" }

Use kubectl create -f (generateName doesn't work with apply), then watch it run with kubectl get workflow -w.

verify: the workflow reaches Succeeded, and kubectl get ns team-d --show-labels plus kubectl -n team-d get resourcequota confirm the resources actually landed.

Rerun the workflow with serviceAccountName: default and a fresh team name. Pay attention to which rule it complains about first: with the bare default SA, the executor usually trips over workflowtaskresults (its own reporting channel) before your namespace rule even gets tested. That's an Argo-specific wrinkle worth seeing firsthand.

verify: the workflow fails, and kubectl get workflow <name> -o jsonpath='{.status.nodes}' | jq '.[] | {phase, message}' shows a forbidden error naming a missing verb and resource. That message shape is identical for every RBAC failure you'll debug.

Submit the same workflow for team-e without editing the file. The UI's submit flow lists WorkflowTemplates rather than bare Workflows, so either promote yours to a WorkflowTemplate first (switch the kind and swap generateName for name) and submit it from the UI with the parameter overridden, or stay in the shell and run sed 's/team-d/team-e/' workflow.yaml | kubectl create -f -.

verify: two tenants exist from one workflow spec. Parameters at submit time are what turn a script into a self-service endpoint, and promoting to a WorkflowTemplate is how you productize it.

Add a first DAG node named check using a script template that exits non-zero whenever {{workflow.parameters.team}} doesn't match ^team-[a-z]+$, and make the other nodes depend on it.

verify: a run with team=Team_X fails at check and creates nothing. Clean up the test tenants when you're done: kubectl delete ns team-d team-e.

A bare Workflow is a script someone ran once. A WorkflowTemplate is a named product anyone can submit with their own parameters, which is the line between ad-hoc automation and a platform API.

kubectl delete ns team-g --ignore-not-found
kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata: { name: provision-tenant, namespace: default }
spec:
  entrypoint: provision
  serviceAccountName: provisioner
  arguments: { parameters: [{ name: team, value: team-d }] }
  templates:
    - name: provision
      dag:
        tasks:
          - name: namespace
            template: make-ns
          - name: quota
            template: make-quota
            dependencies: [namespace]
    - name: make-ns
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: Namespace
          metadata:
            name: "{{workflow.parameters.team}}"
            labels: { tenant: "{{workflow.parameters.team}}" }
    - name: make-quota
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: ResourceQuota
          metadata:
            name: default-quota
            namespace: "{{workflow.parameters.team}}"
          spec:
            hard: { requests.cpu: "1", requests.memory: 2Gi, pods: "10" }
EOF
argo submit --from workflowtemplate/provision-tenant -p team=team-g --wait
argo get @latest
kubectl get ns team-g
kubectl -n team-g get resourcequota default-quota
kubectl delete ns team-g --ignore-not-found --wait=false
kubectl delete workflowtemplate provision-tenant
outputcaptured 2026-09-12
$ kubectl delete ns team-g --ignore-not-found
namespace "team-g" deleted
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata: { name: provision-tenant, namespace: default }
spec:
  entrypoint: provision
  serviceAccountName: provisioner
  arguments: { parameters: [{ name: team, value: team-d }] }
  templates:
    - name: provision
      dag:
        tasks:
          - name: namespace
            template: make-ns
          - name: quota
            template: make-quota
            dependencies: [namespace]
    - name: make-ns
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: Namespace
          metadata:
            name: "{{workflow.parameters.team}}"
            labels: { tenant: "{{workflow.parameters.team}}" }
    - name: make-quota
      resource:
        action: create
        manifest: |
          apiVersion: v1
          kind: ResourceQuota
          metadata:
            name: default-quota
            namespace: "{{workflow.parameters.team}}"
          spec:
            hard: { requests.cpu: "1", requests.memory: 2Gi, pods: "10" }
EOF
workflowtemplate.argoproj.io/provision-tenant unchanged
$ argo submit --from workflowtemplate/provision-tenant -p team=team-g --wait
Name:                provision-tenant-524qt
Namespace:           default
ServiceAccount:      unset
Status:              Pending
Created:             Sat Sep 12 23:12:05 -0400 (now)
Progress:            
Parameters:          
  team:              team-g
provision-tenant-524qt Succeeded at 2026-09-12 23:12:25 -0400 EDT
$ argo get @latest
Name:                provision-tenant-524qt
Namespace:           default
ServiceAccount:      provisioner
Status:              Succeeded
Conditions:          
 PodRunning          False
 Completed           True
Created:             Sat Sep 12 23:12:05 -0400 (21 seconds ago)
Started:             Sat Sep 12 23:12:05 -0400 (21 seconds ago)
Finished:            Sat Sep 12 23:12:25 -0400 (1 second ago)
Duration:            20 seconds
Progress:            2/2
ResourcesDuration:   2s*(100Mi memory),0s*(1 cpu)
Parameters:          
  team:              team-g

STEP                       TEMPLATE    PODNAME                                       DURATION  MESSAGE
 ✔ provision-tenant-524qt  provision                                                             
 ├─✔ namespace             make-ns     provision-tenant-524qt-make-ns-3648215291     5s          
 └─✔ quota                 make-quota  provision-tenant-524qt-make-quota-3757520604  5s          
$ kubectl get ns team-g
NAME     STATUS   AGE
team-g   Active   17s
$ kubectl -n team-g get resourcequota default-quota
NAME            REQUEST                                                 LIMIT   AGE
default-quota   pods: 0/10, requests.cpu: 0/1, requests.memory: 0/2Gi           6s
$ kubectl delete ns team-g --ignore-not-found --wait=false
namespace "team-g" deleted
$ kubectl delete workflowtemplate provision-tenant
workflowtemplate.argoproj.io "provision-tenant" deleted from default namespace
verify: the submit prints a live node tree ending in Succeeded with both resource nodes green, and both the namespace and quota exist.

A retry strategy turns a single node into a parent with child attempts, so the node tree shows every try. People guess the backoff field names wrong all the time, so read them straight off a real run.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: retryer-, namespace: default }
spec:
  entrypoint: flaky
  templates:
    - name: flaky
      retryStrategy:
        limit: "2"
        retryPolicy: OnFailure
        backoff: { duration: "5s", factor: "2" }
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["exit 1"]
EOF
sleep 90
WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
kubectl get wf "$WF" -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, type, phase, message}'
kubectl get wf "$WF" -o jsonpath='{.status.phase} {.status.message}{"\n"}'
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: retryer-, namespace: default }
spec:
  entrypoint: flaky
  templates:
    - name: flaky
      retryStrategy:
        limit: "2"
        retryPolicy: OnFailure
        backoff: { duration: "5s", factor: "2" }
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["exit 1"]
EOF
workflow.argoproj.io/retryer-mhqnn created
$ sleep 90
$ WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
$ kubectl get wf "$WF" -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, type, phase, message}'
{
  "displayName": "retryer-mhqnn",
  "type": "Retry",
  "phase": "Failed",
  "message": "No more retries left"
}
{
  "displayName": "retryer-mhqnn(1)",
  "type": "Pod",
  "phase": "Failed",
  "message": "main: Error (exit code 1)"
}
{
  "displayName": "retryer-mhqnn(0)",
  "type": "Pod",
  "phase": "Failed",
  "message": "main: Error (exit code 1)"
}
{
  "displayName": "retryer-mhqnn(2)",
  "type": "Pod",
  "phase": "Failed",
  "message": "main: Error (exit code 1)"
}
$ kubectl get wf "$WF" -o jsonpath='{.status.phase} {.status.message}{"\n"}'
Failed No more retries left
verify: you see three child nodes under one retry parent, and the final message says there are no more retries left. Notice the off-by-one: limit: 2 means two retries after the first attempt (three total), not two attempts total.

activeDeadlineSeconds is enforced by the pod itself rather than the Argo controller, so the error message comes straight from Kubernetes. Learn to recognize it, because it looks nothing like an Argo error.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: deadline-, namespace: default }
spec:
  entrypoint: slow
  templates:
    - name: slow
      activeDeadlineSeconds: 10
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 60"]
EOF
sleep 60
WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
kubectl get wf "$WF" -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase, message}'
kubectl get wf -o name | grep 'deadline-' | xargs -r kubectl delete
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: deadline-, namespace: default }
spec:
  entrypoint: slow
  templates:
    - name: slow
      activeDeadlineSeconds: 10
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 60"]
EOF
workflow.argoproj.io/deadline-pwgzt created
$ sleep 60
$ WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
$ kubectl get wf "$WF" -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase, message}'
{
  "displayName": "deadline-pwgzt",
  "phase": "Failed",
  "message": "Pod was active on the node longer than the specified deadline"
}
$ kubectl get wf -o name | grep 'deadline-' | xargs -r kubectl delete
workflow.argoproj.io "deadline-pwgzt" deleted from default namespace
verify: the node message reports that the pod was active on the node longer than the specified deadline.

Self-service means two people will inevitably submit at the exact same time. A mutex serializes them without failing either run, and the waiting workflow tells you what it's waiting on in status.message. That's the first place to check when someone asks why their run hasn't started.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
cat > /tmp/locked.yaml <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: locked-, namespace: default }
spec:
  entrypoint: work
  synchronization:
    mutexes: [{ name: lab-lock }]
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 60"]
EOF
kubectl create -f /tmp/locked.yaml
kubectl create -f /tmp/locked.yaml
sleep 15
kubectl get wf -l workflows.argoproj.io/phase --sort-by=.metadata.creationTimestamp | tail -3
kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{range .items[-2:]}{.metadata.name} {.status.phase}{"\n"}{end}'
kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].status.message}{"\n"}'
kubectl -n argo get cm argo-workflows-workflow-controller-configmap -o jsonpath='{.data}' | jq
kubectl delete wf -l workflows.argoproj.io/workflow --ignore-not-found 2>/dev/null; kubectl get wf -o name | grep locked- | xargs -r kubectl delete
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ cat > /tmp/locked.yaml <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: locked-, namespace: default }
spec:
  entrypoint: work
  synchronization:
    mutexes: [{ name: lab-lock }]
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 60"]
EOF
$ kubectl create -f /tmp/locked.yaml
workflow.argoproj.io/locked-ccpvq created
$ kubectl create -f /tmp/locked.yaml
workflow.argoproj.io/locked-2nmfw created
$ sleep 15
$ kubectl get wf -l workflows.argoproj.io/phase --sort-by=.metadata.creationTimestamp | tail -3
rightscope-ccj6r         Succeeded   5m2s    
locked-ccpvq             Running     16s     
locked-2nmfw             Pending             Waiting for default/Mutex/lab-lock lock. Lock status: 0/1
$ kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{range .items[-2:]}{.metadata.name} {.status.phase}{"\n"}{end}'
locked-ccpvq Running
locked-2nmfw Pending
$ kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].status.message}{"\n"}'
Waiting for default/Mutex/lab-lock lock. Lock status: 0/1
$ kubectl -n argo get cm argo-workflows-workflow-controller-configmap -o jsonpath='{.data}' | jq
{
  "config": "nodeEvents:\n  enabled: true\nworkflowEvents:\n  enabled: true\nfailedPodRestart:\n  enabled: false\n  maxRestarts: 3\n"
}
$ kubectl delete wf -l workflows.argoproj.io/workflow --ignore-not-found 2>/dev/null; kubectl get wf -o name | grep locked- | xargs -r kubectl delete
No resources found
workflow.argoproj.io "locked-2nmfw" deleted from default namespace
workflow.argoproj.io "locked-ccpvq" deleted from default namespace
verify: one workflow runs while the other sits in Pending with a message naming the lock.

onExit is your finally block: it sees the workflow's final status and runs whether the entrypoint succeeded or failed. Only one kind of cancellation skips it.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: exiter-, namespace: default }
spec:
  entrypoint: work
  onExit: report
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["exit 1"]
    - name: report
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo workflow finished as {{workflow.status}}"]
EOF
sleep 75
WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
argo logs "$WF" | tail -5
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { name: stoppable, namespace: default }
spec:
  entrypoint: work
  onExit: report
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 600"]
    - name: report
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo exit handler ran after {{workflow.status}}"]
EOF
sleep 20
argo stop stoppable
sleep 45
kubectl get wf stoppable -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase}'
kubectl delete wf stoppable
kubectl get wf -o name | grep 'exiter-' | xargs -r kubectl delete
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: exiter-, namespace: default }
spec:
  entrypoint: work
  onExit: report
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["exit 1"]
    - name: report
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo workflow finished as {{workflow.status}}"]
EOF
workflow.argoproj.io/exiter-dl5qg created
$ sleep 75
$ WF=$(kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
$ argo logs "$WF" | tail -5
exiter-dl5qg: Error: exit status 1
exiter-dl5qg-report-4006390619: time=2026-09-13T12:59:01.702Z level=INFO msg="waiting for signals" argo=true signalPath=/var/run/argo/ctr/main/signal
exiter-dl5qg-report-4006390619: workflow finished as Failed
exiter-dl5qg-report-4006390619: time=2026-09-13T12:59:02.702Z level=INFO msg="sub-process exited" error=<nil> argo=true
exiter-dl5qg-report-4006390619: time=2026-09-13T12:59:02.703Z level=INFO msg="file signal handler exiting due to context cancellation" argo=true
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { name: stoppable, namespace: default }
spec:
  entrypoint: work
  onExit: report
  templates:
    - name: work
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["sleep 600"]
    - name: report
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo exit handler ran after {{workflow.status}}"]
EOF
workflow.argoproj.io/stoppable created
$ sleep 20
$ argo stop stoppable
workflow stoppable stopped
$ sleep 45
$ kubectl get wf stoppable -o jsonpath='{.status.nodes}' | jq '.[] | {displayName, phase}'
{
  "displayName": "stoppable",
  "phase": "Failed"
}
{
  "displayName": "stoppable.onExit",
  "phase": "Succeeded"
}
$ kubectl delete wf stoppable
workflow.argoproj.io "stoppable" deleted from default namespace
$ kubectl get wf -o name | grep 'exiter-' | xargs -r kubectl delete
workflow.argoproj.io "exiter-dl5qg" deleted from default namespace
verify: the failing workflow's exit handler logs Failed, and argo stop still executes an exit-handler node, whereas argo terminate skips it.

A CronWorkflow that fires faster than its job finishes is a self-inflicted outage waiting to happen. Setting concurrencyPolicy: Forbid tells the controller to skip the tick instead.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata: { name: every-minute, namespace: default }
spec:
  schedules: ["* * * * *"]
  concurrencyPolicy: Forbid
  workflowSpec:
    entrypoint: work
    templates:
      - name: work
        container:
          image: busybox:1.36
          command: [sh, -c]
          args: ["sleep 90"]
EOF
sleep 210
argo cron get every-minute
kubectl get wf -l workflows.argoproj.io/cron-workflow=every-minute
kubectl get cronwf every-minute -o jsonpath='{.status}' | jq
kubectl delete cronwf every-minute
kubectl delete wf -l workflows.argoproj.io/cron-workflow=every-minute
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata: { name: every-minute, namespace: default }
spec:
  schedules: ["* * * * *"]
  concurrencyPolicy: Forbid
  workflowSpec:
    entrypoint: work
    templates:
      - name: work
        container:
          image: busybox:1.36
          command: [sh, -c]
          args: ["sleep 90"]
EOF
cronworkflow.argoproj.io/every-minute created
$ sleep 210
$ argo cron get every-minute
Name:                          every-minute
Namespace:                     default
Created:                       Sat Sep 12 23:16:10 -0400 (3 minutes ago)
Schedules:                     * * * * *
Suspended:                     false
ConcurrencyPolicy:             Forbid
LastScheduledTime:             Sat Sep 12 23:19:00 -0400 (40 seconds ago)
NextScheduledTime:             Sat Sep 12 23:20:00 -0400 (19 seconds from now) (assumes workflow-controller is in UTC)
Active Workflows:              every-minute-1789269540
$ kubectl get wf -l workflows.argoproj.io/cron-workflow=every-minute
NAME                      STATUS      AGE     MESSAGE
every-minute-1789269420   Succeeded   2m41s   
every-minute-1789269540   Running     41s     
$ kubectl get cronwf every-minute -o jsonpath='{.status}' | jq
{
  "active": [
    {
      "apiVersion": "argoproj.io/v1alpha1",
      "kind": "Workflow",
      "name": "every-minute-1789269540",
      "namespace": "default",
      "resourceVersion": "338837",
      "uid": "d13a072b-faf2-4516-ae37-69b988fb3d1b"
    }
  ],
  "failed": 0,
  "lastScheduledTime": "2026-09-13T03:19:00Z",
  "phase": "Active",
  "succeeded": 1
}
$ kubectl delete cronwf every-minute
cronworkflow.argoproj.io "every-minute" deleted from default namespace
$ kubectl delete wf -l workflows.argoproj.io/cron-workflow=every-minute
No resources found
verify: only two Workflows exist across three and a half minutes of a one-minute schedule, and argo cron get shows a single active Workflow. Notice that status doesn't keep a counter for skipped ticks (it only tracks active, lastScheduledTime, succeeded, failed, and phase), so you spot skips by comparing elapsed minutes against created runs. Replace would've killed the running Workflow to start a new one, and Allow would've let them pile up.

ClusterWorkflowTemplate and WorkflowTemplate are two different kinds with identical fields. Referencing one as the other throws a "not found" error that sends people hunting for a typo that isn't there.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata: { name: shared-say }
spec:
  templates:
    - name: say
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo from the cluster-scoped template"]
EOF
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: wrongscope-, namespace: default }
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: call
            templateRef: { name: shared-say, template: say }
EOF
sleep 30
kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].status.message}{"\n"}'
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: rightscope-, namespace: default }
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: call
            templateRef: { name: shared-say, template: say, clusterScope: true }
EOF
sleep 45
argo logs @latest | tail -3
kubectl delete clusterworkflowtemplate shared-say
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata: { name: shared-say }
spec:
  templates:
    - name: say
      container:
        image: busybox:1.36
        command: [sh, -c]
        args: ["echo from the cluster-scoped template"]
EOF
clusterworkflowtemplate.argoproj.io/shared-say created
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: wrongscope-, namespace: default }
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: call
            templateRef: { name: shared-say, template: say }
EOF
workflow.argoproj.io/wrongscope-pzf62 created
$ sleep 30
$ kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].status.message}{"\n"}'
invalid spec: templates.main.steps[0].call template reference shared-say.say not found
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: rightscope-, namespace: default }
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: call
            templateRef: { name: shared-say, template: say, clusterScope: true }
EOF
workflow.argoproj.io/rightscope-ccj6r created
$ sleep 45
$ argo logs @latest | tail -3
rightscope-ccj6r-say-4102760526: from the cluster-scoped template
rightscope-ccj6r-say-4102760526: time=2026-09-13T03:20:45.688Z level=INFO msg="sub-process exited" argo=true error=<nil>
rightscope-ccj6r-say-4102760526: time=2026-09-13T03:20:45.688Z level=INFO msg="file signal handler exiting due to context cancellation" argo=true
$ kubectl delete clusterworkflowtemplate shared-say
clusterworkflowtemplate.argoproj.io "shared-say" deleted
verify: the first run fails with invalid spec: templates.main.steps[0].call template reference shared-say.say not found, and one boolean fixes it. Because the error mentions neither the kind nor the scope it searched, a cluster-scoped template sitting right there looks like a typo. clusterScope: true is the whole difference.

A platform that lets anyone submit arbitrary workflow specs has no real guardrails. Setting templateReferencing: Strict forces every run through a reviewed template and blocks overrides like serviceAccountName. Because there's no admission webhook here, the API server accepts all three Workflows and the controller rejects them afterward, which means you read the verdict from status.message rather than from the kubectl create exit code.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata: { name: sanctioned, namespace: default }
spec:
  entrypoint: work
  serviceAccountName: default
  templates:
    - name: work
      container: { image: busybox:1.36, command: [sh, -c], args: ["echo sanctioned"] }
EOF
# every controller setting lives in the single config key, so append to it rather than adding a sibling
kubectl -n argo get cm argo-workflows-workflow-controller-configmap -o jsonpath='{.data.config}' > /tmp/argocfg.yaml
cp /tmp/argocfg.yaml /tmp/argocfg.orig
printf 'workflowRestrictions:\n  templateReferencing: Strict\n' >> /tmp/argocfg.yaml
kubectl -n argo create cm argo-workflows-workflow-controller-configmap --from-file=config=/tmp/argocfg.yaml --dry-run=client -o yaml | kubectl -n argo apply -f -
kubectl -n argo rollout restart deploy argo-workflows-workflow-controller
kubectl -n argo rollout status deploy argo-workflows-workflow-controller --timeout=180s
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: bare-, namespace: default }
spec:
  entrypoint: work
  templates:
    - name: work
      container: { image: busybox:1.36, command: [sh, -c], args: ["echo hi"] }
EOF
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: override-, namespace: default }
spec:
  serviceAccountName: default
  workflowTemplateRef: { name: sanctioned }
EOF
kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: fromtmpl-, namespace: default }
spec:
  workflowTemplateRef: { name: sanctioned }
EOF
sleep 40
kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{range .items[-3:]}{.metadata.name} {.status.phase} {.status.message}{"\n"}{end}'
kubectl -n argo create cm argo-workflows-workflow-controller-configmap --from-file=config=/tmp/argocfg.orig --dry-run=client -o yaml | kubectl -n argo apply -f -
kubectl -n argo rollout restart deploy argo-workflows-workflow-controller
kubectl -n argo rollout status deploy argo-workflows-workflow-controller --timeout=180s
kubectl delete workflowtemplate sanctioned
kubectl get wf -o name | grep -E 'bare-|override-|fromtmpl-' | xargs -r kubectl delete
outputcaptured 2026-11-18
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata: { name: sanctioned, namespace: default }
spec:
  entrypoint: work
  serviceAccountName: default
  templates:
    - name: work
      container: { image: busybox:1.36, command: [sh, -c], args: ["echo sanctioned"] }
EOF
workflowtemplate.argoproj.io/sanctioned created
$ # every controller setting lives in the single config key, so append to it rather than adding a sibling
$ kubectl -n argo get cm argo-workflows-workflow-controller-configmap -o jsonpath='{.data.config}' > /tmp/argocfg.yaml
$ cp /tmp/argocfg.yaml /tmp/argocfg.orig
$ printf 'workflowRestrictions:\n  templateReferencing: Strict\n' >> /tmp/argocfg.yaml
$ kubectl -n argo create cm argo-workflows-workflow-controller-configmap --from-file=config=/tmp/argocfg.yaml --dry-run=client -o yaml | kubectl -n argo apply -f -
Warning: resource configmaps/argo-workflows-workflow-controller-configmap is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
configmap/argo-workflows-workflow-controller-configmap configured
$ kubectl -n argo rollout restart deploy argo-workflows-workflow-controller
deployment.apps/argo-workflows-workflow-controller restarted
$ kubectl -n argo rollout status deploy argo-workflows-workflow-controller --timeout=180s
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 of 1 updated replicas are available...
deployment "argo-workflows-workflow-controller" successfully rolled out
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: bare-, namespace: default }
spec:
  entrypoint: work
  templates:
    - name: work
      container: { image: busybox:1.36, command: [sh, -c], args: ["echo hi"] }
EOF
workflow.argoproj.io/bare-bh9rh created
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: override-, namespace: default }
spec:
  serviceAccountName: default
  workflowTemplateRef: { name: sanctioned }
EOF
workflow.argoproj.io/override-49wbm created
$ kubectl create -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: fromtmpl-, namespace: default }
spec:
  workflowTemplateRef: { name: sanctioned }
EOF
workflow.argoproj.io/fromtmpl-hckd4 created
$ sleep 40
$ kubectl get wf --sort-by=.metadata.creationTimestamp -o jsonpath='{range .items[-3:]}{.metadata.name} {.status.phase} {.status.message}{"\n"}{end}'
bare-bh9rh Error workflows must use workflowTemplateRef to be executed when the controller is in reference mode
override-49wbm Error fields [ServiceAccountName] are not permitted when using workflowTemplateRef with templateReferencing restriction
fromtmpl-hckd4 Succeeded 
$ kubectl -n argo create cm argo-workflows-workflow-controller-configmap --from-file=config=/tmp/argocfg.orig --dry-run=client -o yaml | kubectl -n argo apply -f -
configmap/argo-workflows-workflow-controller-configmap configured
$ kubectl -n argo rollout restart deploy argo-workflows-workflow-controller
deployment.apps/argo-workflows-workflow-controller restarted
$ kubectl -n argo rollout status deploy argo-workflows-workflow-controller --timeout=180s
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 out of 1 new replicas have been updated...
Waiting for deployment "argo-workflows-workflow-controller" rollout to finish: 0 of 1 updated replicas are available...
deployment "argo-workflows-workflow-controller" successfully rolled out
$ kubectl delete workflowtemplate sanctioned
workflowtemplate.argoproj.io "sanctioned" deleted from default namespace
$ kubectl get wf -o name | grep -E 'bare-|override-|fromtmpl-' | xargs -r kubectl delete
workflow.argoproj.io "bare-bh9rh" deleted from default namespace
workflow.argoproj.io "fromtmpl-hckd4" deleted from default namespace
workflow.argoproj.io "override-49wbm" deleted from default namespace
verify: all three Workflows get created, then the controller sorts them out: the bare one ends in Error with workflows must use workflowTemplateRef to be executed when the controller is in reference mode, the override ends in Error with fields [ServiceAccountName] are not permitted when using workflowTemplateRef with templateReferencing restriction, and the plain reference reaches Succeeded.

The UI is just one client. A portal, a CI job, or a chatbot is another, and they all submit the exact same JSON with a ServiceAccount token. Do it by hand once so that integration stops feeling like a black box.

kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
kubectl -n argo port-forward svc/argo-workflows-server 2746:2746 & PF1=$!
sleep 5
kubectl -n argo create sa submitter --dry-run=client -o yaml | kubectl apply -f -
kubectl create clusterrolebinding submitter --clusterrole=admin --serviceaccount=argo:submitter --dry-run=client -o yaml | kubectl apply -f -
TOKEN=$(kubectl -n argo create token submitter --duration=10m)
cat > /tmp/submit.json <<'EOF'
{"namespace":"default","serverDryRun":false,"workflow":{"metadata":{"generateName":"via-api-","namespace":"default"},"spec":{"entrypoint":"work","templates":[{"name":"work","container":{"image":"busybox:1.36","command":["sh","-c"],"args":["echo submitted over http"]}}]}}}
EOF
curl -s -o /tmp/submit-response.json -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d @/tmp/submit.json http://localhost:2746/api/v1/workflows/default
jq '{name: .metadata.name, phase: .status.phase}' /tmp/submit-response.json
kubectl get wf | grep via-api
kill $PF1
kubectl delete clusterrolebinding submitter
kubectl -n argo delete sa submitter
kubectl get wf -o name | grep via-api- | xargs -r kubectl delete
outputcaptured 2026-09-12
$ kubectl create role wf-executor --verb=create,patch --resource=workflowtaskresults.argoproj.io --dry-run=client -o yaml | kubectl apply -f -
role.rbac.authorization.k8s.io/wf-executor unchanged
$ kubectl create rolebinding default-wf-executor --role=wf-executor --serviceaccount=default:default --dry-run=client -o yaml | kubectl apply -f -
rolebinding.rbac.authorization.k8s.io/default-wf-executor unchanged
$ kubectl -n argo port-forward svc/argo-workflows-server 2746:2746 & PF1=$!
$ sleep 5
Forwarding from 127.0.0.1:2746 -> 2746
Forwarding from [::1]:2746 -> 2746
$ kubectl -n argo create sa submitter --dry-run=client -o yaml | kubectl apply -f -
serviceaccount/submitter created
$ kubectl create clusterrolebinding submitter --clusterrole=admin --serviceaccount=argo:submitter --dry-run=client -o yaml | kubectl apply -f -
clusterrolebinding.rbac.authorization.k8s.io/submitter created
$ TOKEN=$(kubectl -n argo create token submitter --duration=10m)
$ cat > /tmp/submit.json <<'EOF'
{"namespace":"default","serverDryRun":false,"workflow":{"metadata":{"generateName":"via-api-","namespace":"default"},"spec":{"entrypoint":"work","templates":[{"name":"work","container":{"image":"busybox:1.36","command":["sh","-c"],"args":["echo submitted over http"]}}]}}}
EOF
$ curl -s -o /tmp/submit-response.json -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d @/tmp/submit.json http://localhost:2746/api/v1/workflows/default
Handling connection for 2746
200
$ jq '{name: .metadata.name, phase: .status.phase}' /tmp/submit-response.json
{
  "name": "via-api-8tft9",
  "phase": null
}
$ kubectl get wf | grep via-api
via-api-8tft9                                
$ kill $PF1
$ kubectl delete clusterrolebinding submitter
clusterrolebinding.rbac.authorization.k8s.io "submitter" deleted
$ kubectl -n argo delete sa submitter
serviceaccount "submitter" deleted from argo namespace
$ kubectl get wf -o name | grep via-api- | xargs -r kubectl delete
workflow.argoproj.io "via-api-8tft9" deleted from default namespace
verify: the HTTP call returns 200 with the generated workflow name, and the workflow shows up in kubectl get wf.

Self-check

answer before opening
Which template type creates Kubernetes objects, and what is its idempotency story?

resource. With action: create, a re-run fails on AlreadyExists; with action: apply, it converges cleanly. Because Workflows don't reconcile, you have to design for duplicate submissions yourself using apply semantics or an existence guard.

A workflow node says forbidden. Where do you look, and what is the classic first offender?

Check the workflow's ServiceAccount and its RBAC bindings, not the workflow spec. The classic first offender in Argo is missing create,patch on workflowtaskresults.argoproj.io, the executor's own reporting channel, which blows up before your intended resource permission is even tried.

When is a workflow the wrong tool, and what replaces it?

Whenever the desired state has to stay true indefinitely. A workflow runs once and walks away. Reach for a controller or operator, or a declarative composition engine like Crossplane or kro that keeps reconciling. Workflows are for sequences with a finish line.

Two DAG tasks with no dependencies: what happens, and how do you gate one on a condition?

They run in parallel. Use dependencies (or depends) for ordering and when for conditional branching against parameters or an earlier task's result. Putting a validation node at the root that everything else depends on is the standard "fail before side effects" pattern.

What turns a Workflow into a self-service product?

Promoting it to a WorkflowTemplate with typed, documented, defaulted parameters, a clean submit surface (UI, CLI, portal, or Backstage action), input validation before side effects, and an auditable record of who ran what. Same logic underneath, packaged as an interface.

A step must run after build whether build succeeded or failed, but only if lint succeeded. How do you express that in a DAG?

Switch from dependencies to depends: depends: "(build.Succeeded || build.Failed) && lint.Succeeded". Those outcome operands (.Succeeded, .Failed, .Errored, .Skipped, .Omitted, .Daemoned) unlock outcome-based ordering, whereas dependencies can only express "after it succeeded".

Two provisioning runs for the same tenant must never execute concurrently, and a nightly job must skip its tick if the previous one is still running. Fields?

Use a workflow-level synchronization.mutexes entry named per tenant (or a ConfigMap-backed semaphores entry of size 1) to serialize runs within a namespace. For the schedule, set CronWorkflow.spec.concurrencyPolicy: Forbid (Replace would kill the active run instead). A waiting Workflow sits in Pending with a message naming the lock, not a scheduling error.

You submit a Workflow with serviceAccountName set and the controller rejects it, although the SA exists. Likely cause?

The controller is running with workflowRestrictions.templateReferencing: Strict or Secure. Under either mode, submissions must use workflowTemplateRef and may only override an allow-listed set of fields (arguments, entrypoint, GC settings, and a few others). Security-sensitive fields like serviceAccountName, volumes, or podSpecPatch belong in the WorkflowTemplate. Move the field there and resubmit.

What does an exit handler see that a normal template does not, and what is the difference between argo stop and argo terminate?

An onExit template (or hooks.exit) runs after the entrypoint finishes and can read {{workflow.status}} (Succeeded, Failed, Error) and {{workflow.failures}}, letting it branch with when. argo stop halts the running nodes and still runs exit handlers, while argo terminate kills everything immediately and skips them. Keep that distinction in mind whenever cleanup logic depends on an exit hook.

Docs to know your way around

study time, not exam time
  • argo-workflows.readthedocs.io: core concepts, the fields reference for resource templates, DAG examples, and the WorkflowTemplate page.
  • The Workflows UI's built-in examples (submit → examples) make a great crib sheet during practice.
  • Offline: kubectl explain workflow.spec.templates --recursive and argo submit --help.
  • argo-workflows.readthedocs.io/en/latest/retries and /synchronization: the two pages whose field names show up verbatim in tasks; /cron-workflows has the full option table with defaults.
  • argo-workflows.readthedocs.io/en/latest/workflow-rbac: the minimal executor Role, plus /argo-server-auth-mode and /access-token for submitting through the API with a ServiceAccount token.