{"record":{"id":"064612a634918d48","repo":"argoproj/argo-workflows","slug":"unable-to-process-data-transformation-w","errorCode":null,"errorMessage":"unable to process data transformation: %w","messagePattern":"unable to process data transformation: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/data/data.go","lineNumber":19,"sourceCode":"package data\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/expr-lang/expr\"\n\n\twfv1 \"github.com/argoproj/argo-workflows/v4/pkg/apis/workflow/v1alpha1\"\n)\n\nfunc ProcessData(ctx context.Context, data *wfv1.Data, processor wfv1.DataSourceProcessor) (any, error) {\n\tsourcedData, err := processSource(ctx, data.Source, processor)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to process data source: %w\", err)\n\t}\n\ttransformedData, err := processTransformation(sourcedData, &data.Transformation)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to process data transformation: %w\", err)\n\t}\n\treturn transformedData, nil\n}\n\nfunc processSource(ctx context.Context, source wfv1.DataSource, processor wfv1.DataSourceProcessor) (any, error) {\n\tvar data any\n\tvar err error\n\tswitch {\n\tcase source.ArtifactPaths != nil:\n\t\tdata, err = processor.ProcessArtifactPaths(ctx, source.ArtifactPaths)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to source artifact paths: %w\", err)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"no valid source is used for data template\")\n\t}\n\n\treturn data, nil","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/data/data.go#L1-L37","documentation":"ProcessData failed at the transformation stage: after sourcing data successfully, applying one of the spec.data.transformation expressions (processTransformation) returned an error, wrapped with this message. Transformation steps use expr to filter, map, or reduce the sourced data.","triggerScenarios":"A transformation step expression fails to parse or evaluate against the sourced data — e.g. using filter/map on data of an unexpected shape, or syntax errors in the expr expression.","commonSituations":"Expressions written for lists applied to non-list data, wrong field names on map elements, expr version syntax differences, or empty results mishandled.","solutions":["Check the wrapped cause for which transformation step index failed and why","Validate the expression syntax against expr-lang and ensure it matches the data shape produced by artifactPaths (a list of path strings)","Add defensive expressions (e.g. filter before map) so empty/odd data doesn't break later steps","Test the data template standalone with examples from docs/workflow-templates before deploying"],"exampleFix":"// before\ntransformation:\n  - expression: \"map(data, {# .path})\"   // syntax error\n// after\ntransformation:\n  - expression: \"map(data, {#.path})\"","handlingStrategy":"validation","validationCode":"import \"github.com/expr-lang/expr\"\nfor i, step := range data.Transformation {\n    if _, err := expr.Compile(step.Expression, expr.Env(map[string]any{\"data\": sourcedData})); err != nil {\n        return fmt.Errorf(\"transformation step %d invalid: %w\", i, err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compile every transformation expression against the expected data shape in tests","Remember artifactPaths yields a list of path strings — write expressions accordingly","Chain steps carefully: each step sees the output of the previous one","Use docs examples for filter/map/sort syntax"],"tags":["data-template","expression-evaluation","transformation","argo-workflows"],"backgroundTag":"expression-evaluation-failed","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}