From 41d5160c41fe22b3385c6581aeaab56454cc519f Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 10 Jan 2025 10:29:03 +0100 Subject: [PATCH] Update workflow creation to use async commit method Replaced synchronous `CreateWorkflowInstance` with `CreateAndCommitWorkflowInstanceAsync` to ensure instance creation is properly committed. Included support for cancellation tokens to improve process control and reliability. --- .../Elsa.Workflows.Runtime/Services/LocalWorkflowClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Elsa.Workflows.Runtime/Services/LocalWorkflowClient.cs b/src/modules/Elsa.Workflows.Runtime/Services/LocalWorkflowClient.cs index a81b08e66..6b73d2906 100644 --- a/src/modules/Elsa.Workflows.Runtime/Services/LocalWorkflowClient.cs +++ b/src/modules/Elsa.Workflows.Runtime/Services/LocalWorkflowClient.cs @@ -40,7 +40,7 @@ public class LocalWorkflowClient( Properties = request.Properties }; - workflowInstanceManager.CreateWorkflowInstance(workflowGraph.Workflow, options); + await workflowInstanceManager.CreateAndCommitWorkflowInstanceAsync(workflowGraph.Workflow, options, cancellationToken); return new(); }