argoproj/argo-workflows · error

unable to process data template: %w

Error message

unable to process data template: %w

What it means

Data() wraps processData and annotates any failure — including the 'no data template found' case and any data.ProcessData error — with 'unable to process data template: %w'. The node then fails with this composite message.

Source

Thrown at workflow/executor/data.go:25

	"github.com/argoproj/argo-workflows/v4/workflow/data"
)

func (we *WorkflowExecutor) processData(ctx context.Context) (any, error) {
	dataCtx, span := we.Tracing.StartProcessDataTemplate(ctx)
	defer span.End()
	dataTemplate := we.Template.Data
	if dataTemplate == nil {
		return nil, fmt.Errorf("no data template found")
	}

	return data.ProcessData(dataCtx, dataTemplate, newExecutorDataSourceProcessor(we))
}

func (we *WorkflowExecutor) Data(ctx context.Context) error {
	transformedData, err := we.processData(ctx)
	if err != nil {
		return fmt.Errorf("unable to process data template: %w", err)
	}

	out, err := json.Marshal(transformedData)
	if err != nil {
		return err
	}
	we.Template.Outputs.Result = new(string(out))
	err = we.ReportOutputs(ctx, nil)
	if err != nil {
		return err
	}

	return nil
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Read the wrapped (%w) cause in the error message to find the real failure
  2. Enable artifact archive/logging so the data source has artifacts to process
  3. Verify storage credentials for the data source backend
  4. Test the transformation expression with `argo expression` or a small workflow first

Example fix

// before
transformation:
  - expression: "filter(jsonList, {#.status == 'ok'})"
// after (guard against missing field)
transformation:
  - expression: "filter(jsonList, {# != null && #.status != nil && #.status == 'ok'})"
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure data source prerequisites exist before running:
// kubectl get workflow <name> -o yaml | grep -A5 'data:'
// and confirm artifact archive logging is enabled for data sources using artifactPaths

Try / catch

if err := we.Data(ctx); err != nil {
	var cause error
	errors.As(err, &cause) // unwrap to find root cause (nil data, storage auth, expression error)
	// retry transient storage failures; fail fast on expression/config errors
}

Prevention

When it happens

Trigger: Any underlying failure during data-template execution: nil Data template, an unreadable/failing data source (artifact logs, S3 listing, etc.), or an expression error in the transformation step.

Common situations: Artifact-log archive not enabled so the data source finds nothing; S3/GCS credentials missing for the data source; a transformation expression that throws (e.g. referencing a missing field); nil data template from a malformed workflow.

Related errors


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