Using the maestro API to work with tasks
Sample PHP code to interact with the Drupal maestro module (workflow engine)
https://drupal.org/project/maestro