You can execute a script written in Java or JavaScript when a workflow completes to run. For example, you can specify a script to determine whether an activity completed successfully after the workflow runs.
Procedure
On the OnComplete Script tab, enter the code.
Tip: Click Insert Variable to add a workflow variable as needed.