In this recipe, we have taken a closer look at the workflow token. The workflow token is the execution of a given workflow.
In this example, we start a workflow asynchronously and then wait for it to finish the workflow token:
Create a new workflow and create the following variables:
Name
Type
Section
Use
sleepTime
Number
IN
It defines the time the workflow should sleep.
wfToken
WorkflowToken
Attribute
The workflow token of the asynchronous workflow.
waitTaskTime
Number
Attribute
How long to wait between checks.
Build the following workflow (
06.07.01 Wait for Workflow Token
in the example package):The custom decision element should contain the following script:
if (wfToken.state =="completed"){ return true; } else { return false; }
Save and run the workflow