{"record":{"id":"7c435925069135e0","repo":"microsoft/semantic-kernel","slug":"a-complete-then-action-is-required-for-orchestrati","errorCode":null,"errorMessage":"A complete then action is required for orchestration steps.","messagePattern":"A complete then action is required for orchestration steps\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs","lineNumber":291,"sourceCode":"                    // The source is an input event.\n                    edgeBuilder = processBuilder.OnInputEvent(listenCondition.Event);\n                }\n                else\n                {\n                    throw new ArgumentException($\"An orchestration is referencing a node with Id `{listenCondition.From}` that does not exist.\");\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"A complete listen_for condition is required for orchestration steps.\");\n            }\n\n            // Now that we have a validated edge source, we can add the then actions\n            foreach (var action in thenActions)\n            {\n                if (action is null || string.IsNullOrWhiteSpace(action.Node))\n                {\n                    throw new ArgumentException(\"A complete then action is required for orchestration steps.\");\n                }\n\n                if (!this._stepBuilders.TryGetValue(action.Node, out ProcessStepBuilder? destinationStepBuilder))\n                {\n                    if (action.Node.Equals(\"End\", StringComparison.OrdinalIgnoreCase))\n                    {\n                        edgeBuilder.StopProcess();\n                        continue;\n                    }\n\n                    throw new ArgumentException($\"An orchestration is referencing a node with Id `{action.Node}` that does not exist.\");\n                }\n\n                // Add the edge to the node\n                edgeBuilder = edgeBuilder.SendEventTo(new ProcessFunctionTargetBuilder(destinationStepBuilder));\n            }\n        }\n","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs#L273-L309","documentation":"Thrown by WorkflowBuilder while iterating `thenActions` for an orchestration step: an individual action is null or its `Node` property is null/whitespace. Each `then` entry must name a concrete destination node (or the `\"End\"` sentinel). It is an ArgumentException raised in `AddOrchestrationStepAsync` after the edge source has already been validated.","triggerScenarios":"Provide a `then` array containing a null entry; provide a `then` entry whose `node` key is missing or empty; deserialize a workflow where a `then` action lost its `node` field.","commonSituations":"Hand-editing YAML and leaving a `then:` bullet with no `node`; serialization bug producing partial `ThenAction` objects; truncation during manual editing of large orchestration lists.","solutions":["Inspect every `then` entry in the orchestration step and confirm it has a non-empty `node` value.","Strip null entries from the `then` collection before building.","Validate the workflow structure programmatically before calling the builder."],"exampleFix":"// before\nthen:\n  - node: \"\"\n// after\nthen:\n  - node: NextStep","handlingStrategy":"validation","validationCode":"foreach (var step in workflow.Orchestration)\n{\n    if (step.Then is null) continue;\n    foreach (var action in step.Then)\n    {\n        if (action is null || string.IsNullOrWhiteSpace(action.Node))\n            throw new InvalidOperationException(\"Each then action must have a non-empty node.\");\n    }\n}","typeGuard":"bool IsValidThenAction(ThenAction a) => a is not null && !string.IsNullOrWhiteSpace(a.Node);","tryCatchPattern":"try { await builder.BuildAsync(); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"complete then action\"))\n{ _logger.LogError(ex, \"A then action is missing its node.\"); throw; }","preventionTips":["Filter nulls out of then collections before building: step.Then = step.Then.Where(a => a?.Node is not null).ToList();","Author workflows with typed DTOs that require Node at construction."],"tags":["workflow","process-framework","validation","orchestration","schema"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}