{"record":{"id":"bfc067acae88d225","repo":"argoproj/argo-workflows","slug":"no-workflow-found-in-given-files","errorCode":null,"errorMessage":"no workflow found in given files","messagePattern":"no workflow found in given files","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":222,"sourceCode":"\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to submit workflow: %w\", err)\n\t}\n\n\tif err = printWorkflow(created, common.GetFlags{Output: cliOpts.Output}); err != nil {\n\t\treturn err\n\t}\n\n\treturn common.WaitWatchOrLog(ctx, serviceClient, namespace, []string{created.Name}, *cliOpts)\n}\n\nfunc submitWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tif err := validateOptions(workflows, submitOpts, cliOpts); err != nil {\n\t\treturn err\n\t}\n\n\tif len(workflows) == 0 {\n\t\treturn errors.New(\"no workflow found in given files\")\n\t}\n\n\tvar workflowNames []string\n\n\tfor _, wf := range workflows {\n\t\tif wf.Namespace == \"\" {\n\t\t\t// This is here to avoid passing an empty namespace when using --server-dry-run\n\t\t\twf.Namespace = namespace\n\t\t}\n\t\terr := util.ApplySubmitOpts(&wf, submitOpts)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif cliOpts.Priority != nil {\n\t\t\twf.Spec.Priority = cliOpts.Priority\n\t\t}\n\t\toptions := &metav1.CreateOptions{}\n\t\tif submitOpts.DryRun {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L204-L240","documentation":"submitWorkflows got an empty workflow slice after parsing the given inputs. It means the files/URLs/stdin provided to `argo submit` contained no recognizable Workflow (or CronWorkflow/Resource) manifests, so there is nothing to submit.","triggerScenarios":"`argo submit file.yaml` where the YAML contains other kinds (e.g. only ConfigMaps or a WorkflowTemplate), the file is empty, or parsing (via submitWorkflowsFromFile/URL) filtered out everything before calling submitWorkflows with len(workflows)==0.","commonSituations":"Pointing submit at a manifest for a different resource kind; YAML documents commented out or mis-indented; using a directory/list file whose documents are not Workflows; forgetting `--from` when submitting a CronWorkflow or ClusterWorkflowTemplate resource.","solutions":["Verify the file contains at least one manifest with kind: Workflow (and apiVersion argoproj.io/v1alpha1).","Use `argo submit --from <kind>/<name>` for submitting from existing resources like CronWorkflow, e.g. `argo submit --from cronwf/my-cwf`.","Validate the YAML with `argo lint` to see parse/structure problems.","If submitting a multi-document file, ensure the Workflow documents are not commented out or under a different kind."],"exampleFix":"// before (file has only a WorkflowTemplate)\nkind: WorkflowTemplate\nmetadata:\n  name: my-tmpl\n// after\nkind: Workflow\nmetadata:\n  generateName: my-wf-\nspec:\n  entrypoint: main\n  templates:\n    - name: main\n      container: {image: alpine, command: [echo]}","handlingStrategy":"validation","validationCode":"// before: argo submit\nwf, err := os.ReadFile(path)\nif err != nil { return err }\nif !strings.Contains(string(wf), \"kind: Workflow\") {\n    return fmt.Errorf(\"%s contains no Workflow manifest\", path)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `argo lint` on manifests before submit","Confirm kind: Workflow and apiVersion argoproj.io/v1alpha1 in the file","Use --from kind/name for resource submission instead of files","Check files aren't empty or fully commented out"],"tags":["cli","yaml","argo"],"backgroundTag":"empty-workflow-manifest","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"}