argoproj/argo-workflows · error

requires either node field selector or workflow

Error message

requires either node field selector or workflow

What it means

`argo resume` must know what to resume: either one or more workflow names as positional args, or a --node-field-selector to target nodes across workflows. The cobra Args validator rejects the command when both are absent, because the underlying resume API has no target to act on.

Source

Thrown at cmd/argo/commands/resume.go:42

		Example: `# Resume a workflow that has been suspended:

  argo resume my-wf

# Resume multiple workflows:
		
  argo resume my-wf my-other-wf my-third-wf		
		
# Resume the latest workflow:
		
  argo resume @latest
		
# Resume multiple workflows by node field selector:
		
  argo resume --node-field-selector inputs.parameters.myparam.value=abc		
`,
		Args: func(cmd *cobra.Command, args []string) error {
			if len(args) == 0 && resumeArgs.nodeFieldSelector == "" {
				return errors.New("requires either node field selector or workflow")
			}
			return nil
		},
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := cmd.Context()
			ctx, apiClient, err := client.NewAPIClient(ctx)
			if err != nil {
				return err
			}
			serviceClient := apiClient.NewWorkflowServiceClient(ctx)
			namespace := client.Namespace(ctx)

			selector, err := fields.ParseSelector(resumeArgs.nodeFieldSelector)
			if err != nil {
				return fmt.Errorf("unable to parse node field selector '%s': %w", resumeArgs.nodeFieldSelector, err)
			}

			for _, wfName := range args {

View on GitHub (pinned to 35bff19146)

Solutions

  1. Pass the workflow name: `argo resume my-wf`
  2. Or supply a node field selector: `argo resume --node-field-selector inputs.parameters.myparam.value=abc`
  3. In scripts, guard: fail fast if WF_NAME is empty before calling argo resume

Example fix

// before
WF_NAME=""; argo resume $WF_NAME
// after
WF_NAME="my-wf"; [ -n "$WF_NAME" ] && argo resume "$WF_NAME"
Defensive patterns

Strategy: validation

Validate before calling

if [ -z "$WF_NAME" ] && [ -z "$NODE_FIELD_SELECTOR" ]; then
  echo "argo resume: requires either node field selector or workflow" >&2; exit 2
fi
# ${WF_NAME:+"$WF_NAME"} ${NODE_FIELD_SELECTOR:+--node-field-selector "$NODE_FIELD_SELECTOR"}

Prevention

When it happens

Trigger: Running bare `argo resume` (or `argo resume` with only unrelated flags like --namespace) with no workflow name and no --node-field-selector at cmd/argo/commands/resume.go:42.

Common situations: Typing `argo resume` expecting it to resume everything; forgetting the workflow name after switching flags around; scripting where the workflow-name variable is empty.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/5b7aa3f75638caf2. Report an issue: GitHub.