{"record":{"id":"1a790606b16e8bc1","repo":"argoproj/argo-workflows","slug":"cannot-combine-from-with-file-arguments","errorCode":null,"errorMessage":"cannot combine --from with file arguments","messagePattern":"cannot combine --from with file arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":62,"sourceCode":"# Submit and watch until completion:\n\n  argo submit --watch my-wf.yaml\n\n# Submit and tail logs until completion:\n\n  argo submit --log my-wf.yaml\n\n# Submit a single workflow from an existing resource\n\n  argo submit --from cronwf/my-cron-wf\n\n# Submit multiple workflows from stdin:\n\n  cat my-wf.yaml | argo submit -\n`,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif from != \"\" && len(args) != 0 {\n\t\t\t\treturn errors.New(\"cannot combine --from with file arguments\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\t\t\tif cmd.Flag(\"priority\").Changed {\n\t\t\t\tcliSubmitOpts.Priority = &priority\n\t\t\t}\n\n\t\t\tctx, apiClient, err := client.NewAPIClient(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !cliSubmitOpts.Watch && len(cliSubmitOpts.GetArgs.Status) > 0 {\n\t\t\t\tlogging.RequireLoggerFromContext(ctx).Warn(ctx, \"--status should only be used with --watch\")\n\t\t\t}\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L44-L80","documentation":"`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.","triggerScenarios":"Running `argo submit --from cronwf/my-cron-wf my-wf.yaml`; also `cat wf.yaml | argo submit --from workflow/x -` (args contains \"-\").","commonSituations":"Mixing examples for resource-submit and file-submit; scripts that append a default file argument; piping YAML out of habit while also using --from.","solutions":["Drop the file arguments when using --from","Or drop --from and submit from the file/stdin directly","In scripts, choose one path: if FROM is set, pass no positional args"],"exampleFix":"// before\ncat my-wf.yaml | argo submit --from workflowtmpl/my-tmpl -\n// after\ncat my-wf.yaml | argo submit -\n# or\nargo submit --from workflowtmpl/my-tmpl","handlingStrategy":"validation","validationCode":"if [ -n \"$FROM\" ] && [ ${#FILE_ARGS[@]} -gt 0 ]; then\n  echo \"argo submit: cannot combine --from with file arguments\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --from as a complete alternative input path — no positional files, no stdin","In wrappers: if FROM is set, clear the file-args array","Remember '-' (stdin) counts as a file argument"],"tags":["cli","flag-conflict","argo-cli","submit"],"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"}