Running workflow

Derick Larson

There are a few different ways to trigger a run of workflow. The topics below are the most common, with 'From a Source' being the most common.

Directly from Definition

Running a workflow directly from the definition is done in both the Task Tree Builder and list of trees.

In the Tree Builder, one of the options on the Action menu is to Run Tree. run from action on builder

Clicking on Run brings up the following dialog: run source data field From here it depends on the Source you are using and what the tree is expecting. For Request CE it is an extensive JSON string. For other applications it could be XML, or a simple lookup key.

To Run a workflow from the list of trees in Task, select Run from the drop-down options on the far right of the tree listing. run tree from list This brings up the same dialog as selecting Run from the tree builder.

From Previous Run

Workflow Runs provide you an opportunity to perform the run again option directly from the run itself. Similar to the builder and the tree list, there is an Action button, and the option to "Run Again'. The only difference in the dialog is that the Source Data field is prefilled with the previous input information. run again from list This is a great opportunity to alter existing inputs and see what happens with changes.

From Source

The above two options for running workflow are used more often for testing, creating, or troubleshooting than for running workflows for production purposes. Running a workflow from a source is normally done through a webhook that is initiated from the source itself. For example, here is the webhook configuration for Request: source webhook In the URL field, you can see the structure for the webhook.

Via API

If you need to run a workflow outside of the Task application, and not from a source application, you can use the API. Running a workflow is a POST action with the following structure: /run-tree/{source}/{group}/{tree}

Here is a more complete example using Kinetic Request as the source:

http://myServer:myPort/kinetic-task/app/api/v1/run-tree/Kinetic%20Request/Submissions%20%3E%20${kapp('slug')}%20%3E%20${form('slug')}/Submitted

For a form in the Services kapp with a slug of cleaning the structure would look like this:

http://myServer:myPort/kinetic-task/app/api/v1/run-tree/Kinetic Request/Submissions > services > cleaning/Submitted

The other piece required for this method is constructing and posting the input required for the source.

Kinetic Task includes in-app documentation that lets you experiment with the different API methods. From any console in Task, select Help in the top right corner, and then select Reference Docs. For creating a Run, you select the Api v1 References and then Runs. api docs run