{"record":{"id":"7991710e9409497b","repo":"argoproj/argo-workflows","slug":"agent-cannot-execute-unknown-task-type-v","errorCode":null,"errorMessage":"agent cannot execute: unknown task type: %v","messagePattern":"agent cannot execute: unknown task type: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/executor/agent.go","lineNumber":241,"sourceCode":"\t\t\t}\n\n\t\t\t// Patch was successful, clear nodeResults for next iteration\n\t\t\tnodeResults = map[string]wfv1.NodeResult{}\n\n\t\t\tlogger.Info(ctx, \"Patched TaskSet\")\n\t\t}\n\t}\n}\n\nfunc (ae *AgentExecutor) processTask(ctx context.Context, tmpl wfv1.Template) (*wfv1.NodeResult, time.Duration, error) {\n\tvar executeTemplate templateExecutor\n\tswitch {\n\tcase tmpl.HTTP != nil:\n\t\texecuteTemplate = ae.executeHTTPTemplate\n\tcase tmpl.Plugin != nil:\n\t\texecuteTemplate = ae.executePluginTemplate\n\tdefault:\n\t\treturn nil, 0, fmt.Errorf(\"agent cannot execute: unknown task type: %v\", tmpl.GetType())\n\t}\n\tresult := &wfv1.NodeResult{}\n\trequeue, err := executeTemplate(ctx, tmpl, result)\n\tif err != nil {\n\t\tresult.Phase = wfv1.NodeFailed\n\t\tresult.Message = err.Error()\n\t}\n\treturn result, requeue, nil\n}\n\nfunc (ae *AgentExecutor) executeHTTPTemplate(ctx context.Context, tmpl wfv1.Template, result *wfv1.NodeResult) (time.Duration, error) {\n\tif tmpl.HTTP == nil {\n\t\treturn 0, nil\n\t}\n\t// Read response.Body after cancel(), sometimes it return a context canceled error\n\t// For more detail  https://groups.google.com/g/golang-nuts/c/2FKwG6oEvos\n\tvar cancel context.CancelFunc\n\tif tmpl.HTTP.TimeoutSeconds != nil {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/executor/agent.go#L223-L259","documentation":"The AgentExecutor (which runs HTTP and plugin templates on behalf of the controller via WorkflowTaskSet) only supports templates whose type is http or plugin. If the resolved template has any other type (script, container, pod, etc.), processTask falls through to the default branch and returns this error, failing the node with the message in NodeResult.","triggerScenarios":"A WorkflowTaskSet contains a Task whose template is neither tmpl.HTTP nor tmpl.Plugin — e.g. a container/script/resource template was routed to the agent, or a template spec with no recognized typed field.","commonSituations":"Controller/executor version skew where a new template type is sent to an older executor; misconfigured workflow routing template kinds to the agent; a template that failed validation so no typed field (http/plugin) was populated; typos or empty template specs.","solutions":["Check the template spec in the WorkflowTaskSet/Workflow and ensure it defines an http: or plugin: field","Upgrade argoexec and workflow-controller to matching versions so the agent supports the template type","Run the template with a regular executor path (container/script) instead of the agent if it is not an HTTP or plugin template","Validate the workflow with `argo lint` before submitting to catch templates without a recognized type"],"exampleFix":"# before (template routed to agent, no typed field)\ntemplate:\n  name: my-task\n  metadata: {}\n# after\ntemplate:\n  name: my-task\n  http:\n    method: GET\n    url: https://example.com","handlingStrategy":"validation","validationCode":"// Before submitting, lint the workflow so every template has a supported typed field:\n// argo lint workflow.yaml\n// Programmatic check on a resolved template:\nfunc isAgentTemplate(t *wfv1.Template) bool {\n\treturn t.HTTP != nil || t.Plugin != nil\n}\nif !isAgentTemplate(tmpl) {\n\t// route to regular executor instead of agent\n}","typeGuard":"func hasSupportedAgentType(tmpl *wfv1.Template) bool {\n\treturn tmpl != nil && (tmpl.HTTP != nil || tmpl.Plugin != nil)\n}","tryCatchPattern":null,"preventionTips":["Run `argo lint` before submitting workflows","Keep controller and executor (argoexec) versions in lockstep","Never hand-write templates without a recognized typed field (http:/plugin:)","Check the agent's task list if tasks unexpectedly route to the agent"],"tags":["executor","plugin","http-template","template-type"],"backgroundTag":"unsupported-template-type","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"}