Registry /
workflow / apache-airflow-providers-apache-beam
The `apache-airflow-providers-apache-beam` package provides operators and hooks to seamlessly integrate Apache Airflow with Apache Beam. Apache Beam is an open-source, unified model for defining both batch and streaming data-parallel processing pipelines. This provider enables Airflow users to define, schedule, and monitor Beam pipelines, which can then be executed by various Beam-supported backends such as Apache Flink, Apache Spark, or Google Cloud Dataflow. The provider follows a roughly 2-3 month minor release cadence, with patch releases issued on an as-needed basis.
Install & Compatibility
Where this runs
tested against v6.2.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.940 runs
build_error
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 45.9s · import 0.000s · 884MB
913MB installed
● package 913MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ApacheBeamHook
✓ from airflow.providers.apache.beam.hooks.beam import ApacheBeamHook
✗ from airflow.providers.apache.beam.hooks.beam import ApacheBeamHook
This quickstart demonstrates how to use the `BeamRunPythonPipelineOperator` to execute an Apache Beam Python pipeline via Google Cloud Dataflow. It assumes an existing Beam Python script is stored in a Google Cloud Storage (GCS) bucket and uses environment variables for project and bucket configuration.
from airflow.models.dag import DAG
from airflow.providers.apache.beam.operators.beam import BeamRunPythonPipelineOperator
from datetime import datetime
import os
# NOTE: For this example to run, ensure you have a Python Beam pipeline script
# available at the specified GCS path (or a local path).
# E.g., a simple 'my_beam_pipeline.py' file in GCS:
# import apache_beam as beam
# from apache_beam.options.pipeline_options import PipelineOptions
# def run_pipeline(argv=None):
# with beam.Pipeline(options=PipelineOptions(argv)) as pipeline:
# (pipeline | 'Create' >> beam.Create(['Hello', 'Airflow', 'Beam'])
# | 'Log' >> beam.Map(print))
# if __name__ == '__main__':
# import logging
# logging.getLogger().setLevel(logging.INFO)
# run_pipeline()
# Define environment variables for the example; replace with your actual values.
# Ensure 'your-gcp-project-id' and 'your-bucket' are valid and accessible.
GCP_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'your-gcp-project-id')
GCS_BEAM_PYTHON_FILE = os.environ.get('GCS_BEAM_PYTHON_FILE', 'gs://your-bucket/path/to/my_beam_pipeline.py')
GCS_TEMP_LOCATION = os.environ.get('GCS_TEMP_LOCATION', 'gs://your-bucket/tmp')
with DAG(
dag_id='example_apache_beam_python_pipeline',
start_date=datetime(2023, 1, 1),
schedule_interval=None,
catchup=False,
tags=['apache_beam', 'dataflow', 'python'],
) as dag:
run_python_beam_pipeline = BeamRunPythonPipelineOperator(
task_id='run_python_beam_pipeline',
py_file=GCS_BEAM_PYTHON_FILE,
pipeline_options=[
f'--project={GCP_PROJECT_ID}',
'--runner=DataflowRunner',
f'--temp_location={GCS_TEMP_LOCATION}',
'--region=us-central1',
'--staging_location=gs://your-bucket/staging', # Optional
],
# If not using the default 'google_cloud_default' Airflow connection,
# specify gcp_conn_id='your_gcp_connection_id'
)
airflow --version
Debug
Known issues
breakingThe `delegate_to` parameter was removed from all Beam operators in version 5.0.0 of the provider. This primarily affected GCS and Dataflow hooks.fixUse the `impersonation_chain` parameter instead to achieve impersonation for your Beam operators.
affects: >=5.0.0
gotchaPotential dependency conflicts can arise when `apache-beam[gcp]` and `apache-airflow-providers-google` are installed together, particularly if `apache-beam` does not support newer Google Python clients. This can lead to unexpected behavior or issues with BigQuery operators.fixEnsure `apache-beam` and `apache-airflow-providers-google` are on compatible versions. Installing the `apache-airflow-providers-apache-beam[google]` extra helps manage these cross-provider dependencies. For Dataflow, verify that your `apache-beam` version supports the Google Python clients used by the `google` provider. Upgrading both providers to their latest versions is often the simplest solution.
affects: <6.2.3 (older provider versions and incompatible `apache-beam` versions)
breakingProvider versions have increasing minimum Apache Airflow core version requirements. For example, provider version 6.2.0 and higher require Airflow 2.11.0+. Installing a newer provider version on an older Airflow core might automatically upgrade Airflow, potentially requiring a `airflow upgrade db` migration.fixBefore upgrading the provider, verify your Airflow core version meets the minimum requirement (`apache-airflow >=2.11.0` for provider 6.2.0+). Upgrade Airflow first if necessary, and be prepared to run `airflow upgrade db`.
affects: >=6.2.0
breakingSupport for Python 3.9 was dropped in provider version 6.1.2. The provider now requires Python >=3.10.fixEnsure your Airflow environment is running Python 3.10 or newer before upgrading to provider versions 6.1.2 or later.
affects: >=6.1.2
Audit
Dependencies
apache-airflowrequiredCore Apache Airflow installation; provider version 6.2.0+ requires Airflow >=2.11.0.
apache-beamrequiredRequired for defining and executing Apache Beam pipelines; provider version 6.1.1+ requires Apache Beam >=2.60.0.
apache-airflow-providers-googleoptionalRequired for running Apache Beam pipelines on Google Cloud Dataflow, which is a common use case. Install with the `google` extra.