Skip to content

Tasks and Tokens

A task is a unit of work within a workflow. Tasks are joined together with edges to form a sequence.

workflow-diagram1.png

Workflows use the concept of a token, a mythical "pointer" that moves from task to task along edges. When a particular task gets the token, it can execute. When a task completes, it releases the token. The token then tries to advance along an edge to another task. Whenever the token cannot advance, the sequence terminates.

The diagram above shows a simple sequence. The token moves from Trigger1 to Task1, then to Task2 and so on until it reaches Task3 where the sequence terminates.

Triggers

Trigger creates tokens. Whenever a trigger fires, a new token is created. The token will then advance along a sequence until it terminates.

There are many kinds of triggers. Here are the three more common ones:

workflow-diagram2.png

In this example, the workflow can begin manually at the manual trigger, on a schedule, or can be called from another workflow.

Notice that each trigger starts the token at a different location. This illustrates how it's also possible to have each trigger point to a different starting point within a sequence.

workflow-diagram3.png

It is possible to have several of the same kinds of triggers. It is also possible to have triggers that point to completely separate and unrelated sequences within a workflow.

Edges

The most common edge is the basic edge. An edge is satisfied whenever its condition is true. A basic edge's condition is based upon the success or failure of the preceding task. It can be set to "Succeeded", "Failed", or "Completed", which means success or failure.

For complete documentation on edges, see Edges

Success and Failure

Each task can fail or succeed. A sequence of tasks succeeds whenever there are no edges that can be followed and the last task was successful.

workflow-diagram4.png

In this diagram, the last task in the sequence has succeeded. There are no outgoing edges, so the sequence succeeds.

workflow-diagram5.png

In this diagram, task 2 has failed. There is an outgoing edge, but its condition is based upon the success of task 2 and is therefore not satisfied. Because the token cannot advance, the status of the last task determines the status of the sequence. The sequence fails.

workflow-diagram6.png

In this diagram, task 2 has succeeded. There is an outgoing edge, but its condition is based upon the failure of task 2 and is therefore not satisfied. Because the token cannot advance, the status of the last task is the final status of the sequence. The sequence succeeds.

workflow-diagram7.png

In this diagram, task 2 has failed. There is an outgoing edge with a condition based upon the failure of task 2. Therefore, the token advances to task 3. Task 3 succeeds. The sequence succeeds.

Workload Automation and Orchestration