diff --git a/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs b/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs index 05d5d1d558..cb9dd853c7 100644 --- a/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs +++ b/src/modules/Elsa.Workflows.Core/Extensions/ExpressionExecutionContextExtensions.cs @@ -314,6 +314,12 @@ public static IEnumerable EnumerateVariablesInScope(this ExpressionExe currentScope = currentScope.ParentContext; } + + if (context.TryGetWorkflowExecutionContext(out var workflowExecutionContext)) + { + if (workflowExecutionContext.Workflow.ResultVariable != null) + yield return workflowExecutionContext.Workflow.ResultVariable; + } } ///