argoproj/argo-workflows · error

cannot combine --from with file arguments

Error message

cannot combine --from with file arguments

What it means

`argo submit --from <kind>/<name>` submits a workflow from an existing resource, so it cannot also take file arguments (including `-` for stdin). validateOptions-level Args validation at cmd/argo/commands/submit.go:62 rejects the combination up front because the two input sources are mutually exclusive.

Source

Thrown at cmd/argo/commands/submit.go:62

# Submit and watch until completion:

  argo submit --watch my-wf.yaml

# Submit and tail logs until completion:

  argo submit --log my-wf.yaml

# Submit a single workflow from an existing resource

  argo submit --from cronwf/my-cron-wf

# Submit multiple workflows from stdin:

  cat my-wf.yaml | argo submit -
`,
		Args: func(cmd *cobra.Command, args []string) error {
			if from != "" && len(args) != 0 {
				return errors.New("cannot combine --from with file arguments")
			}
			return nil
		},
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := cmd.Context()
			if cmd.Flag("priority").Changed {
				cliSubmitOpts.Priority = &priority
			}

			ctx, apiClient, err := client.NewAPIClient(ctx)
			if err != nil {
				return err
			}

			if !cliSubmitOpts.Watch && len(cliSubmitOpts.GetArgs.Status) > 0 {
				logging.RequireLoggerFromContext(ctx).Warn(ctx, "--status should only be used with --watch")
			}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Drop the file arguments when using --from
  2. Or drop --from and submit from the file/stdin directly
  3. In scripts, choose one path: if FROM is set, pass no positional args

Example fix

// before
cat my-wf.yaml | argo submit --from workflowtmpl/my-tmpl -
// after
cat my-wf.yaml | argo submit -
# or
argo submit --from workflowtmpl/my-tmpl
Defensive patterns

Strategy: validation

Validate before calling

if [ -n "$FROM" ] && [ ${#FILE_ARGS[@]} -gt 0 ]; then
  echo "argo submit: cannot combine --from with file arguments" >&2; exit 2
fi

Prevention

When it happens

Trigger: Running `argo submit --from cronwf/my-cron-wf my-wf.yaml`; also `cat wf.yaml | argo submit --from workflow/x -` (args contains "-").

Common situations: Mixing examples for resource-submit and file-submit; scripts that append a default file argument; piping YAML out of habit while also using --from.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


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