본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

워크플로우 변수 카탈로그 (Workflow variables catalog)

원문 보기 위키 갱신

Argo Workflows 템플릿에서 쓸 수 있는 변수 83개를 한 표로 정리한 카탈로그예요. 어떤 변수가 어느 템플릿 타입과 어느 실행 단계에서 유효한지 매트릭스로 확인할 수 있어요.

출처: Argo Workflows 문서

본문

util/variables에 등록된 내용을 GenerateMarkdown()으로 자동 생성했어요. 총 83개의 변수가 등록돼 있어요.

건너뛴(skipped) 노드와 생략된(omitted) 노드: 스텝이나 태스크가 건너뛰어지면(when이 false로 평가) 또는 생략되면(의존성이 아예 실행되지 않음) 실제 출력을 만들지 않아요. 그래도 outputs.parameters.<name>, outputs.result, outputs.artifacts.<name> 변수는 빈 플레이스홀더 값으로 채워져서, 워크플로우가 확정 불가능한 변수에 갇히는 대신 하위 참조가 빈 값으로 확정돼요.

이 변수들을 실제로 다뤄볼 수 있는 실행 가능한 variables-showcase.yaml 워크플로우가 이 페이지 끝에 실려 있어요.

1. 알파벳순 색인

키 Kind 타입 사용 가능 시점 설명
cronworkflow.annotations cron-workflow map cron-eval CronWorkflow annotations을 map 형태로 담은 값이에요. 중첩 키 접근(cronworkflow.annotations.foo)을 지원해요
cronworkflow.annotations.json cron-workflow json cron-eval CronWorkflow annotations을 JSON 객체로 담은 값이에요
cronworkflow.failed cron-workflow int cron-eval 실패한 하위 Workflow의 개수예요
cronworkflow.labels cron-workflow map cron-eval CronWorkflow labels을 map 형태로 담은 값이에요. 중첩 키 접근(cronworkflow.labels.foo)을 지원해요
cronworkflow.labels.json cron-workflow json cron-eval CronWorkflow labels을 JSON 객체로 담은 값이에요
cronworkflow.lastScheduledTime cron-workflow *time.Time cron-eval cron이 마지막으로 실행을 트리거한 시각이에요. 첫 실행 전에는 nil이에요
cronworkflow.name cron-workflow string cron-eval CronWorkflow 오브젝트의 이름이에요
cronworkflow.namespace cron-workflow string cron-eval CronWorkflow의 네임스페이스예요
cronworkflow.succeeded cron-workflow int cron-eval 성공한 하위 Workflow의 개수예요
duration metric string metric-emission 현재 노드의 경과 시간(초)이에요
exitCode metric string metric-emission 현재 노드 컨테이너의 exit code예요
inputs.artifacts.<name> input wfv1.Artifact during-execute 입력 아티팩트 오브젝트예요 (fromExpression에서 사용)
inputs.artifacts.<name>.path input string during-execute 입력 아티팩트가 pod 안에서 마운트되는 경로예요
inputs.parameters input json during-execute 모든 입력 파라미터를 JSON 배열로 담은 값이에요
inputs.parameters.<name> input string during-execute 확정된 입력 파라미터 값이에요
item item string or json inside-loop 현재 루프 반복의 값이에요 (withItems/withParam). map/list 항목에는 JSON이 들어가요
item.<key> item string inside-loop map 타입 루프 반복 값의 개별 키에 접근하는 접근자예요
lastRetry.duration retry string inside-retry 이전 시도의 소요 시간(초)이에요
lastRetry.exitCode retry string inside-retry 이전 시도의 exit code예요 (첫 시도에서는 0)
lastRetry.message retry string inside-retry 이전 시도의 메시지예요
lastRetry.status retry string inside-retry 이전 시도의 phase예요 (첫 시도에서는 비어 있어요)
node.name node-ctx string pre-dispatch, during-execute 전체 노드 이름이에요
outputs.artifacts.<name>.path output string during-execute 현재 템플릿에서 선언된 출력 아티팩트 경로예요 (pod 쪽)
outputs.parameters.<name> metric string metric-emission 현재 노드의 이름 붙은 출력 파라미터 값이에요 (metric 스코프 전용)
outputs.parameters.<name>.path output string during-execute 현재 템플릿에서 선언된 출력 파라미터 경로예요 (pod 쪽)
outputs.result metric string metric-emission 현재 노드가 캡처한 stdout이에요 (metric 스코프 전용)
pod.name node-ctx string pre-dispatch, during-execute pod를 만드는 템플릿용으로 계산된 pod 이름이에요
resourcesDuration.<resource> metric string metric-emission 현재 노드의 리소스별 사용 시간(초)이에요. Kubernetes 리소스 이름(cpu, memory 등)이 키예요
retries retry string inside-retry 0부터 시작하는 재시도 인덱스예요
status metric string metric-emission 현재 노드의 phase예요
steps.<loopName>.outputs.parameters node-ref json after-loop 하위 노드별 출력 파라미터 map을 담은 JSON 배열이에요
steps.<loopName>.outputs.parameters.<p> node-ref json after-loop 이름 붙은 파라미터 하나를 모든 하위 노드에 걸쳐 모은 JSON 배열이에요
steps.<loopName>.outputs.result node-ref json after-loop 하위 노드 결과를 담은 JSON 배열이에요 (withItems/withParam)
steps.<name>.exitCode node-ref string after-node-complete 컨테이너 exit code예요
steps.<name>.finishedAt node-ref string after-node-complete RFC3339 형식의 종료 시각이에요
steps.<name>.hostNodeName node-ref string after-pod-start 실제 기반이 되는 k8s 노드 이름이에요
steps.<name>.id node-ref string after-node-init 노드 ID예요
steps.<name>.ip node-ref string after-pod-start pod IP예요
steps.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact after-node-succeeded 참조된 노드의 이름 붙은 출력 아티팩트예요
steps.<name>.outputs.parameters.<p> node-ref string after-node-succeeded 참조된 노드의 이름 붙은 출력 파라미터예요
steps.<name>.outputs.result node-ref string after-node-succeeded 캡처된 stdout이에요 (루프가 아닌 노드)
steps.<name>.startedAt node-ref string after-node-init RFC3339 형식의 시작 시각이에요 (컨트롤러가 node-init 시점에, pod 생성 전에 설정. Suspend / HTTP / Plugin / Steps / DAG 같은 pod가 아닌 노드 타입까지 모든 노드 타입에 채워져요)
steps.<name>.status node-ref string after-node-init 노드 phase예요
steps.name node-ctx string pre-dispatch, during-execute 현재 스텝의 이름이에요 (Steps 템플릿 본문 안에서)
tasks.<loopName>.outputs.parameters node-ref json after-loop 하위 노드별 출력 파라미터 map을 담은 JSON 배열이에요
tasks.<loopName>.outputs.parameters.<p> node-ref json after-loop 이름 붙은 파라미터 하나를 모든 하위 노드에 걸쳐 모은 JSON 배열이에요
tasks.<loopName>.outputs.result node-ref json after-loop 하위 노드 결과를 담은 JSON 배열이에요 (withItems/withParam)
tasks.<name>.exitCode node-ref string after-node-complete 컨테이너 exit code예요
tasks.<name>.finishedAt node-ref string after-node-complete RFC3339 형식의 종료 시각이에요
tasks.<name>.hostNodeName node-ref string after-pod-start 실제 기반이 되는 k8s 노드 이름이에요
tasks.<name>.id node-ref string after-node-init 노드 ID예요
tasks.<name>.ip node-ref string after-pod-start pod IP예요
tasks.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact after-node-succeeded 참조된 노드의 이름 붙은 출력 아티팩트예요
tasks.<name>.outputs.parameters.<p> node-ref string after-node-succeeded 참조된 노드의 이름 붙은 출력 파라미터예요
tasks.<name>.outputs.result node-ref string after-node-succeeded 캡처된 stdout이에요 (루프가 아닌 노드)
tasks.<name>.startedAt node-ref string after-node-init RFC3339 형식의 시작 시각이에요 (컨트롤러가 node-init 시점에, pod 생성 전에 설정. Suspend / HTTP / Plugin / Steps / DAG 같은 pod가 아닌 노드 타입까지 모든 노드 타입에 채워져요)
tasks.<name>.status node-ref string after-node-init 노드 phase예요
tasks.name node-ctx string pre-dispatch, during-execute 현재 태스크의 이름이에요 (DAG 템플릿 본문 안에서)
workflow.annotations global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 annotations을 JSON 객체로 담은 값이에요 (deprecated — workflow.annotations.json을 사용하세요)
workflow.annotations.<name> global string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 metadata annotation 값이에요
workflow.annotations.json global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 annotations을 JSON 객체로 담은 값이에요
workflow.creationTimestamp global string workflow-start, pre-dispatch, during-execute, exit-handler RFC3339 형식의 생성 시각이에요
workflow.creationTimestamp.<fmt> global string workflow-start, pre-dispatch, during-execute, exit-handler strftime 형식으로 포맷한 워크플로우 생성 시각이에요. <fmt>는 util/strftime의 문자 중 하나예요
workflow.creationTimestamp.RFC3339 global string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 생성 시각을 RFC3339로 담은 값이에요
workflow.creationTimestamp.s global string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 생성 시각을 Unix 초 단위로 담은 값이에요
workflow.duration runtime string pre-dispatch, during-execute, exit-handler 경과 초를 float 문자열로 담은 값이에요. exit handler에서 최종 값이 돼요
workflow.failures runtime json exit-handler 실패한 노드들의 기술자예요. 와이어 형식은 strconv.Quote로 감싼 JSON 문자열이라 소비자는 JSON을 두 번 디코딩해야 해요. 실패한 노드가 없을 때는 빈 배열이 아니라 문자 그대로 6문자짜리 문자열 "null"(따옴표 포함)이에요
workflow.labels global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 labels을 JSON 객체로 담은 값이에요 (deprecated — workflow.labels.json을 사용하세요)
workflow.labels.<name> global string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 metadata label 값이에요
workflow.labels.json global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 labels을 JSON 객체로 담은 값이에요
workflow.mainEntrypoint global string workflow-start, pre-dispatch, during-execute, exit-handler spec.entrypoint예요
workflow.name global string workflow-start, pre-dispatch, during-execute, exit-handler Workflow 오브젝트의 이름이에요
workflow.namespace global string workflow-start, pre-dispatch, during-execute, exit-handler Workflow의 네임스페이스예요
workflow.outputs.artifacts.<name> node-ref wfv1.Artifact during-execute, exit-handler 전역 출력 아티팩트예요 (outputs.artifacts[*].globalName으로 끌어올려진 값)
workflow.outputs.parameters.<name> node-ref string during-execute, exit-handler 전역 출력 파라미터예요 (outputs.parameters[*].globalName으로 끌어올려진 값)
workflow.parameters global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 파라미터를 JSON 배열로 담은 값이에요
workflow.parameters.<name> global string workflow-start, pre-dispatch, during-execute, exit-handler spec.arguments.parameters에서 온 값이에요. ValueFrom이 설정돼 있으면 ConfigMap으로 확정돼요
workflow.parameters.json global json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 파라미터를 JSON 배열로 담은 값이에요 (workflow.parameters의 별칭)
workflow.priority global string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 우선순위예요. 조건부 변수라 spec.priority가 설정된 경우에만 확정돼요. 그 외에는 lint와 런타임 모두 이 참조를 undefined로 다뤄요 (빈 값/0으로 대체하지 않아요)
workflow.scheduledTime global string workflow-start, pre-dispatch, during-execute, exit-handler cron으로 트리거된 워크플로우의 예약 시각이에요. 조건부 변수라 annotation workflows.argoproj.io/scheduled-time이 있을 때만 확정돼요 (cron 컨트롤러가 자동으로 설정해요). lint는 prefix 예외로 통과하지만 cron이 아닌 Workflow에서는 런타임이 값을 빈 문자열로 바꾸지 않고 그대로 {{workflow.scheduledTime}}을 남겨요
workflow.serviceAccountName global string workflow-start, pre-dispatch, during-execute, exit-handler 실제 적용되는 서비스 어카운트 이름이에요
workflow.status runtime string pre-dispatch, during-execute, exit-handler 현재 워크플로우 phase예요. 최종 값은 exit handler에서만 확정돼요
workflow.uid global string workflow-start, pre-dispatch, during-execute, exit-handler Workflow UID예요

2. Kind별 그룹

Global

키 타입 사용 가능 시점 설명
workflow.annotations json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 annotations을 JSON 객체로 담은 값이에요 (deprecated — workflow.annotations.json을 사용하세요)
workflow.annotations.<name> string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 metadata annotation 값이에요
workflow.annotations.json json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 annotations을 JSON 객체로 담은 값이에요
workflow.creationTimestamp string workflow-start, pre-dispatch, during-execute, exit-handler RFC3339 형식의 생성 시각이에요
workflow.creationTimestamp.<fmt> string workflow-start, pre-dispatch, during-execute, exit-handler strftime 형식으로 포맷한 워크플로우 생성 시각이에요. <fmt>는 util/strftime의 문자 중 하나예요
workflow.creationTimestamp.RFC3339 string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 생성 시각을 RFC3339로 담은 값이에요
workflow.creationTimestamp.s string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 생성 시각을 Unix 초 단위로 담은 값이에요
workflow.labels json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 labels을 JSON 객체로 담은 값이에요 (deprecated — workflow.labels.json을 사용하세요)
workflow.labels.<name> string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 metadata label 값이에요
workflow.labels.json json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 labels을 JSON 객체로 담은 값이에요
workflow.mainEntrypoint string workflow-start, pre-dispatch, during-execute, exit-handler spec.entrypoint예요
workflow.name string workflow-start, pre-dispatch, during-execute, exit-handler Workflow 오브젝트의 이름이에요
workflow.namespace string workflow-start, pre-dispatch, during-execute, exit-handler Workflow의 네임스페이스예요
workflow.parameters json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 파라미터를 JSON 배열로 담은 값이에요
workflow.parameters.<name> string workflow-start, pre-dispatch, during-execute, exit-handler spec.arguments.parameters에서 온 값이에요. ValueFrom이 설정돼 있으면 ConfigMap으로 확정돼요
workflow.parameters.json json workflow-start, pre-dispatch, during-execute, exit-handler 모든 워크플로우 파라미터를 JSON 배열로 담은 값이에요 (workflow.parameters의 별칭)
workflow.priority string workflow-start, pre-dispatch, during-execute, exit-handler 워크플로우 우선순위예요. 조건부 변수라 spec.priority가 설정된 경우에만 확정돼요. 그 외에는 lint와 런타임 모두 이 참조를 undefined로 다뤄요 (빈 값/0으로 대체하지 않아요)
workflow.scheduledTime string workflow-start, pre-dispatch, during-execute, exit-handler cron으로 트리거된 워크플로우의 예약 시각이에요. 조건부 변수라 annotation workflows.argoproj.io/scheduled-time이 있을 때만 확정돼요 (cron 컨트롤러가 자동으로 설정해요). lint는 prefix 예외로 통과하지만 cron이 아닌 Workflow에서는 런타임이 값을 빈 문자열로 바꾸지 않고 그대로 {{workflow.scheduledTime}}을 남겨요
workflow.serviceAccountName string workflow-start, pre-dispatch, during-execute, exit-handler 실제 적용되는 서비스 어카운트 이름이에요
workflow.uid string workflow-start, pre-dispatch, during-execute, exit-handler Workflow UID예요

Runtime

키 타입 사용 가능 시점 설명
workflow.duration string pre-dispatch, during-execute, exit-handler 경과 초를 float 문자열로 담은 값이에요. exit handler에서 최종 값이 돼요
workflow.failures json exit-handler 실패한 노드들의 기술자예요. 와이어 형식은 strconv.Quote로 감싼 JSON 문자열이라 소비자는 JSON을 두 번 디코딩해야 해요. 실패한 노드가 없을 때는 빈 배열이 아니라 문자 그대로 6문자짜리 문자열 "null"(따옴표 포함)이에요
workflow.status string pre-dispatch, during-execute, exit-handler 현재 워크플로우 phase예요. 최종 값은 exit handler에서만 확정돼요

Input

키 타입 사용 가능 시점 설명
inputs.artifacts.<name> wfv1.Artifact during-execute 입력 아티팩트 오브젝트예요 (fromExpression에서 사용)
inputs.artifacts.<name>.path string during-execute 입력 아티팩트가 pod 안에서 마운트되는 경로예요
inputs.parameters json during-execute 모든 입력 파라미터를 JSON 배열로 담은 값이에요
inputs.parameters.<name> string during-execute 확정된 입력 파라미터 값이에요

Output

키 타입 사용 가능 시점 설명
outputs.artifacts.<name>.path string during-execute 현재 템플릿에서 선언된 출력 아티팩트 경로예요 (pod 쪽)
outputs.parameters.<name>.path string during-execute 현재 템플릿에서 선언된 출력 파라미터 경로예요 (pod 쪽)

Node-ref

키 타입 사용 가능 시점 설명
steps.<loopName>.outputs.parameters json after-loop 하위 노드별 출력 파라미터 map을 담은 JSON 배열이에요
steps.<loopName>.outputs.parameters.<p> json after-loop 이름 붙은 파라미터 하나를 모든 하위 노드에 걸쳐 모은 JSON 배열이에요
steps.<loopName>.outputs.result json after-loop 하위 노드 결과를 담은 JSON 배열이에요 (withItems/withParam)
steps.<name>.exitCode string after-node-complete 컨테이너 exit code예요
steps.<name>.finishedAt string after-node-complete RFC3339 형식의 종료 시각이에요
steps.<name>.hostNodeName string after-pod-start 실제 기반이 되는 k8s 노드 이름이에요
steps.<name>.id string after-node-init 노드 ID예요
steps.<name>.ip string after-pod-start pod IP예요
steps.<name>.outputs.artifacts.<a> wfv1.Artifact after-node-succeeded 참조된 노드의 이름 붙은 출력 아티팩트예요
steps.<name>.outputs.parameters.<p> string after-node-succeeded 참조된 노드의 이름 붙은 출력 파라미터예요
steps.<name>.outputs.result string after-node-succeeded 캡처된 stdout이에요 (루프가 아닌 노드)
steps.<name>.startedAt string after-node-init RFC3339 형식의 시작 시각이에요 (컨트롤러가 node-init 시점에, pod 생성 전에 설정. Suspend / HTTP / Plugin / Steps / DAG 같은 pod가 아닌 노드 타입까지 모든 노드 타입에 채워져요)
steps.<name>.status string after-node-init 노드 phase예요
tasks.<loopName>.outputs.parameters json after-loop 하위 노드별 출력 파라미터 map을 담은 JSON 배열이에요
tasks.<loopName>.outputs.parameters.<p> json after-loop 이름 붙은 파라미터 하나를 모든 하위 노드에 걸쳐 모은 JSON 배열이에요
tasks.<loopName>.outputs.result json after-loop 하위 노드 결과를 담은 JSON 배열이에요 (withItems/withParam)
tasks.<name>.exitCode string after-node-complete 컨테이너 exit code예요
tasks.<name>.finishedAt string after-node-complete RFC3339 형식의 종료 시각이에요
tasks.<name>.hostNodeName string after-pod-start 실제 기반이 되는 k8s 노드 이름이에요
tasks.<name>.id string after-node-init 노드 ID예요
tasks.<name>.ip string after-pod-start pod IP예요
tasks.<name>.outputs.artifacts.<a> wfv1.Artifact after-node-succeeded 참조된 노드의 이름 붙은 출력 아티팩트예요
tasks.<name>.outputs.parameters.<p> string after-node-succeeded 참조된 노드의 이름 붙은 출력 파라미터예요
tasks.<name>.outputs.result string after-node-succeeded 캡처된 stdout이에요 (루프가 아닌 노드)
tasks.<name>.startedAt string after-node-init RFC3339 형식의 시작 시각이에요 (컨트롤러가 node-init 시점에, pod 생성 전에 설정. Suspend / HTTP / Plugin / Steps / DAG 같은 pod가 아닌 노드 타입까지 모든 노드 타입에 채워져요)
tasks.<name>.status string after-node-init 노드 phase예요
workflow.outputs.artifacts.<name> wfv1.Artifact during-execute, exit-handler 전역 출력 아티팩트예요 (outputs.artifacts[*].globalName으로 끌어올려진 값)
workflow.outputs.parameters.<name> string during-execute, exit-handler 전역 출력 파라미터예요 (outputs.parameters[*].globalName으로 끌어올려진 값)

Item

키 타입 사용 가능 시점 설명
item string or json inside-loop 현재 루프 반복의 값이에요 (withItems/withParam). map/list 항목에는 JSON이 들어가요
item.<key> string inside-loop map 타입 루프 반복 값의 개별 키에 접근하는 접근자예요

Retry

키 타입 사용 가능 시점 설명
lastRetry.duration string inside-retry 이전 시도의 소요 시간(초)이에요
lastRetry.exitCode string inside-retry 이전 시도의 exit code예요 (첫 시도에서는 0)
lastRetry.message string inside-retry 이전 시도의 메시지예요
lastRetry.status string inside-retry 이전 시도의 phase예요 (첫 시도에서는 비어 있어요)
retries string inside-retry 0부터 시작하는 재시도 인덱스예요

Node-ctx

키 타입 사용 가능 시점 설명
node.name string pre-dispatch, during-execute 전체 노드 이름이에요
pod.name string pre-dispatch, during-execute pod를 만드는 템플릿용으로 계산된 pod 이름이에요
steps.name string pre-dispatch, during-execute 현재 스텝의 이름이에요 (Steps 템플릿 본문 안에서)
tasks.name string pre-dispatch, during-execute 현재 태스크의 이름이에요 (DAG 템플릿 본문 안에서)

Metric

키 타입 사용 가능 시점 설명
duration string metric-emission 현재 노드의 경과 시간(초)이에요
exitCode string metric-emission 현재 노드 컨테이너의 exit code예요
outputs.parameters.<name> string metric-emission 현재 노드의 이름 붙은 출력 파라미터 값이에요 (metric 스코프 전용)
outputs.result string metric-emission 현재 노드가 캡처한 stdout이에요 (metric 스코프 전용)
resourcesDuration.<resource> string metric-emission 현재 노드의 리소스별 사용 시간(초)이에요. Kubernetes 리소스 이름(cpu, memory 등)이 키예요
status string metric-emission 현재 노드의 phase예요

Cron-workflow

키 타입 사용 가능 시점 설명
cronworkflow.annotations map cron-eval CronWorkflow annotations을 map 형태로 담은 값이에요. 중첩 키 접근(cronworkflow.annotations.foo)을 지원해요
cronworkflow.annotations.json json cron-eval CronWorkflow annotations을 JSON 객체로 담은 값이에요
cronworkflow.failed int cron-eval 실패한 하위 Workflow의 개수예요
cronworkflow.labels map cron-eval CronWorkflow labels을 map 형태로 담은 값이에요. 중첩 키 접근(cronworkflow.labels.foo)을 지원해요
cronworkflow.labels.json json cron-eval CronWorkflow labels을 JSON 객체로 담은 값이에요
cronworkflow.lastScheduledTime *time.Time cron-eval cron이 마지막으로 실행을 트리거한 시각이에요. 첫 실행 전에는 nil이에요
cronworkflow.name string cron-eval CronWorkflow 오브젝트의 이름이에요
cronworkflow.namespace string cron-eval CronWorkflow의 네임스페이스예요
cronworkflow.succeeded int cron-eval 성공한 하위 Workflow의 개수예요

3. TemplateKind별 매트릭스

템플릿 타입별로 어떤 변수가 스코프 안에 들어오는지 보여줘요. •는 스코프 안, 빈칸은 스코프 밖이에요.

키 any container container-set script resource steps dag data suspend http plugin exit-handler cron-workflow
cronworkflow.annotations •
cronworkflow.annotations.json •
cronworkflow.failed •
cronworkflow.labels •
cronworkflow.labels.json •
cronworkflow.lastScheduledTime •
cronworkflow.name •
cronworkflow.namespace •
cronworkflow.succeeded •
duration • • • • • • • • • • • •
exitCode • • • • • • • • • • • •
inputs.artifacts.<name> • • • • • • • • • • • •
inputs.artifacts.<name>.path • • • • • •
inputs.parameters • • • • • • • • • • • •
inputs.parameters.<name> • • • • • • • • • • • •
item • • • • • • • • • • •
item.<key> • • • • • • • • • • •
lastRetry.duration • • • • • • • • •
lastRetry.exitCode • • • • • • • • •
lastRetry.message • • • • • • • • •
lastRetry.status • • • • • • • • •
node.name • • • • • • • • • • • •
outputs.artifacts.<name>.path • • • • • •
outputs.parameters.<name> • • • • • • • • • • • •
outputs.parameters.<name>.path • • • • • •
outputs.result • • • • • • • • • • • •
pod.name • • • • • •
resourcesDuration.<resource> • • • • • • • • • • • •
retries • • • • • • • • •
status • • • • • • • • • • • •
steps.<loopName>.outputs.parameters • •
steps.<loopName>.outputs.parameters.<p> • •
steps.<loopName>.outputs.result • •
steps.<name>.exitCode • •
steps.<name>.finishedAt • •
steps.<name>.hostNodeName • •
steps.<name>.id • •
steps.<name>.ip • •
steps.<name>.outputs.artifacts.<a> • •
steps.<name>.outputs.parameters.<p> • •
steps.<name>.outputs.result • •
steps.<name>.startedAt • •
steps.<name>.status • •
steps.name •
tasks.<loopName>.outputs.parameters • •
tasks.<loopName>.outputs.parameters.<p> • •
tasks.<loopName>.outputs.result • •
tasks.<name>.exitCode • •
tasks.<name>.finishedAt • •
tasks.<name>.hostNodeName • •
tasks.<name>.id • •
tasks.<name>.ip • •
tasks.<name>.outputs.artifacts.<a> • •
tasks.<name>.outputs.parameters.<p> • •
tasks.<name>.outputs.result • •
tasks.<name>.startedAt • •
tasks.<name>.status • •
tasks.name •
workflow.annotations • • • • • • • • • • • •
workflow.annotations.<name> • • • • • • • • • • • •
workflow.annotations.json • • • • • • • • • • • •
workflow.creationTimestamp • • • • • • • • • • • •
workflow.creationTimestamp.<fmt> • • • • • • • • • • • •
workflow.creationTimestamp.RFC3339 • • • • • • • • • • • •
workflow.creationTimestamp.s • • • • • • • • • • • •
workflow.duration • • • • • • • • • • • •
workflow.failures • •
workflow.labels • • • • • • • • • • • •
workflow.labels.<name> • • • • • • • • • • • •
workflow.labels.json • • • • • • • • • • • •
workflow.mainEntrypoint • • • • • • • • • • • •
workflow.name • • • • • • • • • • • •
workflow.namespace • • • • • • • • • • • •
workflow.outputs.artifacts.<name> • • • • • • • • • • • •
workflow.outputs.parameters.<name> • • • • • • • • • • • •
workflow.parameters • • • • • • • • • • • •
workflow.parameters.<name> • • • • • • • • • • • •
workflow.parameters.json • • • • • • • • • • • •
workflow.priority • • • • • • • • • • • •
workflow.scheduledTime • • • • • • • • • • • •
workflow.serviceAccountName • • • • • • • • • • • •
workflow.status • • • • • • • • • • • •
workflow.uid • • • • • • • • • • • •

4. LifecyclePhase별 그룹

Phase 의미
workflow-start 템플릿이 실행되기 전에 전역 변수들이 한꺼번에 먼저 채워져요
pre-dispatch 템플릿의 pod가 만들어지기 직전이에요. pod.name / node.name / steps.name / tasks.name이 설정돼요
during-execute 템플릿 본문 안이에요. inputs.*가 바인딩돼요
inside-loop withItems/withParam 확장 안이에요. item, item.<key>가 바인딩돼요
inside-retry retryStrategy 템플릿 안이에요. retries.*가 바인딩돼요
after-node-init 참조된 노드가 컨트롤러에 의해 초기화된 상태예요 (id, status, startedAt가 채워짐 — startedAt는 pod 생성 전 node-init 시점에 설정되며, Suspend / HTTP / Plugin / Steps / DAG 같은 pod가 아닌 노드 타입까지 모든 노드 타입에 채워져요)
after-pod-start 참조된 노드의 pod가 시작된 상태예요. ip, hostNodeName가 채워져요 (k8s가 제공하는 값이라 pod가 아닌 노드 타입에서는 의미가 없어요)
after-node-complete 참조된 노드가 끝난 상태예요 (어떤 종료 phase든). finishedAt, exitCode가 채워져요
after-node-succeeded 참조된 노드가 Succeeded로 끝난 상태예요. outputs.result, outputs.parameters.*, outputs.artifacts.*가 채워져요
after-loop withItems/withParam 그룹의 모든 하위 노드가 완료된 상태예요. 집계된 출력이 나타나요
exit-handler onExit 템플릿이 실행되는 단계예요. workflow.{status,failures,duration}가 최종 값이 돼요. 이전 단계의 변수도 모두 여기서 볼 수 있어요 (스코프가 누적돼요)
metric-emission Prometheus metric 표현식 안이에요. duration, status, exitCode, resourcesDuration.<resource>, 그리고 현재 노드의 bare outputs.result / outputs.parameters.<name>이 추가돼요
cron-eval CronWorkflow의 spec.when이나 spec.stopStrategy.expression을 평가하는 단계예요. cron 오브젝트의 식별 정보, labels/annotations, 실행 횟수를 담은 cronworkflow.* 변수들이 추가돼요

workflow-start (변수 20개)

키 Kind 타입
workflow.annotations global json
workflow.annotations.<name> global string
workflow.annotations.json global json
workflow.creationTimestamp global string
workflow.creationTimestamp.<fmt> global string
workflow.creationTimestamp.RFC3339 global string
workflow.creationTimestamp.s global string
workflow.labels global json
workflow.labels.<name> global string
workflow.labels.json global json
workflow.mainEntrypoint global string
workflow.name global string
workflow.namespace global string
workflow.parameters global json
workflow.parameters.<name> global string
workflow.parameters.json global json
workflow.priority global string
workflow.scheduledTime global string
workflow.serviceAccountName global string
workflow.uid global string

pre-dispatch (변수 26개)

키 Kind 타입
node.name node-ctx string
pod.name node-ctx string
steps.name node-ctx string
tasks.name node-ctx string
workflow.annotations global json
workflow.annotations.<name> global string
workflow.annotations.json global json
workflow.creationTimestamp global string
workflow.creationTimestamp.<fmt> global string
workflow.creationTimestamp.RFC3339 global string
workflow.creationTimestamp.s global string
workflow.duration runtime string
workflow.labels global json
workflow.labels.<name> global string
workflow.labels.json global json
workflow.mainEntrypoint global string
workflow.name global string
workflow.namespace global string
workflow.parameters global json
workflow.parameters.<name> global string
workflow.parameters.json global json
workflow.priority global string
workflow.scheduledTime global string
workflow.serviceAccountName global string
workflow.status runtime string
workflow.uid global string

during-execute (변수 34개)

키 Kind 타입
inputs.artifacts.<name> input wfv1.Artifact
inputs.artifacts.<name>.path input string
inputs.parameters input json
inputs.parameters.<name> input string
node.name node-ctx string
outputs.artifacts.<name>.path output string
outputs.parameters.<name>.path output string
pod.name node-ctx string
steps.name node-ctx string
tasks.name node-ctx string
workflow.annotations global json
workflow.annotations.<name> global string
workflow.annotations.json global json
workflow.creationTimestamp global string
workflow.creationTimestamp.<fmt> global string
workflow.creationTimestamp.RFC3339 global string
workflow.creationTimestamp.s global string
workflow.duration runtime string
workflow.labels global json
workflow.labels.<name> global string
workflow.labels.json global json
workflow.mainEntrypoint global string
workflow.name global string
workflow.namespace global string
workflow.outputs.artifacts.<name> node-ref wfv1.Artifact
workflow.outputs.parameters.<name> node-ref string
workflow.parameters global json
workflow.parameters.<name> global string
workflow.parameters.json global json
workflow.priority global string
workflow.scheduledTime global string
workflow.serviceAccountName global string
workflow.status runtime string
workflow.uid global string

inside-loop (변수 2개)

키 Kind 타입
item item string or json
item.<key> item string

inside-retry (변수 5개)

키 Kind 타입
lastRetry.duration retry string
lastRetry.exitCode retry string
lastRetry.message retry string
lastRetry.status retry string
retries retry string

after-node-init (변수 6개)

키 Kind 타입
steps.<name>.id node-ref string
steps.<name>.startedAt node-ref string
steps.<name>.status node-ref string
tasks.<name>.id node-ref string
tasks.<name>.startedAt node-ref string
tasks.<name>.status node-ref string

after-pod-start (변수 4개)

키 Kind 타입
steps.<name>.hostNodeName node-ref string
steps.<name>.ip node-ref string
tasks.<name>.hostNodeName node-ref string
tasks.<name>.ip node-ref string

after-node-complete (변수 4개)

키 Kind 타입
steps.<name>.exitCode node-ref string
steps.<name>.finishedAt node-ref string
tasks.<name>.exitCode node-ref string
tasks.<name>.finishedAt node-ref string

after-node-succeeded (변수 6개)

키 Kind 타입
steps.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact
steps.<name>.outputs.parameters.<p> node-ref string
steps.<name>.outputs.result node-ref string
tasks.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact
tasks.<name>.outputs.parameters.<p> node-ref string
tasks.<name>.outputs.result node-ref string

after-loop (변수 6개)

키 Kind 타입
steps.<loopName>.outputs.parameters node-ref json
steps.<loopName>.outputs.parameters.<p> node-ref json
steps.<loopName>.outputs.result node-ref json
tasks.<loopName>.outputs.parameters node-ref json
tasks.<loopName>.outputs.parameters.<p> node-ref json
tasks.<loopName>.outputs.result node-ref json

exit-handler (변수 55개)

키 Kind 타입
inputs.artifacts.<name>.path input string
outputs.artifacts.<name>.path output string
outputs.parameters.<name>.path output string
pod.name node-ctx string
steps.<loopName>.outputs.parameters node-ref json
steps.<loopName>.outputs.parameters.<p> node-ref json
steps.<loopName>.outputs.result node-ref json
steps.<name>.exitCode node-ref string
steps.<name>.finishedAt node-ref string
steps.<name>.hostNodeName node-ref string
steps.<name>.id node-ref string
steps.<name>.ip node-ref string
steps.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact
steps.<name>.outputs.parameters.<p> node-ref string
steps.<name>.outputs.result node-ref string
steps.<name>.startedAt node-ref string
steps.<name>.status node-ref string
tasks.<loopName>.outputs.parameters node-ref json
tasks.<loopName>.outputs.parameters.<p> node-ref json
tasks.<loopName>.outputs.result node-ref json
tasks.<name>.exitCode node-ref string
tasks.<name>.finishedAt node-ref string
tasks.<name>.hostNodeName node-ref string
tasks.<name>.id node-ref string
tasks.<name>.ip node-ref string
tasks.<name>.outputs.artifacts.<a> node-ref wfv1.Artifact
tasks.<name>.outputs.parameters.<p> node-ref string
tasks.<name>.outputs.result node-ref string
tasks.<name>.startedAt node-ref string
tasks.<name>.status node-ref string
workflow.annotations global json
workflow.annotations.<name> global string
workflow.annotations.json global json
workflow.creationTimestamp global string
workflow.creationTimestamp.<fmt> global string
workflow.creationTimestamp.RFC3339 global string
workflow.creationTimestamp.s global string
workflow.duration runtime string
workflow.failures runtime json
workflow.labels global json
workflow.labels.<name> global string
workflow.labels.json global json
workflow.mainEntrypoint global string
workflow.name global string
workflow.namespace global string
workflow.outputs.artifacts.<name> node-ref wfv1.Artifact
workflow.outputs.parameters.<name> node-ref string
workflow.parameters global json
workflow.parameters.<name> global string
workflow.parameters.json global json
workflow.priority global string
workflow.scheduledTime global string
workflow.serviceAccountName global string
workflow.status runtime string
workflow.uid global string

metric-emission (변수 6개)

키 Kind 타입
duration metric string
exitCode metric string
outputs.parameters.<name> metric string
outputs.result metric string
resourcesDuration.<resource> metric string
status metric string

cron-eval (변수 9개)

키 Kind 타입
cronworkflow.annotations cron-workflow map
cronworkflow.annotations.json cron-workflow json
cronworkflow.failed cron-workflow int
cronworkflow.labels cron-workflow map
cronworkflow.labels.json cron-workflow json
cronworkflow.lastScheduledTime cron-workflow *time.Time
cronworkflow.name cron-workflow string
cronworkflow.namespace cron-workflow string
cronworkflow.succeeded cron-workflow int

5. 쇼케이스 워크플로우

아래 예제는 앞에서 정리한 변수들을 실제로 사용해 봐요. docs 빌드 시점에 examples/variables-showcase.yaml(예제 테스트가 검증하고 실행하는 바로 그 파일)에서 삽입돼요.

--8<-- "examples/variables-showcase.yaml"

더 알아보기 (Learn more)