The Simplest Way to Make Airflow and Buildkite Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair airflow and buildkite to link data jobs with code builds in production. Airflow schedules the data tasks, while Buildkite tests and ships the code. Data teams need fresh code before they run daily batch jobs. App teams need clean data before they test new builds. Linking these two tools stops manual handoffs between teams. One tool triggers the next step as soon as its own work finishes. This setup keeps code builds and data pipelines in sync every day. How airflow and buildkite sh

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair airflow and buildkite to link data jobs with code builds in production. Airflow schedules the data tasks, while Buildkite tests and ships the code.

Data teams need fresh code before they run daily batch jobs. App teams need clean data before they test new builds. Linking these two tools stops manual handoffs between teams. One tool triggers the next step as soon as its own work finishes. This setup keeps code builds and data pipelines in sync every day.

How airflow and buildkite share keys and data

Airflow runs on a set clock or waits for an outside event. Buildkite uses a hosted control plane and runs agents on your own servers. The two systems talk over HTTPS using standard web calls.

In one common flow, Buildkite finishes a test run and calls the Airflow API. This call tells Airflow to start a specific data job right away. In the reverse flow, an Airflow task calls the Buildkite API. This step starts a new build after fresh data lands in storage.

Each call needs a valid key or token to log in. Airflow stores a Buildkite API token in its secret backend. Buildkite agents fetch an Airflow user key from a secure secret store. Neither tool should pass raw data files over these web calls. Instead, pass short metadata like a git commit hash or a storage path. Both tools then read or write large data sets in shared cloud storage.

Common failure modes and how to scope roles

Many teams start by sharing one admin token across all pipelines. This shortcut creates huge security risks for the whole team. If one build job leaks that token, an attacker controls every pipeline. Shared accounts also ruin your audit logs. When five pipelines use one key, you cannot tell who started a bad run.

Long-lived keys cause trouble when engineers leave the team or change roles. Old tokens often stay active in forgotten build steps for months. Unlogged API calls also blind your security team during an incident. You need clear logs that show which agent triggered which data task.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Fix this by creating a dedicated role for each pipeline pair. Give the Buildkite agent a role that only starts one specific Airflow job. Give the Airflow task a token that only triggers one Buildkite pipeline. Set every token to expire on a regular schedule. Rotate these keys using your cloud secret manager so humans never read them.

Network paths and status checks between jobs

Network rules play a big part in keeping both systems safe. Buildkite agents already run inside your private cloud network. Keep your Airflow web server off the public internet whenever you can. Let Buildkite agents reach the Airflow API over a private network link. This setup blocks outside attackers from hitting your scheduler.

When Airflow calls out to Buildkite, limit where the worker nodes can go. Allow outbound traffic only to the known Buildkite API address and your cloud storage. Good pipelines also check job status instead of firing blind requests. Have the calling task wait and poll until the remote job reports success. If the build fails, the data job stops right away and alerts the team. Clear timeouts stop stuck builds from holding up your data workers all night.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should Airflow trigger Buildkite or should Buildkite trigger Airflow?

Use Buildkite to trigger Airflow right after you deploy new pipeline code. Have Airflow trigger Buildkite when a build depends on fresh data tables.

Where should we store the API tokens for both tools?

Store all tokens in a dedicated cloud secret manager. Let both Airflow workers and Buildkite agents fetch keys at run time.

How do we pass data between a build step and a data task?

Write the data to a shared cloud bucket first. Pass only the bucket path and run ID in the API call.

The query runs. The emails stay hidden.