Overview

You may often find yourself creating your workflows in the same way you would do the task if you were manually doing the task. This is not always the most efficient way to build a workflow. When working with a workflow, you want to take a look at your overall process and identify the parts of the process that:

  • Can or will be repeated
  • May need to be rerun separately from the rest of the process
  • May need to be versioned separately from the rest of the process

You can easily turn these parts of the process into routines that you can leverage in your main workflow. A routine is a workflow similar to a tree, but routines are not connected to a source so do not take external data. Instead, routines have defined parameters and return results, much like a handler. Routines can be called from trees or routines.

Repeating Processes

Repeating processes can be as simple as a two-node combination to send a notification or assign a ticket to something as complex as a full approval process.

Note: Keep in mind that repeating processes might have additional repeating processes nested within them. This also applies to repeating the same processes across workflows. If you find yourself adding the same two or more nodes more than once, we recommend considering whether the process should be made into a routine.

Complex, Error-Prone, or Distinct Processes

Say you have a process that connects to a system that is not particularly reliable, and you are likely to have to retry things associated with this system. Isolating these processes into a routine gives you the power to pause, rerun, or version the routine without affecting anything else in the workflow.

There are also situations where a process not being re-used may be appropriate for a routine. For example, let's say you have an approval routine that is being repeated and has nested processes for group approval and individual approval. Since the approval routine is called everywhere approval is used, the group and individual approval routines aren't used repeatedly. However, having them as separate routines allows them to be managed, supported, and versioned separately.