Skip to main content

Template

Struct Template 

Source
pub struct Template {
Show 19 fields pub name: String, pub metadata: Option<ObjectMeta>, pub inputs: Option<Inputs>, pub outputs: Option<Outputs>, pub container: Option<Container>, pub dag: Option<DagTemplate>, pub daemon: Option<bool>, pub volumes: Vec<Volume>, pub service_account_name: String, pub node_selector: BTreeMap<String, String>, pub steps: Vec<Vec<DagTask>>, pub retry_strategy: Option<RetryStrategy>, pub timeout: String, pub active_deadline_seconds: Option<i32>, pub synchronization: Option<Synchronization>, pub tolerations: Vec<Toleration>, pub affinity: Option<Value>, pub pod_spec_patch: Option<String>, pub parallelism: Option<i64>,
}

Fields§

§name: String§metadata: Option<ObjectMeta>

Argo Template.metadata — annotations + labels on the pod/dag/steps template. Optional, skip-serialized when empty, so existing goldens stay byte-identical for templates that don’t use the annotations = {…} attr.

§inputs: Option<Inputs>§outputs: Option<Outputs>§container: Option<Container>§dag: Option<DagTemplate>§daemon: Option<bool>

#[container(daemon)] → Argo Template.daemon: true. The pod is treated as long-running: the workflow proceeds to dependents as soon as the container reaches READINESS (not completion), and Argo terminates the daemon when its boundary node finishes. Container/script templates only (no-op on dag/steps). Two Argo gotchas the user must know: a daemon pod that exits Succeeded is marked FAILED (daemons are expected to run indefinitely), and retryStrategy only covers the startup phase (failures after readiness are ignored). athena has no readinessProbe attr — use pod_spec_patch to add one if Ready timing matters.

§volumes: Vec<Volume>§service_account_name: String

Per-template SA override (Argo runs the pod as this).

§node_selector: BTreeMap<String, String>

Template-level pod scheduling (container templates).

§steps: Vec<Vec<DagTask>>

#[workflow(steps)] body: Argo steps is a list of lists — inner runs in parallel, outer sequentially. Plain serde nests Vec<Vec<_>> natively (no proto wrapper needed).

§retry_strategy: Option<RetryStrategy>

Template-level retry policy (#[container/workflow(retry(..))]).

§timeout: String

Template-level timeout duration (#[…(timeout = "5m")]).

§active_deadline_seconds: Option<i32>

Template-level deadline (#[…(active_deadline = …)]) → Argo Template.activeDeadlineSeconds (per-pod; applies even when this template is templateRef’d — NOT root-only).

§synchronization: Option<Synchronization>

Template-level Synchronization — per-step mutexes (#[…(mutexes = [{ name = … }])]). Holder key is <ns>/<wf>/<node>, so within ONE run two nodes referencing the same template-level mutex serialize, AND nodes across separate runs (same name + ns) also serialize. Both inputs.parameters and workflow.parameters substitution resolve at this scope (no nodeSelector-style boundary-copy footgun — proven v4.0.5 2026-05-25).

§tolerations: Vec<Toleration>

Template-level tolerations on a container WT, from #[container(tolerations = [...])]. Substitution at this scope is safe for the template’s own pod (the pod renders from the substituted template); empirically verified on v4.0.5 2026-05-26.

§affinity: Option<Value>

Template-level pod affinity on a container WT, from #[container(affinity = "...")]. Opaque YAML/JSON value (athena does NOT model apiv1.Affinity by design — use pod_spec_patch as the all-purpose alternative).

§pod_spec_patch: Option<String>

Template-level strategic-merge patch applied to this template’s pod after Argo renders it. From #[container(pod_spec_patch = "...")]. Substituted at pod-creation time, so {{inputs.parameters.X}} resolves (proven v4.0.5 2026-05-26 - the patch goes through the same processPodSpecPatchProcessArgs pass that renders the substituted template, so the leaf-pod inherits the resolved value without the nodeSelector-style boundary-copy footgun).

§parallelism: Option<i64>

Template-level pod-concurrency cap on this dag/steps. From #[workflow(parallelism = N)]. Caps concurrent children scheduled under THIS template invocation only — pods created by nested templates don’t count. Argo’s CRD enforces +kubebuilder:validation:Minimum=1.

Trait Implementations§

Source§

impl Clone for Template

Source§

fn clone(&self) -> Template

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Template

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Template

Source§

fn default() -> Template

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Template

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Template

Source§

fn eq(&self, other: &Template) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Template

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Template

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.