argoproj/argo-workflows · error

Artifact '%s' not found in WorkflowTemplate %s/%s arguments.

Error message

Artifact '%s' not found in WorkflowTemplate %s/%s arguments.artifacts

What it means

UploadInputArtifact looks up artifactName in the WorkflowTemplate's spec.arguments.artifacts to reuse its configured storage location. This HTTP 404 is returned when no artifact with that name is declared in the template's arguments. The upload endpoint only accepts artifacts pre-declared in the template, it does not create artifact definitions on the fly.

Source

Thrown at server/artifacts/artifact_server.go:196

	a.logger.WithFields(logging.Fields{
		"filename": header.Filename,
		"size":     header.Size,
	}).Info(ctx, "Received file for upload")

	// Find the artifact in the WorkflowTemplate's arguments.artifacts
	var templateArtifact *wfv1.Artifact
	if wfTemplate.Spec.Arguments.Artifacts != nil {
		for i := range wfTemplate.Spec.Arguments.Artifacts {
			if wfTemplate.Spec.Arguments.Artifacts[i].Name == artifactName {
				templateArtifact = &wfTemplate.Spec.Arguments.Artifacts[i]
				break
			}
		}
	}

	if templateArtifact == nil {
		http.Error(w, fmt.Sprintf("Artifact '%s' not found in WorkflowTemplate %s/%s arguments.artifacts", artifactName, namespace, workflowTemplateName), http.StatusNotFound)
		return
	}

	// Create a deep copy to avoid modifying the original template artifact
	artifactCopy := templateArtifact.DeepCopy()

	// If the artifact doesn't have a full location, try to resolve from default artifact repository.
	// This handles cases where:
	// 1. WorkflowTemplate specifies artifactRepositoryRef explicitly
	// 2. Namespace has artifact-repositories ConfigMap
	// 3. workflow-controller-configmap has default artifactRepository
	// We don't use Relocate() because it requires an existing key, but for uploads we generate a new key anyway.
	if !artifactCopy.HasLocation() {
		archiveLocation, resolveErr := sutils.ResolveArtifactLocation(ctx, a.artifactRepositories, wfTemplate.Spec.ArtifactRepositoryRef, namespace)
		if resolveErr != nil {
			a.logger.WithError(resolveErr).Debug(ctx, "Failed to resolve artifact repository, will check if artifact has location anyway")
		} else if archiveLocation != nil && archiveLocation.HasLocation() {
			// Copy the location settings (bucket, endpoint, etc.) to our artifact

View on GitHub (pinned to 35bff19146)

Solutions

  1. Add the artifact to the WorkflowTemplate's spec.arguments.artifacts with a storage location configured.
  2. Verify the artifact name in the upload request exactly matches the name in the template (case-sensitive).
  3. Confirm you are hitting the correct namespace and WorkflowTemplate (the names are in the error message).
  4. If the artifact lives in a step template's arguments instead, move or duplicate its definition into spec.arguments.artifacts.

Example fix

// before
spec:
  arguments:
    artifacts:
      - name: data-file
// upload requesting 'myfile' -> 404
// after: request name must match
spec:
  arguments:
    artifacts:
      - name: myfile
        s3: { bucket: my-bucket }
Defensive patterns

Strategy: validation

Validate before calling

# Verify the artifact is declared before uploading
kubectl -n $NS get workflowtemplate $TPL -o jsonpath='{.spec.arguments.artifacts[*].name}' | tr ' ' '\n' | grep -qx "$ARTIFACT_NAME" \
  || echo "artifact $ARTIFACT_NAME not declared in $TPL"

Try / catch

try:
    upload(name, file)
except ArtifactServerHTTPError as e:
    if e.status == 404 and 'not found in WorkflowTemplate' in e.body:
        raise ConfigError(f"declare artifact '{name}' in spec.arguments.artifacts first") from e

Prevention

When it happens

Trigger: Uploading to an artifact name that does not exist in spec.arguments.artifacts of the referenced WorkflowTemplate; typos in the artifact name; uploading to a template where the artifact is defined under a different section (e.g. template-level inputs instead of workflow-level arguments); referencing the wrong WorkflowTemplate or namespace.

Common situations: Developer renamed the artifact in the template but not in the upload script; CI pipeline pointing at an older template revision; artifact declared only in a step template's inputs.arguments rather than spec.arguments.artifacts; wrong namespace used in the URL.

Related errors


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