{"record":{"id":"7cc8e3387546aaaf","repo":"argoproj/argo-workflows","slug":"cannot-watch-more-than-one-workflow","errorCode":null,"errorMessage":"cannot watch more than one workflow","messagePattern":"cannot watch more than one workflow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":139,"sourceCode":"func submitWorkflowsFromFile(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, filePaths []string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tfileContents, err := util.ReadManifest(ctx, filePaths...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar workflows []wfv1.Workflow\n\tfor _, body := range fileContents {\n\t\twfs := unmarshalWorkflows(ctx, body, cliOpts.Strict)\n\t\tworkflows = append(workflows, wfs...)\n\t}\n\n\treturn submitWorkflows(ctx, serviceClient, namespace, workflows, submitOpts, cliOpts)\n}\n\nfunc validateOptions(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tif cliOpts.Watch {\n\t\tif len(workflows) > 1 {\n\t\t\treturn errors.New(\"cannot watch more than one workflow\")\n\t\t}\n\t\tif cliOpts.Wait {\n\t\t\treturn errors.New(\"--wait cannot be combined with --watch\")\n\t\t}\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--watch cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--watch cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n\n\tif cliOpts.Wait {\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --server-dry-run\")","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L121-L157","documentation":"`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.","triggerScenarios":"`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.","commonSituations":"Batch-submitting generated YAML files while keeping --watch from a single-file dev command; multi-template YAML from Helm/templating output watched unintentionally.","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"],"exampleFix":"// before\nargo submit wf1.yaml wf2.yaml --watch\n// after\nargo submit wf1.yaml wf2.yaml --wait","handlingStrategy":"validation","validationCode":"N=$(grep -c '^kind: Workflow$' combined.yaml)  # or count submitted files\nif [ \"$N\" -gt 1 ] && echo \"$FLAGS\" | grep -q -- '--watch'; then\n  echo \"argo submit: cannot watch more than one workflow\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --wait (not --watch) for multi-workflow batches","Count documents in generated YAML before adding --watch","Reserve --watch for single interactive submits"],"tags":["cli","flag-conflict","argo-cli","submit","watch"],"backgroundTag":"mutually-exclusive-flags","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"}