argoproj/argo-workflows · error

failed to create workflow template: %w

Error message

failed to create workflow template: %w

What it means

CreateWorkflowTemplates wraps any error returned by the CreateWorkflowTemplate gRPC call for each template loaded from the given file paths. It fires when the server rejects a template creation — commonly due to validation failure (strict spec errors), a duplicate template name, or RBAC denial in the target namespace — preserving the server-side cause via %w.

Source

Thrown at cmd/argo/commands/template/create.go:58

		return err
	}
	serviceClient, err := apiClient.NewWorkflowTemplateServiceClient()
	if err != nil {
		return err
	}

	workflowTemplates := generateWorkflowTemplates(ctx, filePaths, cliOpts.strict)

	for _, wftmpl := range workflowTemplates {
		if wftmpl.Namespace == "" {
			wftmpl.Namespace = client.Namespace(ctx)
		}
		created, err := serviceClient.CreateWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateCreateRequest{
			Namespace: wftmpl.Namespace,
			Template:  &wftmpl,
		})
		if err != nil {
			return fmt.Errorf("failed to create workflow template: %w", err)
		}
		printWorkflowTemplate(created, cliOpts.output.String())
	}
	return nil
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Lint the template file with argo template lint
  2. Check for name collisions and RBAC permissions in the namespace
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/argo/commands/template/create.go:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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