{"record":{"id":"03b655e59d0e0742","repo":"argoproj/argo-workflows","slug":"failed-to-resolve-references-w","errorCode":null,"errorMessage":"failed to resolve references: %w","messagePattern":"failed to resolve references: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/controller/steps.go","lineNumber":569,"sourceCode":"\terrCh := make(chan error, len(stepGroup)) // contains the error during resolveStepReferences\n\tvar wg sync.WaitGroup\n\tfor i, step := range stepGroup {\n\t\tparallelStepNum <- step.Name\n\t\twg.Go(func() {\n\t\t\tif refErr := resolveStepReferences(i, step, newStepGroup); refErr != nil {\n\t\t\t\twoc.log.WithFields(logging.Fields{\"stepName\": step.Name}).WithError(refErr).Error(ctx, \"Failed to resolve references\")\n\t\t\t\terrCh <- refErr\n\t\t\t}\n\t\t\t<-parallelStepNum\n\t\t})\n\t}\n\twg.Wait()\n\n\tif err := errorFromChannel(errCh); err != nil { // fetch the first error during resolveStepReferences\n\t\tif errors.Is(err, ErrRequeue) {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to resolve references: %w\", err)\n\t}\n\treturn newStepGroup, nil\n}\n\n// expandStepGroup looks at each step in a collection of parallel steps, and expands all steps using withItems/withParam\nfunc (woc *wfOperationCtx) expandStepGroup(ctx context.Context, sgNodeName string, stepGroup []wfv1.WorkflowStep, stepsCtx *stepsContext) ([]wfv1.WorkflowStep, error) {\n\tnewStepGroup := make([]wfv1.WorkflowStep, 0)\n\tfor _, step := range stepGroup {\n\t\tif !step.ShouldExpand() {\n\t\t\tnewStepGroup = append(newStepGroup, step)\n\t\t\tcontinue\n\t\t}\n\t\texpandedStep, err := woc.expandStep(ctx, step, stepsCtx.scope)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(expandedStep) == 0 {\n\t\t\t// Empty list","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/controller/steps.go#L551-L587","documentation":"resolveReferences resolves step inputs in parallel (goroutines reporting to errCh). After wg.Wait(), the first error collected is returned; unless it is ErrRequeue (transient, retried), it is wrapped as 'failed to resolve references'. It is the aggregate wrapper for any per-step input resolution failure.","triggerScenarios":"Any step in the group fails parameter/artifact reference resolution during expandStepGroup — e.g. unresolved {{steps.*}} expressions, missing outputs — and the error is not an ErrRequeue.","commonSituations":"Referencing outputs of a skipped or failed step; malformed template expressions; wrong variable names in inputs.parameters.value.","solutions":["Look at the wrapped inner error to find which step/reference failed","Fix the referenced expression or mark inputs optional where appropriate","If it's ErrRequeue-related (transient), the controller will retry automatically — check controller logs if it persists"],"exampleFix":"// before\n- name: use\n  template: consume\n  arguments:\n    parameters:\n      - name: x\n        value: '{{steps.build.outputs.parameters.x}}' // build skipped -> unresolved\n// after\n- name: use\n  template: consume\n  when: '{{steps.build.status}} == Succeeded'\n  arguments:\n    parameters:\n      - name: x\n        value: '{{steps.build.outputs.parameters.x}}'","handlingStrategy":"validation","validationCode":"// validate expressions before submit\nargo lint my-wf.yaml","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"failed to resolve references\") {\n    // inspect wrapped cause to find the offending step/reference\n}","preventionTips":["Lint workflows in CI","Don't reference outputs of steps guarded by when without optionals/guards","Keep variable names consistent with producer outputs"],"tags":["kubernetes","argo-workflows","steps","references"],"backgroundTag":"reference-resolution-failed","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}