Search for Triggered Pipeline Executions

Use an API to search for triggered pipeline executions.

This guide describes how to use the searchForPipelineExecutionsByTrigger API to search for pipeline executions triggered by Pub/Sub messages or webhooks.

Pub/Sub

Structure your trigger

When you create the Pub/Sub message, add a field that can be used to identify the message. For example, you can add an id field with a randomly generated GUID string as its value.

  1. {
  2. "id": "9c3036f6-3791-47eb-bb69-30983acb00be"
  3. }

This id field can be used later to search for all pipelines executed by this trigger.

Query your triggered pipelines

To query for pipeline triggered by a specific Pub/Sub message, you can structure your API call with the following information:

  1. APPLICATION=<application-name> # This will narrow down results to only contain pipeline executions within a given application. You may supply '*' here to search across all applications.
  2. TRIGGER_TYPE=pubsub # This will narrow down results to only contain pipelines executions triggered by a Pub/Sub message
  3. TRIGGER=$(echo '{ "id": "9c3036f6-3791-47eb-bb69-30983acb00be" }' | base64) # This will narrow down results to only contain pipeline executions triggered with a payload that includes this key/value. We base64-encode this so that it can be passed as a query parameter to the API.
  4. # Example call to Gate
  5. curl localhost:8084/applications/$APPLICATION/executions/search?triggerTypes=$TRIGGER_TYPE&trigger=$TRIGGER

This call will return a list of pipeline executions triggered by a trigger with the given information, sorted by trigger time in reverse order so that newer executions are first in the list.

Query your webhook-triggered pipeline

Triggering a pipeline via a webhook returns a unique ID that can later be used to search for all pipelines executed by this trigger. The response body will contain an eventId field with a unique value.

  1. {
  2. "eventId": "c581dc8c-af6d-4ef0-8d84-27a64764b2f3"
  3. }

To query for pipeline executions triggered by a specific webhook call, you can structure your API call with the following information:

  1. APPLICATION=<application-name> # This will narrow down results to only contain pipeline executions within a given application. You may supply '*' here to search across all applications.
  2. TRIGGER_TYPE=webhook # This will narrow down results to only contain pipelines executions triggered by a webhook call
  3. EVENT_ID=c581dc8c-af6d-4ef0-8d84-27a64764b2f3 # eventId value returned by webhook call
  4. # Example call to Gate
  5. curl localhost:8084/applications/$APPLICATION/executions/search?triggerTypes=$TRIGGER_TYPE&eventId=$EVENT_ID

This call will return a list of pipeline executions triggered by a trigger with the given information, sorted by trigger time in reverse order so that newer executions are first in the list.


Last modified January 6, 2021: wip (9e753a5)