Routines are used to share a process (Task Tree).
Routines are used when you have a process that is repeatable across many trees. Examples include approval or notification processes. Once a routine is created it is used almost exactly like a normal tree with the following exceptions. It is not tied to a single submission, all inputs are provided to the tree or collected as part of the tree. All routines must have a Tree Return node as an end to their process and return to the tree that called them.
It is possible (and common) for a routine to call another routine. You can also use a routine within a Loop and call it a dynamic number of times.
Creating a Routine is closer to creating a handler than it is a tree. It has the same naming issues, and you must define the inputs and outputs.
Name - required, descriptive name for the Routine
Definition ID - required, unique Id for the routine
Status - required, Active (default), Inactive, Paused
Categories - placement of the routine in a category on the builder
Inputs and Outputs
Like a handler, each routine needs inputs and outputs.
The following is available for both Inputs and Outputs
Name - required, descriptive name for the parameter
Description - optional, help text to describe purpose of the Name
Inputs can be labeled as Required in the handler for the routine.
The "+" on the left side of both Inputs and Outputs is used to adjust the order the parameters appear.
Click on Remove to delete an Input or Output.
The System Return node reflects the routine that is currently open in the builder. When added to a Routine, it returns to the tree that called it and returns the a result of designated Output.
Routines are created nearly the same as Parent or non-routine trees. The major difference is that they have no access to any information from the Space, Kapp, or Form. As mentioned above a routine only knows about the information in its inputs or some specific information about its parent. Here are the available parameters from within a routine:
Source Information - Data, Group, Name, and ID
System - Parent Run ID, Run ID, Token, Trigger Message
Tree Input - defined by Routine
Task Results - defined by the other nodes in the Routine