argoproj/argo-workflows · error
successCondition, failureCondition and outputs are not suppo
Error message
successCondition, failureCondition and outputs are not supported for delete action
What it means
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.
Source
Thrown at cmd/argoexec/commands/resource.go:60
// Don't allow cancellation to impact capture of results, parameters, artifacts, or defers.
//nolint:contextcheck
bgCtx := tracing.InjectTraceContext(logging.RequireLoggerFromContext(ctx).NewBackgroundContext())
wfExecutor.InitializeOutput(bgCtx)
errHandler := wfExecutor.HandleError(bgCtx)
defer errHandler()
if !wfExecutor.Template.SaveLogsAsArtifact() {
defer wfExecutor.FinalizeOutput(bgCtx) // Ensures the LabelKeyReportOutputsCompleted is set to true.
}
err := wfExecutor.StageFiles(ctx)
if err != nil {
wfExecutor.AddError(ctx, err)
return err
}
isDelete := action == "delete"
if isDelete && (wfExecutor.Template.Resource.SuccessCondition != "" || wfExecutor.Template.Resource.FailureCondition != "" || len(wfExecutor.Template.Outputs.Parameters) > 0) {
err = fmt.Errorf("successCondition, failureCondition and outputs are not supported for delete action")
wfExecutor.AddError(ctx, err)
return err
}
manifestPath := common.ExecutorResourceManifestPath
if wfExecutor.Template.Resource.ManifestFrom != nil {
targetArtName := wfExecutor.Template.Resource.ManifestFrom.Artifact.Name
for _, art := range wfExecutor.Template.Inputs.Artifacts {
if art.Name == targetArtName {
manifestPath = art.Path
break
}
}
}
resourceNamespace, resourceName, selfLink, err := wfExecutor.ExecResource(ctx,
action, manifestPath, wfExecutor.Template.Resource.Flags,
)
if err != nil {
wfExecutor.AddError(ctx, err)View on GitHub (pinned to 35bff19146)
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
Example fix
// before
resource:
action: delete
manifest: |
apiVersion: v1
kind: Pod
successCondition: status.phase == 'Succeeded'
// after
resource:
action: delete
manifest: |
apiVersion: v1
kind: Pod Defensive patterns
Strategy: validation
Validate before calling
// reject invalid delete templates before submit
func validateResourceTemplate(rt *wfv1.ResourceTemplate) error {
if rt.Action == "delete" && (rt.SuccessCondition != "" || rt.FailureCondition != "" || len(rt.Outputs.Parameters) > 0) {
return errors.New("successCondition, failureCondition and outputs are not supported for delete action")
}
return nil
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/8e1a1d9008a41f32.
Report an issue: GitHub.