> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/buildkite.md).

# Buildkite

Browse Buildkite pipelines and builds and trigger builds from StackAI workflows.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication |
| --------- | -------------- |
| Buildkite | API Token      |

#### Buildkite

Connect to Buildkite to browse pipelines and builds and trigger new builds.

**Set up in Buildkite**

1. Prepare the Buildkite account or service that the workflow will access. Grant access to the required resources and operations.
2. Create or obtain the API credential identified in the fields below. Use the provider instructions linked with those fields to find its key-management page.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Buildkite**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required | What to enter                                                                                                                                                                          |
| ------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Token     | Yes      | A Buildkite API access token with read\_organizations, read\_pipelines, read\_builds, and write\_builds scopes. [Provider instructions](https://buildkite.com/user/api-access-tokens). |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Buildkite** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### List Pipelines

Browse pipelines in a Buildkite organization.

**Inputs**

| Field           | Type            | Required | Description                                                                                      |
| --------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------ |
| Organization    | select (string) | Yes      | The Buildkite organization whose pipelines to browse. Options load from the selected connection. |
| Pipeline name   | string          | No       | Only return pipelines whose names contain this text.                                             |
| Repository      | string          | No       | Only return pipelines whose repository URL contains this text.                                   |
| Maximum results | integer         | No       | The maximum number of pipelines to return. Minimum: 1. Default: 100.                             |
| Page            | integer         | No       | Continue from a page returned by an earlier call. Minimum: 1.                                    |

**Outputs**

| Field     | Type          | Description                                               |
| --------- | ------------- | --------------------------------------------------------- |
| Pipelines | object\_array | The matching Buildkite pipelines.                         |
| Next page | integer       | Pass this page number back to continue listing pipelines. |

#### Get Pipeline

Inspect one Buildkite pipeline and its current build and job counts.

**Inputs**

| Field        | Type            | Required | Description                                                                                   |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------- |
| Organization | select (string) | Yes      | The Buildkite organization that owns the pipeline. Options load from the selected connection. |
| Pipeline     | select (string) | Yes      | The pipeline to inspect. Options load from the selected connection.                           |

**Outputs**

| Field                | Type     | Description                                        |
| -------------------- | -------- | -------------------------------------------------- |
| Pipeline ID          | string   | The pipeline's unique Buildkite ID.                |
| Name                 | string   | The pipeline's display name.                       |
| Slug                 | string   | The pipeline slug used in Buildkite API paths.     |
| Repository           | string   | The repository configured for this pipeline.       |
| Default branch       | string   | The pipeline's default branch.                     |
| API URL              | string   | The Buildkite API URL for this pipeline.           |
| Web URL              | string   | The pipeline's URL in the Buildkite dashboard.     |
| Description          | string   | The pipeline description, if set.                  |
| Branch configuration | string   | The branches this pipeline is configured to build. |
| Visibility           | string   | Whether the pipeline is public or private.         |
| Cluster ID           | string   | The Buildkite cluster assigned to this pipeline.   |
| Created at           | datetime | When the pipeline was created.                     |
| Archived at          | datetime | When the pipeline was archived, if applicable.     |
| Allows rebuilds      | boolean  | Whether builds in this pipeline can be rebuilt.    |
| Scheduled builds     | integer  | Number of scheduled builds.                        |
| Running builds       | integer  | Number of running builds.                          |
| Scheduled jobs       | integer  | Number of scheduled jobs.                          |
| Running jobs         | integer  | Number of running jobs.                            |
| Waiting jobs         | integer  | Number of jobs waiting to run.                     |

#### List Builds

Browse recent builds for a Buildkite pipeline.

**Inputs**

| Field           | Type            | Required | Description                                                                                                                                                          |
| --------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Organization    | select (string) | Yes      | The Buildkite organization that owns the pipeline. Options load from the selected connection.                                                                        |
| Pipeline        | select (string) | Yes      | The pipeline whose builds to browse. Options load from the selected connection.                                                                                      |
| State           | select (string) | No       | Only return builds in this state. Available values: Creating, Scheduled, Running, Passed, Failing, Failed, Blocked, Canceling, Canceled, Skipped, Not run, Finished. |
| Branch          | string          | No       | Only return builds for this branch.                                                                                                                                  |
| Commit          | string          | No       | Only return builds for this exact commit.                                                                                                                            |
| Created from    | datetime        | No       | Only return builds created at or after this time.                                                                                                                    |
| Created before  | datetime        | No       | Only return builds created before this time.                                                                                                                         |
| Finished from   | datetime        | No       | Only return builds finished at or after this time.                                                                                                                   |
| Maximum results | integer         | No       | The maximum number of builds to return. Minimum: 1. Default: 100.                                                                                                    |
| Page            | integer         | No       | Continue from a page returned by an earlier call. Minimum: 1.                                                                                                        |

**Outputs**

| Field     | Type          | Description                                     |
| --------- | ------------- | ----------------------------------------------- |
| Builds    | object\_array | The matching Buildkite builds, newest first.    |
| Next page | integer       | Pass this back as Page to continue, if present. |

#### Get Build

Inspect one Buildkite build and its jobs.

**Inputs**

| Field                | Type            | Required | Description                                                                                   |
| -------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------- |
| Organization         | select (string) | Yes      | The Buildkite organization that owns the pipeline. Options load from the selected connection. |
| Pipeline             | select (string) | Yes      | The pipeline that contains the build. Options load from the selected connection.              |
| Build                | select (string) | Yes      | The pipeline-local build number to inspect. Options load from the selected connection.        |
| Include retried jobs | boolean         | No       | Include previous executions of jobs that were retried. Default: false.                        |

**Outputs**

| Field         | Type          | Description                                   |
| ------------- | ------------- | --------------------------------------------- |
| Build ID      | string        | The build's unique Buildkite ID.              |
| Build number  | integer       | The pipeline-local build number.              |
| State         | string        | The build's current state.                    |
| Commit        | string        | The source commit used by this build.         |
| Branch        | string        | The source branch used by this build.         |
| API URL       | string        | The Buildkite API URL for this build.         |
| Web URL       | string        | The build's URL in the Buildkite dashboard.   |
| Blocked       | boolean       | Whether the build is waiting on a block step. |
| Cancel reason | string        | Why the build was canceled, if applicable.    |
| Message       | string        | The build message.                            |
| Source        | string        | What created the build.                       |
| Created at    | datetime      | When the build was created.                   |
| Scheduled at  | datetime      | When the build was scheduled.                 |
| Started at    | datetime      | When the build started.                       |
| Failing at    | datetime      | When the build first began failing.           |
| Finished at   | datetime      | When the build finished.                      |
| Jobs          | object\_array | Safe summaries of the jobs in this build.     |

#### Create Build

Trigger a new build for a Buildkite pipeline.

**Inputs**

| Field                 | Type            | Required | Description                                                                                   |
| --------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------- |
| Organization          | select (string) | Yes      | The Buildkite organization that owns the pipeline. Options load from the selected connection. |
| Pipeline              | select (string) | Yes      | The pipeline to build. Options load from the selected connection.                             |
| Commit or ref         | string          | Yes      | The commit SHA, branch ref, or tag to build. Default: HEAD.                                   |
| Branch                | string          | Yes      | The branch this build belongs to for pipeline and step filtering.                             |
| Message               | string          | No       | A short reason or description for the build.                                                  |
| Environment variables | string          | No       | Comma-separated KEY=VALUE pairs to expose to the build.                                       |
| Metadata              | string          | No       | Comma-separated KEY=VALUE metadata to attach to the build.                                    |
| Clean checkout        | boolean         | No       | Remove any existing build directory before checkout. Default: false.                          |

**Outputs**

| Field | Type   | Description                        |
| ----- | ------ | ---------------------------------- |
| Build | object | The newly created Buildkite build. |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/buildkite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
