argoproj/argo-workflows · error
no workflow found in given files
Error message
no workflow found in given files
What it means
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.
Source
Thrown at cmd/argo/commands/submit.go:222
})
if err != nil {
return fmt.Errorf("failed to submit workflow: %w", err)
}
if err = printWorkflow(created, common.GetFlags{Output: cliOpts.Output}); err != nil {
return err
}
return common.WaitWatchOrLog(ctx, serviceClient, namespace, []string{created.Name}, *cliOpts)
}
func submitWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
if err := validateOptions(workflows, submitOpts, cliOpts); err != nil {
return err
}
if len(workflows) == 0 {
return errors.New("no workflow found in given files")
}
var workflowNames []string
for _, wf := range workflows {
if wf.Namespace == "" {
// This is here to avoid passing an empty namespace when using --server-dry-run
wf.Namespace = namespace
}
err := util.ApplySubmitOpts(&wf, submitOpts)
if err != nil {
return err
}
if cliOpts.Priority != nil {
wf.Spec.Priority = cliOpts.Priority
}
options := &metav1.CreateOptions{}
if submitOpts.DryRun {View on GitHub (pinned to 35bff19146)
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.
Example fix
// before (file has only a WorkflowTemplate)
kind: WorkflowTemplate
metadata:
name: my-tmpl
// after
kind: Workflow
metadata:
generateName: my-wf-
spec:
entrypoint: main
templates:
- name: main
container: {image: alpine, command: [echo]} Defensive patterns
Strategy: validation
Validate before calling
// before: argo submit
wf, err := os.ReadFile(path)
if err != nil { return err }
if !strings.Contains(string(wf), "kind: Workflow") {
return fmt.Errorf("%s contains no Workflow manifest", path)
} Prevention
- 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
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- --wait cannot be combined with --server-dry-run
- --dry-run should have an output option
- --dry-run cannot be combined with --server-dry-run
- --server-dry-run should have an output option
- requires either selector or workflow
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/bfc067acae88d225.
Report an issue: GitHub.