argoproj/argo-workflows · error

CodeBadRequest

CodeBadRequest

Error message

spec.entrypoint is required

What it means

Every Argo Workflow spec must name an entrypoint template — the first template executed. Workflow validation (workflow/validate) rejects specs without one unless the caller opts out (opts.IgnoreEntrypoint). The entrypoint may be given directly (spec.entrypoint) or resolved from workflowTemplateRef defaults, but if after resolution the entrypoint name is still empty, this CodeBadRequest error is returned.

Source

Thrown at workflow/validate/validate.go:260

	for k := range mergedAnnotations {
		tctx.globalParams[varkeys.WorkflowAnnotationsByName.Concretize(k)] = placeholderGenerator.NextPlaceholder()
	}
	tctx.globalParams[varkeys.WorkflowAnnotationsAll.Template()] = placeholderGenerator.NextPlaceholder()
	tctx.globalParams[varkeys.WorkflowAnnotationsJSON.Template()] = placeholderGenerator.NextPlaceholder()

	for k := range mergedLabels {
		tctx.globalParams[varkeys.WorkflowLabelsByName.Concretize(k)] = placeholderGenerator.NextPlaceholder()
	}
	tctx.globalParams[varkeys.WorkflowLabelsAll.Template()] = placeholderGenerator.NextPlaceholder()
	tctx.globalParams[varkeys.WorkflowLabelsJSON.Template()] = placeholderGenerator.NextPlaceholder()

	if wf.Spec.Priority != nil {
		tctx.globalParams[varkeys.WorkflowPriority.Template()] = strconv.Itoa(int(*wf.Spec.Priority))
	}
	tctx.globalParams[varkeys.WorkflowStatus.Template()] = placeholderGenerator.NextPlaceholder()

	if !opts.IgnoreEntrypoint && entrypoint == "" {
		return errors.New(errors.CodeBadRequest, "spec.entrypoint is required")
	}

	if !opts.IgnoreEntrypoint {
		var args wfv1.ArgumentsProvider
		args = &wfArgs
		if opts.WorkflowTemplateValidation {
			args = &FakeArguments{}
		}
		tmpl := &wfv1.WorkflowStep{Template: entrypoint}
		if hasWorkflowTemplateRef {
			tmpl = &wfv1.WorkflowStep{TemplateRef: wfTmplRef}
		}
		_, err = tctx.validateTemplateHolder(ctx, tmpl, tmplCtx, args, opts.WorkflowTemplateValidation)
		if err != nil {
			return err
		}
	}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Add spec.entrypoint naming one of the templates defined in spec.templates
  2. If relying on a WorkflowTemplate, confirm the referenced template's spec defines an entrypoint (argo get/inspect the template)
  3. Run `argo lint <file>` before submitting to catch this locally

Example fix

# before
spec:
  templates:
    - name: whalesay
      container: {image: docker/whalesay, command: [cowsay]}
# after
spec:
  entrypoint: whalesay
  templates:
    - name: whalesay
      container: {image: docker/whalesay, command: [cowsay]}
Defensive patterns

Strategy: validation

Validate before calling

if wf.Spec.Entrypoint == "" && wf.Spec.WorkflowTemplateRef == nil {
    return errors.New("spec.entrypoint is required (or use workflowTemplateRef whose spec defines one)")
}

Type guard

func hasEntrypoint(wf *wfv1.Workflow) bool {
    return wf.Spec.Entrypoint != "" || wf.Spec.WorkflowTemplateRef != nil
}

Try / catch

if err := (wfv1.Workflow{Spec: wf.Spec}).Validate(); err != nil {
    if strings.Contains(err.Error(), "entrypoint is required") {
        return fmt.Errorf("set spec.entrypoint before submitting: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Submitting (argo submit / CreateWorkflow / SubmitWorkflow) or linting (argo lint / LintWorkflow) a Workflow whose spec lacks spec.entrypoint and which does not reference a WorkflowTemplate that supplies one. Also surfaces during WorkflowTemplate/ClusterWorkflowTemplate validation of embedded specs.

Common situations: Hand-written minimal workflow YAML that only contains templates but no entrypoint; a workflowTemplateRef pointing at a template with no entrypoint in its spec; CI linting a partial spec; upgrading or migrating manifests where the entrypoint key was renamed or dropped.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/0383e6b4a1725f19. Report an issue: GitHub.