Jumps

You can use jumps to control what step in your workflow will execute next. For example, at the end of any step, you can use next to define what step should execute next:

YAML

  - STEP_NAME:
      ...
      next: STEP_NAME_TO_JUMP_TO
  

JSON

  [
    {
      "STEP_NAME": {
        ...
        "next": "STEP_NAME_TO_JUMP_TO"
      }
    }
  ]
    

You can also use next to do the following:

For more information about defining a workflow's order of execution, see Conditions and Control the order of execution in a workflow.

Explicit step ordering using jumps

This sample uses the next: command to explicitly define the sequence of workflow steps. In this sample, steps are executed in a different order than they appear in the workflow definition.

YAML

- first_step:
    call: http.get
    args:
      url: https://www.somewhere.com/callA
    next: second_step
- third_step:
    call: http.get
    args:
      url: https://www.somewhere.com/callB
    next: end
- second_step:
    call: http.get
    args:
      url: https://www.somewhere.com/callC
    next: third_step

JSON

[
  {
    "first_step": {
      "call": "http.get",
      "args": {
        "url": "https://www.somewhere.com/callA"
      },
      "next": "second_step"
    }
  },
  {
    "third_step": {
      "call": "http.get",
      "args": {
        "url": "https://www.somewhere.com/callB"
      },
      "next": "end"
    }
  },
  {
    "second_step": {
      "call": "http.get",
      "args": {
        "url": "https://www.somewhere.com/callC"
      },
      "next": "third_step"
    }
  }
]