Skip to content

Triggers

When a pipeline reaches READY status, Interlock executes its configured trigger to start the downstream job. The trigger.Runner dispatches to type-specific handlers and returns metadata for status polling.

TriggerConfig

trigger:
  type: http           # required: trigger type
  method: POST         # type-specific fields below
  url: https://...
  timeout: 60

Common Fields

FieldTypeDefaultDescription
typestringTrigger type (required)
timeoutint30Execution timeout in seconds

Trigger Types

http

Sends an HTTP request to an arbitrary endpoint.

trigger:
  type: http
  method: POST
  url: https://api.example.com/jobs/start
  headers:
    Authorization: "Bearer ${TOKEN}"
    Content-Type: application/json
  body: '{"pipeline": "my-pipeline", "date": "${DATE}"}'
  timeout: 30
FieldTypeDescription
methodstringHTTP method (GET, POST, PUT)
urlstringTarget URL
headersmapHTTP headers
bodystringRequest body (supports template variables)

command

Executes a shell command on the local machine. Only available in local (watcher) mode.

trigger:
  type: command
  command: /usr/local/bin/run-etl --pipeline my-pipeline
  timeout: 300
FieldTypeDescription
commandstringShell command to execute

airflow

Triggers an Apache Airflow DAG run and polls for completion.

trigger:
  type: airflow
  url: https://airflow.example.com
  dagID: my_dag
  headers:
    Authorization: "Bearer ${AIRFLOW_TOKEN}"
  pollInterval: 1m
FieldTypeDescription
urlstringAirflow webserver URL
dagIDstringDAG identifier
headersmapAuthentication headers
pollIntervalstringStatus poll interval (e.g. 1m)

glue

Starts an AWS Glue job run.

trigger:
  type: glue
  jobName: my-glue-etl
  arguments:
    "--pipeline": my-pipeline
    "--date": "${DATE}"
FieldTypeDescription
jobNamestringGlue job name
argumentsmapJob arguments (keys prefixed with --)

Returned metadata: jobRunId — used by run-checker to poll GetJobRun.

emr

Submits a step to an existing EMR cluster.

trigger:
  type: emr
  clusterID: j-1234567890ABC
  arguments:
    "--class": com.example.ETLJob
    "--jar": s3://bucket/etl.jar
FieldTypeDescription
clusterIDstringEMR cluster ID
argumentsmapStep arguments

Returned metadata: clusterID, stepId — used by run-checker to poll DescribeStep.

emr-serverless

Starts a job run on EMR Serverless.

trigger:
  type: emr-serverless
  applicationID: "00f00abcde12345"
  arguments:
    "--class": com.example.ETLJob
    "--s3-input": s3://bucket/input/
FieldTypeDescription
applicationIDstringEMR Serverless application ID
argumentsmapJob run arguments

Returned metadata: applicationId, jobRunId — used by run-checker to poll GetJobRun.

step-function

Starts an AWS Step Functions execution.

trigger:
  type: step-function
  stateMachineARN: arn:aws:states:us-east-1:123456789:stateMachine:my-workflow
  body: '{"input": "value"}'
FieldTypeDescription
stateMachineARNstringStep Function state machine ARN
bodystringJSON input to the execution

Returned metadata: executionArn — used by run-checker to poll DescribeExecution.

databricks

Submits a job run to Databricks via REST API 2.1.

trigger:
  type: databricks
  workspaceURL: https://my-workspace.cloud.databricks.com
  headers:
    Authorization: "Bearer ${DATABRICKS_TOKEN}"
  body: '{"job_id": 12345, "notebook_params": {"date": "${DATE}"}}'
FieldTypeDescription
workspaceURLstringDatabricks workspace URL
headersmapAuthentication headers
bodystringJSON request body (Jobs API 2.1 format)

Returned metadata: runId — used by run-checker to poll via GET /api/2.1/jobs/runs/get.

Template Variables

The body and arguments fields support template substitution. Variables are resolved at trigger time:

VariableValue
${DATE}Current date (YYYY-MM-DD)
${PIPELINE}Pipeline ID
${SCHEDULE}Schedule ID
${RUN_ID}Run ID (UUID v4)

Status Polling

After a trigger executes, the run-checker Lambda (or watcher loop) polls for completion using the returned metadata. Each trigger type implements CheckStatus():

TypeSDK CallStatus Mapping
glueGetJobRunRUNNING→running, SUCCEEDED→succeeded, FAILED/STOPPED→failed
emrDescribeStepRUNNING/PENDING→running, COMPLETED→succeeded, FAILED/CANCELLED→failed
emr-serverlessGetJobRunRUNNING/SUBMITTED→running, SUCCESS→succeeded, FAILED/CANCELLED→failed
step-functionDescribeExecutionRUNNING→running, SUCCEEDED→succeeded, FAILED/TIMED_OUT/ABORTED→failed
databricksGET /runs/getRUNNING/PENDING→running, TERMINATED(SUCCESS)→succeeded, others→failed
airflowGET /dags/{id}/dagRunsrunning→running, success→succeeded, failed→failed

The http and command types are fire-and-forget — they do not support status polling.