# Task

This type defines the task to execute of a given instance of a service.

By default, the task's inputs are the previous step's outputs. It can be customized by defining the inputs parameter to reference the outputs of any previous steps.

# Definition

Attribute Type Description
type "task"
key string (optional) Key to identify this step
instance

Information about the instance of the service to run.

Attribute Type Description
src string Source of the service to deploy
env string[] (optional) Environment variable to use for the service
taskKey string Key of the task to execute
inputs map<string, Input> (optional) Task's inputs. If not defined, inputs are the previous step's outputs

# Input

Inputs can be any of the following types:

# Constant

The types string, bool, and number are constant and lets you hardcode a value.

# Example

inputs:
  stringInput: "Input1 to the task"
  numberInput: 10
  booleanInput: true
  arrayInput:
    - "first item"
    - "second item"
  object:
    firstAttribute: 10
    secondAttribute: true
    thirdAttribute: "anything"

# Reference

The reference type allows access to the data of a previous result or the previous step of a process. The reference is a special object that must contain the attribute key and, optionally, the parameter stepKey.

Attribute Type Description
key string Path to the value of the to reference
stepKey string (optional) Key of the step to reference (defined with the attribute key of the step). If not defined, the previous step is used

The parameter key is the path of data to access. To write a path, you need to follow a simplified JSON path format:

  • KEY_NAME to access a key.
  • . to access data in an object.
  • [INDEX] to access an element in an array at the index INDEX. (You might get a runtime error if your index is out of bounds).

# Examples

  • foo: Access the variable foo.
  • foo.bar: Access the variable bar in the object foo.
  • foo[0]: Access the first element of the array foo.
  • foo[0].bar[1]: Access the second element of the array bar contained in the first element of the array foo.
  • foo[0][1]: Access the second element in the first element of the array foo.
inputs:
  referenceInput:
    key: outputA
    stepKey: my-previous-step-x
  referenceWithPathInput:
    key: outputB.attrX[0]
    stepKey: my-previous-step-x

# Composable

The types array and object are composable. They can contain data of any types including other composable and reference types.

  • An array of array of string. Eg: [["foo", "bar"], [""]]
  • An object with another object that contains an array of object data. Eg: { a: { b: [{ c: "" }] } }

# Examples

objectInput:
  numberInput: 10
  booleanInput: true
arrayInput:
  - foo
  - bar
objectInput:
  referenceInputInObject:
    key: outputA
    stepKey: my-previous-step-x

# Example

key: my-feature
steps:
  - type: task
    key: my-previous-step-x
    instance:
      service: ./services/serviceX
    taskKey: taskY
  # ...
  - type: task
    instance:
      service: ./services/serviceX
    taskKey: taskY
    inputs:
      stringInput: "Input1 to the task"
      objectInput:
        numberInput: 10
        booleanInput: true
      arrayInput:
        - foo
        - bar
      referenceInput:
        key: outputA
        stepKey: my-previous-step-x
      referenceWithPathInput:
        key: outputB.attrX[0]
        stepKey: my-previous-step-x
  # ...