Set WorkflowInstance Key in Script

Is there a way to set the WorkflowInstance Key into a global variable from within a script (running from the same Workflow Instance)?

Something like:

vWorkflowInstanceByKey := WorkflowInstanceByKey;

WorkflowInstanceByKey is a function, not a variable, so I'm afraid it cannot be assigned to?

Sorry, let me correct my question.

Can I get the actual key (ID) from the current Workflow Instance and save that to a variable in a Script running inside the current Workflow Instance?

vWorkflowInstanceID := <Key of current Workflow Instance>;

Yes:


vWorkflowInstanceId := _Workflow.WorkflowInstance.Key;

Thank you. Great support by the way.