elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
5.87k stars 1.06k forks source link

Elsa workflow how to get Workflow Instance Id #5238

Closed albourm closed 3 weeks ago

albourm commented 3 weeks ago

Hello there,

I am using Elsa Workflow V3 to Create Workflow using The Designer so i want to get the Workflow instance id to be passed to other activity using JS Code in the Designer.

So, How to get the workflow instance id

Thanks.

glime-ai[bot] commented 3 weeks ago

To get the workflow instance ID in Elsa Workflow V3 using JavaScript code in the designer, you can use the built-in JavaScript functions provided by Elsa. However, the exact method to retrieve the workflow instance ID may vary depending on the context in which you are trying to access it.

If you are trying to access the workflow instance ID within an activity's JavaScript expression, you can typically use the workflowInstance object that is available in the JavaScript execution context. For example, you might use the following JavaScript code:

// Get the workflow instance ID
var instanceId = workflowInstance.Id;

Please note that the above code is a general example. The actual object and property names may differ based on the version of Elsa Workflow you are using and the context in which you are executing the JavaScript code.

If you are unable to retrieve the workflow instance ID using the method described above, or if you encounter any issues, please provide more details about where and how you are trying to access the workflow instance ID so that I can assist you further.

This comment was generated by Glime.

albourm commented 3 weeks ago

I want to get the Actual Workflow instance id not for the specific activity