{"record":{"id":"ce87557b79ddecb5","repo":"microsoft/semantic-kernel","slug":"failed-to-load-the-agent-for-node-with-id-node-id","errorCode":null,"errorMessage":"Failed to load the agent for node with id {node.Id}.","messagePattern":"Failed to load the agent for node with id (.+?)\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs","lineNumber":205,"sourceCode":"            throw new ArgumentException($\"The agent specified in the Node with id {node.Id} is not fully specified.\");\n        }\n\n        // For dotnet node type, the agent type specifies the assembly qualified namespace of the class to be executed.\n        Type? dotnetAgentType = null;\n        try\n        {\n            if (stepTypes is not null && stepTypes.TryGetValue(node.Agent.Type, out var type) && type is not null)\n            {\n                dotnetAgentType = type;\n            }\n            else\n            {\n                dotnetAgentType = Type.GetType(node.Agent.Type);\n            }\n        }\n        catch (TypeLoadException tle)\n        {\n            throw new KernelException($\"Failed to load the agent for node with id {node.Id}.\", tle);\n        }\n\n        if (dotnetAgentType == null)\n        {\n            throw new KernelException(\"The agent type specified in the node is not found.\");\n        }\n\n        var stepBuilder = processBuilder.AddStepFromType(dotnetAgentType, id: node.Id);\n        this._stepBuilders[node.Id] = stepBuilder;\n        return Task.CompletedTask;\n    }\n\n    #endregion\n\n    #region Orchestration\n\n    private Task BuildOrchestrationAsync(List<OrchestrationStep> orchestrationSteps, ProcessBuilder processBuilder)\n    {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs#L187-L223","documentation":"Thrown by BuildDotNetStepAsync when resolving node.Agent.Type throws a TypeLoadException (the step class cannot be loaded). The inner TypeLoadException is wrapped so the node Id is included, distinguishing load failures from missing-type failures.","triggerScenarios":"node.Agent.Type is a non-empty string that fails Type.GetType / the stepTypes lookup because the assembly is not referenced, the type name is malformed, or the assembly fails to load.","commonSituations":"Step assembly not deployed/referenced; assembly-qualified name with a typo or stale version; preloaded stepTypes dictionary missing the requested key while the string form is also unresolvable.","solutions":["Reference/deploy the assembly containing the step type so Type.GetType can resolve it.","Pass a stepTypes dictionary mapping node.Agent.Type to the resolved Type to avoid runtime assembly probing.","Inspect the inner TypeLoadException for the exact failing assembly/type and fix the name string.","Ensure the assembly-qualified name includes the correct full type name, assembly name, version, and token."],"exampleFix":"// before: assembly not referenced -> TypeLoadException\nnode.Agent.Type = \"MyApp.Steps.MyStep, MyApp.Steps\";\n\n// after: pass pre-resolved type map\nvar stepTypes = new Dictionary<string, Type> { [\"MyApp.Steps.MyStep, MyApp.Steps\"] = typeof(MyStep) };\nawait builder.BuildProcessAsync(workflow, yaml, stepTypes);","handlingStrategy":"try-catch","validationCode":"var stepTypes = new Dictionary<string, Type> { [\"MyApp.Steps.MyStep, MyApp.Steps\"] = typeof(MyStep) };\n// pass stepTypes to BuildProcessAsync to bypass Type.GetType probing","typeGuard":"static bool CanResolveType(string name, Dictionary<string, Type>? preloaded) => (preloaded?.ContainsKey(name) == true) || Type.GetType(name) is not null;","tryCatchPattern":"try { await builder.BuildProcessAsync(workflow, yaml, stepTypes); }\ncatch (KernelException ex) when (ex.InnerException is TypeLoadException)\n{ /* inspect inner message for the failing assembly/type; deploy or pre-map it */ }","preventionTips":["Deploy all step assemblies alongside the host process.","Pre-populate the stepTypes dictionary for reliable resolution.","Log the inner TypeLoadException details during diagnosis."],"tags":["semantic-kernel","process","workflow","dotnet","type-load","reflection"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}