The Workflow JavaScript API has useful additional functions to interact with jobs and tasks, For example:
A full list can be found in the reference documentation.