argoproj/argo-workflows · error
cannot watch more than one workflow
Error message
cannot watch more than one workflow
What it means
`argo submit --watch` attaches a live single-workflow progress view, which only makes sense for exactly one workflow. validateOptions (cmd/argo/commands/submit.go, called from submitWorkflowFromResource and submitWorkflows) returns this error when the submission would create more than one workflow.
Source
Thrown at cmd/argo/commands/submit.go:139
func submitWorkflowsFromFile(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, filePaths []string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
fileContents, err := util.ReadManifest(ctx, filePaths...)
if err != nil {
return err
}
var workflows []wfv1.Workflow
for _, body := range fileContents {
wfs := unmarshalWorkflows(ctx, body, cliOpts.Strict)
workflows = append(workflows, wfs...)
}
return submitWorkflows(ctx, serviceClient, namespace, workflows, submitOpts, cliOpts)
}
func validateOptions(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
if cliOpts.Watch {
if len(workflows) > 1 {
return errors.New("cannot watch more than one workflow")
}
if cliOpts.Wait {
return errors.New("--wait cannot be combined with --watch")
}
if submitOpts.DryRun {
return errors.New("--watch cannot be combined with --dry-run")
}
if submitOpts.ServerDryRun {
return errors.New("--watch cannot be combined with --server-dry-run")
}
}
if cliOpts.Wait {
if submitOpts.DryRun {
return errors.New("--wait cannot be combined with --dry-run")
}
if submitOpts.ServerDryRun {
return errors.New("--wait cannot be combined with --server-dry-run")View on GitHub (pinned to 35bff19146)
Solutions
- Remove --watch when submitting multiple workflows (use --wait instead to wait for all)
- Submit only one workflow with --watch
- Split the batch into individual submits each with --watch if per-workflow watching is needed
Example fix
// before argo submit wf1.yaml wf2.yaml --watch // after argo submit wf1.yaml wf2.yaml --wait
Defensive patterns
Strategy: validation
Validate before calling
N=$(grep -c '^kind: Workflow$' combined.yaml) # or count submitted files if [ "$N" -gt 1 ] && echo "$FLAGS" | grep -q -- '--watch'; then echo "argo submit: cannot watch more than one workflow" >&2; exit 2 fi
Prevention
- Use --wait (not --watch) for multi-workflow batches
- Count documents in generated YAML before adding --watch
- Reserve --watch for single interactive submits
When it happens
Trigger: `argo submit wf1.yaml wf2.yaml --watch`, submitting a multi-document YAML file, or `argo submit --from <kind>/<name>` that expands to multiple resources, with --watch set.
Common situations: Batch-submitting generated YAML files while keeping --watch from a single-file dev command; multi-template YAML from Helm/templating output watched unintentionally.
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
- cannot combine --from with file arguments
- --wait cannot be combined with --watch
- --watch cannot be combined with --dry-run
- --watch cannot be combined with --server-dry-run
- --wait cannot be combined with --dry-run
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/7cc8e3387546aaaf.
Report an issue: GitHub.