{"record":{"id":"ad778761c0c155dc","repo":"argoproj/argo-workflows","slug":"cannot-set-output-parameters-because-node-is-not-e","errorCode":null,"errorMessage":"cannot set output parameters because node is not expecting any raw parameters","messagePattern":"cannot set output parameters because node is not expecting any raw parameters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/util/util.go","lineNumber":682,"sourceCode":"\t\t\t\t\t// Update phase\n\t\t\t\t\tif values.Phase != \"\" {\n\t\t\t\t\t\tnode.Phase = values.Phase\n\t\t\t\t\t\tif values.Phase.Fulfilled(node.TaskResultSynced) {\n\t\t\t\t\t\t\tnode.FinishedAt = metav1.Time{Time: time.Now().UTC()}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodeUpdated = true\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update message\n\t\t\t\t\tif values.Message != \"\" {\n\t\t\t\t\t\tnode.Message = values.Message\n\t\t\t\t\t\tnodeUpdated = true\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update output parameters\n\t\t\t\t\tif len(values.OutputParameters) > 0 {\n\t\t\t\t\t\tif node.Outputs == nil {\n\t\t\t\t\t\t\treturn true, fmt.Errorf(\"cannot set output parameters because node is not expecting any raw parameters\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor name, val := range values.OutputParameters {\n\t\t\t\t\t\t\thit := false\n\t\t\t\t\t\t\tfor i, param := range node.Outputs.Parameters {\n\t\t\t\t\t\t\t\tif param.Name == name {\n\t\t\t\t\t\t\t\t\tif param.ValueFrom == nil || param.ValueFrom.Supplied == nil {\n\t\t\t\t\t\t\t\t\t\treturn true, fmt.Errorf(\"cannot set output parameter '%s' because it does not use valueFrom.raw or it was already set\", param.Name)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnode.Outputs.Parameters[i].Value = wfv1.AnyStringPtr(val)\n\t\t\t\t\t\t\t\t\tnode.Outputs.Parameters[i].ValueFrom = nil\n\t\t\t\t\t\t\t\t\tnodeUpdated = true\n\t\t\t\t\t\t\t\t\thit = true\n\t\t\t\t\t\t\t\t\tAddParamToGlobalScope(ctx, wf, node.Outputs.Parameters[i])\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif !hit {\n\t\t\t\t\t\t\t\treturn true, fmt.Errorf(\"node is not expecting output parameter '%s'\", name)","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/util/util.go#L664-L700","documentation":"When applying WorkflowTaskResult output parameters back onto a workflow node (setOutputs path), the node must already declare outputs with parameters. If values.OutputParameters is non-empty but node.Outputs is nil, this error is returned: the executor is reporting outputs the node's template never declared. Failing loudly prevents silently injecting undeclared parameters into the workflow status.","triggerScenarios":"argoexec reports OutputParameters for a node whose template has no outputs.parameters section — e.g. the template was edited after the pod started, or a pod from an older template version reports params the new spec lacks.","commonSituations":"Editing a workflow template's outputs while a pod from the previous definition is still running, or retry/resubmit flows mixing node state across template versions.","solutions":["Delete/restart the pod so the node's template matches what the executor reports (re-run the step under the current template).","Ensure the template declares outputs.parameters for every parameter the step emits.","If this happens during retries, retry the workflow fresh instead of resuming the stale pod."],"exampleFix":"// before (template has no outputs but emits param)\nscript:\n  command: [sh]\n  source: echo hello\n// after\nscript:\n  command: [sh]\n  source: echo hello\noutputs:\n  parameters:\n    - name: msg\n      valueFrom:\n        path: /tmp/msg","handlingStrategy":"validation","validationCode":"if len(values.OutputParameters) > 0 && node.Outputs == nil {\n\t// pod reports params the node never declared: stale template version\n\treturn fmt.Errorf(\"node %s expects no raw parameters\", nodeID)\n}","typeGuard":"func nodeExpectsRawParams(n wfv1.NodeStatus) bool {\n\treturn n.Outputs != nil && len(n.Outputs.Parameters) > 0\n}","tryCatchPattern":"updated, err := util.SetOutputs(ctx, wf, nodeID, values)\nif err != nil && strings.Contains(err.Error(), \"not expecting any raw parameters\") {\n\t// delete the stale pod / re-run the node under the current template\n\treturn requeue\n}","preventionTips":["Declare outputs.parameters for every parameter a step emits.","Avoid editing templates while their pods are mid-flight.","After upgrades, resubmit rather than resume stale workflows."],"tags":["outputs","parameters","node-status"],"backgroundTag":"undeclared-output-parameter","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"}