End workflow without interaction with Console #975
-
Hello all, I see in all the examples that the following lines are used to start and stop a workflow
My problem with this is that workflowHost.Stop() only gets reached if a Line is read from Console. I.e. I press Return in Console, then the command to Stop the Workflow Host is reached. I've checked this is the case by placing a breakpoint on this command and running my workflow in Debug mode. This is great for debugging. However, in production I'd like to run my workflows without any user interaction. In other words, I'd like the workflow to essentially stop itself when it comes to the end of it's run. Is this implemented currently? And if so, how do I achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
For those interested, I've found this SynchronousExecutionUtility that should accomplish what I'd like to do. I believe that this should return after running through the workflow a single time, thus removing the need for this Console.ReadLine() interaction with the Console window to come to end the application after the worflow ends. I am currently facing some issues with this however, so no promises that this will lead to the solution. |
Beta Was this translation helpful? Give feedback.
-
I've found a solution, though I don't understand why it works: I was instantiating my WorkflowExecutionUtility object like this before:
Now, I instantiate SingleNodeEventHub prior to the Utility, and use it as a construction param:
I'm still unsure as to why / how this works, but maybe anyone else with these issue can use this solution 👍 |
Beta Was this translation helpful? Give feedback.
I've found a solution, though I don't understand why it works:
I was instantiating my WorkflowExecutionUtility object like this before:
Now, I instantiate SingleNodeEventHub prior to the Utility, and use it as a construction param:
I'm still unsure as to why / how this works, but maybe anyone else with these issue can use this solution 👍