{"record":{"id":"7df4bdaec90d7b89","repo":"argoproj/argo-workflows","slug":"failed-to-parse-workflow-w","errorCode":null,"errorMessage":"failed to parse Workflow: %w","messagePattern":"failed to parse Workflow: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/convert.go","lineNumber":110,"sourceCode":"\tif err := yaml.Unmarshal(data, &typeMeta); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse TypeMeta: %w\", err)\n\t}\n\n\tvar converted any\n\n\t// Parse into legacy type and convert to current type\n\tswitch typeMeta.Kind {\n\tcase wf.CronWorkflowKind:\n\t\tvar legacy convert.LegacyCronWorkflow\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse CronWorkflow: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.WorkflowKind:\n\t\tvar legacy convert.LegacyWorkflow\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse Workflow: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.WorkflowTemplateKind:\n\t\tvar legacy convert.LegacyWorkflowTemplate\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse WorkflowTemplate: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tcase wf.ClusterWorkflowTemplateKind:\n\t\tvar legacy convert.LegacyClusterWorkflowTemplate\n\t\tif err := yaml.Unmarshal(data, &legacy); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse ClusterWorkflowTemplate: %w\", err)\n\t\t}\n\t\tconverted = legacy.ToCurrent()\n\n\tdefault:","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/convert.go#L92-L128","documentation":"When the document's kind is Workflow, convertDocument unmarshals into convert.LegacyWorkflow to convert singular mutex/semaphore fields to plural. A failure here means the body could not be decoded into the legacy Workflow struct, and the underlying yaml error is wrapped in this message.","triggerScenarios":"`argo convert` on a Workflow manifest with type mismatches against the legacy struct — e.g. `templates` as a mapping instead of a list, `entrypoint` as a non-string, sync/semaphore fields with list-vs-string confusion, or malformed container/script blocks.","commonSituations":"Very large or heavily templated workflows assembled by scripts where a field got emitted with the wrong type; workflows copied from other engines (Airflow/K8s Jobs) with foreign fields reshaped wrongly; YAML anchors producing sequences where scalars are expected.","solutions":["Fix the field flagged in the wrapped yaml error (path and expected type are usually included)","Run `argo lint` on the file for authoritative schema errors","Check that legacy singular fields (sync via semaphore/mutex) are shaped as the legacy struct expects before conversion","Convert documents one at a time in multi-doc files to pinpoint the offending Workflow"],"exampleFix":"// before\ntemplates:\n  main: {...}\n// after\ntemplates:\n  - name: main\n    ...","handlingStrategy":"validation","validationCode":"yq -e 'select(.kind == \"Workflow\") | .spec.templates | type == \"seq\"' file.yaml \\\n  || echo 'spec.templates must be a list'","typeGuard":null,"tryCatchPattern":"if ! argo convert \"$f\" 2>err; then\n  grep 'failed to parse Workflow' err && echo 'check the yaml path/type in the wrapped error'\nfi","preventionTips":["Ensure templates is a list of named template objects","Validate generated (script-emitted) workflows with argo lint before converting","Avoid hand-editing large workflows without a schema-aware editor/linter","Isolate per-document conversion in multi-doc files"],"tags":["cli","yaml","workflow","argoproj"],"backgroundTag":"manifest-parse-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"}