{"record":{"id":"8e1a1d9008a41f32","repo":"argoproj/argo-workflows","slug":"successcondition-failurecondition-and-outputs-are","errorCode":null,"errorMessage":"successCondition, failureCondition and outputs are not supported for delete action","messagePattern":"successCondition, failureCondition and outputs are not supported for delete action","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/resource.go","lineNumber":60,"sourceCode":"\t// Don't allow cancellation to impact capture of results, parameters, artifacts, or defers.\n\t//nolint:contextcheck\n\tbgCtx := tracing.InjectTraceContext(logging.RequireLoggerFromContext(ctx).NewBackgroundContext())\n\n\twfExecutor.InitializeOutput(bgCtx)\n\terrHandler := wfExecutor.HandleError(bgCtx)\n\tdefer errHandler()\n\tif !wfExecutor.Template.SaveLogsAsArtifact() {\n\t\tdefer wfExecutor.FinalizeOutput(bgCtx) // Ensures the LabelKeyReportOutputsCompleted is set to true.\n\t}\n\terr := wfExecutor.StageFiles(ctx)\n\tif err != nil {\n\t\twfExecutor.AddError(ctx, err)\n\t\treturn err\n\t}\n\n\tisDelete := action == \"delete\"\n\tif isDelete && (wfExecutor.Template.Resource.SuccessCondition != \"\" || wfExecutor.Template.Resource.FailureCondition != \"\" || len(wfExecutor.Template.Outputs.Parameters) > 0) {\n\t\terr = fmt.Errorf(\"successCondition, failureCondition and outputs are not supported for delete action\")\n\t\twfExecutor.AddError(ctx, err)\n\t\treturn err\n\t}\n\tmanifestPath := common.ExecutorResourceManifestPath\n\tif wfExecutor.Template.Resource.ManifestFrom != nil {\n\t\ttargetArtName := wfExecutor.Template.Resource.ManifestFrom.Artifact.Name\n\t\tfor _, art := range wfExecutor.Template.Inputs.Artifacts {\n\t\t\tif art.Name == targetArtName {\n\t\t\t\tmanifestPath = art.Path\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tresourceNamespace, resourceName, selfLink, err := wfExecutor.ExecResource(ctx,\n\t\taction, manifestPath, wfExecutor.Template.Resource.Flags,\n\t)\n\tif err != nil {\n\t\twfExecutor.AddError(ctx, err)","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/resource.go#L42-L78","documentation":"execResource in argoexec rejects resource templates whose action is `delete` but that also declare successCondition, failureCondition, or output parameters. Conditions and output capture only make sense for verbs that create/update resources; a delete leaves nothing to evaluate, so the executor fails fast and records the error on the node via wfExecutor.AddError.","triggerScenarios":"A Workflow resource template with `action: delete` whose `resource.successCondition`, `resource.failureCondition`, or `resource.outputs.parameters` is non-empty; the executor hits this check immediately after dispatching, before touching the cluster.","commonSituations":"Copy-pasting a resource template that previously did `create`/`apply` (with conditions/outputs) and switching only the action to `delete`; forgetting to strip outputs when templating delete actions.","solutions":["Remove successCondition, failureCondition, and outputs.parameters from the resource template when action is delete","If you need outputs from the deleted resource, first do `get`/`apply` to capture them, then delete in a separate step","Use the error text to locate the offending fields in your Workflow spec's templates[].resource"],"exampleFix":"// before\nresource:\n  action: delete\n  manifest: |\n    apiVersion: v1\n    kind: Pod\n  successCondition: status.phase == 'Succeeded'\n// after\nresource:\n  action: delete\n  manifest: |\n    apiVersion: v1\n    kind: Pod","handlingStrategy":"validation","validationCode":"// reject invalid delete templates before submit\nfunc validateResourceTemplate(rt *wfv1.ResourceTemplate) error {\n    if rt.Action == \"delete\" && (rt.SuccessCondition != \"\" || rt.FailureCondition != \"\" || len(rt.Outputs.Parameters) > 0) {\n        return errors.New(\"successCondition, failureCondition and outputs are not supported for delete action\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `argo lint` on every workflow before submission","Strip success/failure conditions and outputs when switching a resource template to delete","Capture outputs in a prior get/apply step instead of on delete","Add CI schema validation for Workflow manifests"],"tags":["go","argo-executor","workflow-spec","validation","resource-template"],"backgroundTag":"unsupported-template-combination","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"}