You are viewing limited content. For full access, please sign in.

Question

Question

How to Get Workflow Parameters value after trigging a workflow from my code

asked on December 26, 2023

Hello ,

 I am able to start a workflow with input parameter from my application code but want to get the result output values?

//Starting workflow 
 WorkflowConnection connection = WorkflowConnection.CreateConnection("Localhost", "APP");

 Dictionary<string, string> parameters = new Dictionary<string, string>();
 PublishedWorkflow newEmployeeWF = connection.Database.GetPublishedWorkflow("Numeric Arabic Literal");
 parameters.Add("Value_in", "343434");

newEmployeeWF.StartWorkflow(parameters);

// want the output parameters values?

 

 

0 0

Replies

replied on December 27, 2023

Workflows do not really work that way. When you initiate a workflow, it is similar to sending an email; you get a response indicating whether or not the action was successful, but you don't get the final results back because the code doesn't wait around for the process to run.

One approach is to add an API controller/action to the application and then have the workflow send the data in a web request at the end of the workflow. Another less efficient option would be to periodically run a manual check for the results.

For example, with one application I start the workflow and pass a guid as one of the parameters, then at the end of the workflow I make an API call back to my application; I use the guid to connect the dots and pass back the results.

3 0
You are not allowed to follow up in this post.

Sign in to reply to this post.