This page shows you how to install or update the [Apache Beam SDK](https://beam.apache.org/) so
that you can run your pipelines on the Dataflow service.

> [!CAUTION]
> **Dataflow SDK Deprecation Notice:** The Dataflow SDK 2.5.0 is the last Dataflow SDK release that is separate from the Apache Beam SDK releases. The Dataflow service fully supports official Apache Beam SDK releases. See the [SDK version support status](https://docs.cloud.google.com/dataflow/docs/support/sdk-version-support-status) page for the support status of various SDKs.

## Install the Apache Beam SDK

The [Apache Beam SDK](https://beam.apache.org/get-started/beam-overview/)
is an open source programming model for data pipelines. You define these
pipelines with an Apache Beam program and can choose a runner, such as
Dataflow, to execute your pipeline.

### Java

The latest released version for the Apache Beam SDK for Java is
**2.76.0** . See the [release
announcement](https://beam.apache.org/blog/beam-2.76.0/) for information about the changes included in the release.

To get the Apache Beam SDK for Java using Maven, use one of
the released artifacts from the
[Maven Central Repository](https://search.maven.org/search?q=apache-beam).

Add dependencies and dependency management tools to your
`pom.xml` file for the SDK artifact. For details, see
[Manage pipeline dependencies in Dataflow](https://docs.cloud.google.com/dataflow/docs/guides/manage-dependencies#java).

For more information about Apache Beam SDK for Java dependencies,
see
[Apache Beam SDK for Java dependencies](https://beam.apache.org/documentation/sdks/java-dependencies/)
and
[Managing Beam dependencies in Java](https://beam.apache.org/blog/managing-beam-dependencies-in-java/)
in the Apache Beam documentation.

### Python

The latest released version for the Apache Beam SDK for Python is
**2.76.0** . See the [release
announcement](https://beam.apache.org/blog/beam-2.76.0/) for information about the changes included in the release.

To obtain the Apache Beam SDK for Python, use one of the released
packages from the [Python Package Index](https://pypi.org/project/apache-beam/).

Install Python wheel by running the following command:

```
pip install wheel
```

Install the latest version of the Apache Beam SDK for Python by running the
following command from a virtual environment:

```
pip install 'apache-beam[gcp]'
```

Depending on the connection, the installation might take some time.

> [!CAUTION]
> As of October 7, 2020, Dataflow no longer supports Python 2 pipelines. For more information, see [Python 2 support on
> Google Cloud](https://docs.cloud.google.com/python/docs/python2-sunset#dataflow).

### Go

The latest released version for the Apache Beam SDK for Go is
**2.76.0** . See the [release
announcement](https://beam.apache.org/blog/beam-2.76.0/) for information about the changes included in the release.

To install the latest version of the Apache Beam SDK for Go, run the
the following command:

```
go get -u github.com/apache/beam/sdks/v2/go/pkg/beam
```

> [!NOTE]
> **Note:** Version numbers have the form *major.minor.patch* and are incremented as follows: *major* version for incompatible API changes, *minor* version for new functionality added in a backward-compatible manner, and *patch* version for forward-compatible bug fixes. APIs that are marked experimental can change at any point.

## Set up your development environment

For information about setting
up your Google Cloud project and development environment to use
Dataflow, follow one of the tutorials:

- [Create a Dataflow pipeline using Java](https://docs.cloud.google.com/dataflow/docs/guides/create-pipeline-java)
- [Create a Dataflow pipeline using Python](https://docs.cloud.google.com/dataflow/docs/guides/create-pipeline-python)
- [Create a Dataflow pipeline using Go](https://docs.cloud.google.com/dataflow/docs/guides/create-pipeline-go)

## Source code and examples

The Apache Beam source code is available in the
[Apache Beam repository](https://github.com/apache/beam)
on GitHub.

### Java

Code samples are available in the Apache Beam
[Examples directory](https://github.com/apache/beam/tree/master/examples/java/src/main/java/org/apache/beam/examples) on GitHub.

### Python

Code samples are available in the Apache Beam
[Examples directory](https://github.com/apache/beam/tree/master/sdks/python/apache_beam/examples) on GitHub.

### Go

Code samples are available in the Apache Beam
[Examples directory](https://github.com/apache/beam/tree/master/sdks/go/examples) on GitHub.

## Find the Dataflow SDK version

Installation details depend on your development environment. If you're using
Maven, you can have multiple versions of the Dataflow SDK
"installed," in one or more local Maven repositories.

### Java

To find out what version of the Dataflow SDK that a given pipeline is running, you can look at
the console output when running with `DataflowPipelineRunner` or
`BlockingDataflowPipelineRunner`. The console will contain a message like
the following, which contains the Dataflow SDK version information:

### Python

To find out what version of the Dataflow SDK that a given pipeline is running, you can look at
the console output when running with `DataflowRunner`. The console will contain a message like
the following, which contains the Dataflow SDK version information:

### Go

To find out what version of the Dataflow SDK that a given pipeline is running, you can look at
the console output when running with `DataflowRunner`. The console will contain a message like
the following, which contains the Dataflow SDK version information:

```
  INFO: Executing pipeline on the Dataflow Service, ...
  Dataflow SDK version: <version>
```

## Update the Apache Beam SDK

When you upgrade your pipeline to a later Apache Beam SDK version, update
your project dependency configurations and check for potential breaking changes
between versions.

### Check release notes and breaking changes

Before upgrading, check the
[Apache Beam release notes](https://beam.apache.org/get-started/downloads/#releases)
for changes, bug fixes, and potential breaking changes.

If you're upgrading across multiple minor versions, review the release notes for
all intermediate releases. For example, if you're upgrading from version
`2.50.0` to `2.60.0`, review the release notes for versions `2.51.0` through
`2.60.0`. Breaking changes, deprecations, and configuration updates are
cumulative across releases.

For known issues and connector-specific notices that affect
Dataflow, see the **Details** column in the
[SDK version support status](https://docs.cloud.google.com/dataflow/docs/support/sdk-version-support-status#apache-beam-sdks-2x) table.

### Update SDK dependencies

To upgrade the SDK version in your project, update your build configuration or
environment for the language your pipeline uses. Replace
`VERSION` with your target Apache Beam SDK version
(for example, `2.76.0`).

### Java

To upgrade the Apache Beam SDK for Java, update the SDK version in your
build configuration file, such as `pom.xml` for Maven or
`build.gradle` for Gradle.

#### Maven

In your `pom.xml` file, update the `beam.version`
property or update the `<version>` tag in your
Apache Beam dependencies:

```xml
<properties>
  <beam.version>VERSION</beam.version>
</properties>

<dependencies>
  <dependency>
    <groupId>org.apache.beam</groupId>
    <artifactId>beam-sdks-java-core</artifactId>
    <version>${beam.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.beam</groupId>
    <artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
    <version>${beam.version}</version>
  </dependency>
</dependencies>
```

#### Gradle

In your `build.gradle` file, update the Apache Beam
dependency declarations:

```groovy
dependencies {
  implementation 'org.apache.beam:beam-sdks-java-core:VERSION'
  implementation 'org.apache.beam:beam-runners-google-cloud-dataflow-java:VERSION'
}
```

For more information, see
[Manage Java pipeline dependencies](https://docs.cloud.google.com/dataflow/docs/guides/manage-dependencies#java).

### Python

To upgrade the Apache Beam SDK for Python in your local or virtual
environment, use `pip`:

```
pip install --upgrade 'apache-beam[gcp]==VERSION'
```

In your `requirements.txt` or `setup.py` file, update
the pinned version:

```text
apache-beam[gcp]==VERSION
```

> [!NOTE]
> **Note:** When upgrading the Python SDK, ensure that your target SDK version supports your Python runtime version and any custom container images that your pipeline uses. For more information, see [Manage Python pipeline dependencies](https://docs.cloud.google.com/dataflow/docs/guides/manage-dependencies#python).

### Go

To upgrade the Apache Beam SDK for Go, use `go get` to
retrieve the target version and update your `go.mod` file:

```
go get -u github.com/apache/beam/sdks/v2@vVERSION
go mod tidy
```

For more information, see
[Manage Go pipeline dependencies](https://docs.cloud.google.com/dataflow/docs/guides/manage-dependencies#go).

### Deploy upgraded pipelines

After you update the SDK version in your code, choose a deployment strategy
based on your pipeline type:

- **Streaming pipelines** : For streaming pipelines, you can deploy upgraded code by using in-place job replacement, running parallel pipelines, or stopping and restarting the job. For detailed instructions, compatibility rules, and deployment strategies, see [Update an existing pipeline](https://docs.cloud.google.com/dataflow/docs/guides/updating-a-pipeline) and [Upgrade a streaming pipeline](https://docs.cloud.google.com/dataflow/docs/guides/upgrade-guide).
- **Batch pipelines** : Batch pipelines don't support in-flight updates or in-place replacement jobs. Let the existing job run to completion, or [cancel the running job](https://docs.cloud.google.com/dataflow/docs/guides/stopping-a-pipeline#cancel), and then launch a new job with the upgraded SDK version.

### Best practices for CI/CD and updating deployments

To minimize operational risk when rolling out SDK upgrades across automated
build and deployment pipelines, follow these best practices:

- **Pin dependencies** : Always pin exact SDK versions such as `apache-beam[gcp]==VERSION` in Python, or exact version strings in Maven and Gradle. Avoid dynamic ranges (such as `>=` or `latest`) to prevent untested minor upgrades from occurring during automated CI/CD builds.
- **Validate in staging environments**: Deploy and test your upgraded pipeline in a dedicated staging or pre-production environment before promoting the changes to production. Validate pipeline throughput, metric stability, and downstream outputs.
- **Use a test or parallel pipelines**: For mission-critical streaming applications, run the upgraded pipeline in parallel with the existing pipeline. Verify data parity and output correctness between both jobs before you drain the older pipeline.

## What's next

- Dataflow integrates with the Google Cloud CLI. For instructions about installing the Dataflow command-line interface, see [Using the Dataflow command-line interface](https://docs.cloud.google.com/dataflow/pipelines/dataflow-command-line-intf).
- To learn which Apache Beam capabilities Dataflow supports, review the [Apache Beam capability matrix](https://beam.apache.org/documentation/runners/capability-matrix/).
- Review the [SDK version support
  status](https://docs.cloud.google.com/dataflow/docs/support/sdk-version-support-status) to see supported, deprecated, and decommissioned SDK releases.