Trigger Keys

Trigger keys are used to run a pipeline from outside of Cycle, such as in a CI/CD system.

Trigger keys are simply an HTTP endpoint and a secret that can be called from anywhere that has internet access. This provides ultimate flexibility, while the pipeline can be tailored specifically to dealing with the Cycle-side of a deployment.

curl https://api.cycle.io/v1/pipelines/<pipeline ID>/trigger \
    -H "Content-Type: application/json" \
    -d '{ "secret": "$TRIGGER_KEY_SECRET" }' \
    -X POST

Using Variables with Trigger Keys

Variables can be passed to a pipeline with a trigger key using the following syntax:

curl https://api.cycle.io/v1/pipelines/<pipeline ID>/trigger \
    -H "Content-Type: application/json" \
    -d '{ "secret": "$TRIGGER_KEY_SECRET", "variables": {"variable1": "hello", "variable2": "hello2"}  }' \
    -X POST

Triggering a Pipeline with a Sub-Queue

To trigger a run of a pipeline using a sub-queue, use the following format:

curl https://api.cycle.io/v1/pipelines/<pipeline ID>/trigger \
    -H "Content-Type: application/json" \
    -d '{ "secret": "$TRIGGER_KEY_SECRET", "advanced": {"sub_queue": "env-1" } }' \
    -X POST

Pipeline runs with the same sub_queue will be run serially, while different sub_queue values will be run in parallel.

A sub-queue name can be up to 25 characters.

[ADVANCED] Skipping Lock Checks

In some rare cases, it may be desired to have Cycle skip any resource lock checks when running a pipeline, such as with development pipelines that utilize variables for resources, where iteration speed is more important than assuring correctness. This is almost never necessary. However, as an escape hatch, this option is available, and the user takes all risk of ensuring two pipeline runs won't make conflicting changes when this flag is enabled.

curl https://api.cycle.io/v1/pipelines/<pipeline ID>/trigger \
    -H "Content-Type: application/json" \
    -d '{ "secret": "$TRIGGER_KEY_SECRET", "advanced": {"sub_queue": "env-1", "skip_locks": "<CURRENT UNIX EPOCH>" } }' \
    -X POST

where <CURRENT UNIX EPOCH> is replaced with the actual unix timestamp.

Create a Trigger Key on Cycle

Learn how to create a trigger key using the documentation below: