
A WorkflowTemplate stores common templates in a namespace so teams can share and reuse steps like functions from a library. Use templates to standardize CI/CD tasks such as builds, tests, and deployments.
How to define a WorkflowTemplate
Defining a WorkflowTemplate is the same as defining a Workflow, except the resource kind is WorkflowTemplate. That tells Argo to store the definition as a reusable template rather than executing it immediately. Example WorkflowTemplate (cowsay):argo template create <file>).
Reusing a WorkflowTemplate
Once a WorkflowTemplate exists in a namespace, you can reuse it in two primary ways:- templateRef — call a single template from the WorkflowTemplate as a step inside a larger workflow (like importing a single function from a library).
- workflowTemplateRef — run the entire WorkflowTemplate as a complete workflow, using its specified entrypoint and arguments.
Example: calling a single template from a WorkflowTemplate using templateRef
ClusterWorkflowTemplate
A ClusterWorkflowTemplate is the cluster-scoped equivalent of WorkflowTemplate. It is not tied to a namespace and is available cluster-wide — a good fit for platform teams that must provide approved, central templates to multiple namespaces. Example ClusterWorkflowTemplate:When referencing cluster-scoped templates (ClusterWorkflowTemplate), always set clusterScope: true in templateRef or workflowTemplateRef. ClusterWorkflowTemplates are not namespaced, so this flag tells Argo the reference is to a cluster-level resource.