Initiating Workfows
There are a few different ways to trigger a workflow to run. The topics below are the most common, with 'From a Source' being the most common.
Directly from the Workflow Builder
Running a workflow directly from the definition is done in both the Task Workflow Builder and the list of trees.
Clicking Run displays a dialog that varies depending on the Source you're using and what the tree expects. For Kinetic Request CE, the tree expects a JSON string; for other applications, it might be XML or a lookup key. For Routines, you'll need to enter the defined input.
From Previous Run
You can also use the Run Again option directly from the run itself. This method prefills the Source Data field with the previous input information.
This is a great opportunity to alter existing inputs and see what happens with changes.
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/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.
Updated 11 months ago