# Trigger

A trigger defines what starts the execution the steps of a process.

WARNING

The trigger must be the first step of the process and only one trigger is possible per process.

There are 2 type of trigger:

# HTTP endpoint

By setting the parameter endpointKey, the process will be triggered every time a POST request is made to a dedicated and generated URL.

TIP

The URL will be generated by the commands dev and deploy.

# Definition

Attribute Type Description
type "trigger"
key string (optional) Key to identify this step
endpointKey string A key used to generate a unique URL

# Example

key: my-feature
steps:
  - type: trigger
    endpointKey: endpointX
  # ...

# Data

The HTTP endpoint trigger contains the following data:

Name Key Type Description
body body Object All the data contained in the request body
headers headers Object All the headers contained in the request
timestamp timestamp Number Time of the request in milliseconds

WARNING

These data can be used only in the first following step.

# Task's result

By setting the parameter taskKey, the process will be triggered every time the specified service finishes to execute the task taskKey.

# Definition

Attribute Type Description
type "trigger"
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 Task's key of the result to listen to.

# Example

key: my-feature
steps:
  - type: trigger
    instance:
      src: ./services/serviceX
      env:
        - FOO=BAR
    taskKey: taskX # listen to the result of the task with the key `taskX`
  # ...