Skip to content
cccskills
FreePublished on GitHub

airflow-java-sdk

Helps contributors develop and fix Airflow’s Java SDK for JVM tasks. Explains public API boundaries, JAR packaging, Python coordination, communication schema updates, and the test commands used to validate changes.

OriginalShow the original description

Guide for contributing to the Airflow Java SDK (AIP-108). Use this skill whenever a contributor is working in the `java-sdk/` directory or on the Java coordinator in `task-sdk/src/airflow/sdk/coordinators/java/` — whether they want to add a feature, write tests, fix a bug, understand the architecture, or prepare a PR. Trigger on phrases like "Java SDK", "JavaCoordinator", "java-sdk", "annotation processor", "Airflow.Task", "BundleBuilder", or anything about running JVM tasks in Airflow.

See how to install

Good for

  • Adding features or fixing bugs in the Java SDK
  • Reviewing public API and internal implementation boundaries
  • Investigating JAR discovery and JVM startup failures
  • Updating communication schema models and running tests

Files included (1)

  • SKILL.md6.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

<!-- SPDX-License-Identifier: Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0 -->

Airflow Java SDK contributor guide

The Java SDK lets Airflow tasks execute JVM code (Java, Kotlin, or any JVM language). You are helping a contributor work in one or both of these locations:

  • java-sdk/ — the JVM-side library (Kotlin source, published to Maven)
  • task-sdk/src/airflow/sdk/coordinators/java/ — the Python coordinator that launches the JVM subprocess

Read these two documents early in every session — they contain the authoritative reference material:

  • airflow-core/docs/authoring-and-scheduling/language-sdks/java.rst — user-facing guide: annotation vs. interface API, XCom type mapping, Gradle/Maven steps, coordinator config.
  • java-sdk/README.md — contributor guide: repository layout, detailed execution walkthrough, Gradle + Breeze test commands, coding conventions, common tasks, and PR checklist.

SDK package architecture

The JVM-side library is split into two packages with distinct visibility rules:

  • org.apache.airflow.sdk — public, user-facing API. Classes here (e.g. Client, Bundle, BundleBuilder, Server) are stable contracts that DAG authors and task implementers import directly. Changes to this package are breaking changes.
  • org.apache.airflow.sdk.execution — internal implementation detail. Everything in this package (CoordinatorComm, LogSender, Log, Client in execution/, generated schema models, etc.) is not intended to be imported by users. It may change between releases without notice.

When reviewing or writing code, enforce this boundary: user task code and BundleBuilder subclasses must only import from org.apache.airflow.sdk; any import of org.apache.airflow.sdk.execution.* in user-facing API surface is a red flag.


Bundle composition and coordinator discovery

A bundle is a directory of JAR files (typically build/bundle/) placed in the Dag bundle named by the coordinator's task_handler_bundle_name (the task's own Dag bundle when unset). The coordinator scans that Dag bundle at task-dispatch time to find:

  1. Main-Class (standard JAR manifest attribute) — the fully-qualified class name of the entry point that the coordinator invokes with java -classpath … <Main-Class> --comm … --logs …. This must be a class with a public static void main(String[] args) method; the Gradle plugin org.apache.airflow.sdk writes it automatically from airflowBundle { mainClass = "…" } and validates that the class exists and has the right signature at build time.

  2. Airflow-Supervisor-Schema-Version (Airflow-specific manifest attribute) — the wire protocol version the JVM side expects when talking to the Python supervisor. In fat-JAR mode (the default), the Gradle plugin reads this value from the airflow-sdk JAR in runtimeClasspath and copies it into the shadow JAR manifest. In thin-JAR mode (fatJar = false), the value stays in the airflow-sdk JAR deployed alongside the bundle JAR.

The Python coordinator (JavaCoordinator) scans every JAR in that Dag bundle with _JarInfo.find(), reads META-INF/MANIFEST.MF out of each ZIP, and collects Main-Class and Airflow-Supervisor-Schema-Version from whichever JARs carry them. The resolved schema version is then passed as the schema_version return value from _build_execute_task_command, which the base SubprocessCoordinator uses to negotiate the supervisor wire protocol.

If main_class is set explicitly on the JavaCoordinator instance (via [sdk] coordinators kwargs), the scan uses it as a filter; otherwise the first JAR with a Main-Class attribute wins. Either way, Airflow-Supervisor-Schema-Version must be present in at least one JAR in the Dag bundle or startup fails. Every JAR in the Dag bundle goes on one classpath.


Key files to know

FilePurpose
java-sdk/sdk/.../Client.ktPublic API (Variables, Connections, XCom)
java-sdk/sdk/.../execution/Client.ktSupervisor wire calls
java-sdk/sdk/.../execution/Comm.kt4-byte-prefix MessagePack framing
java-sdk/sdk/.../Server.ktEntry-point; drives the execution loop
java-sdk/processor/.../AirflowProcessor.ktKapt annotation processor
java-sdk/plugin/.../AirflowSdkPlugin.ktGradle bundle plugin
task-sdk/.../coordinators/java/coordinator.pyPython side — spawns the JVM
task-sdk/.../schema/schema.jsonWire protocol definition (both sides)

Running tests

Always use ./gradlew from inside java-sdk/; never run Gradle via apt's gradle. See java-sdk/README.md#testing for the full list of Gradle commands.

For the Python coordinator, use Breeze (never pytest directly on the host):

breeze testing task-sdk-tests -- task_sdk/coordinators/java

End-to-end test suite:

E2E_TEST_MODE=java_sdk uv run --project airflow-e2e-tests pytest \
    tests/airflow_e2e_tests/java_sdk_tests/ -xvs

Updating the Python coordinator

coordinator.py extends SubprocessCoordinator. The only method subclasses must implement is _build_execute_task_command, which returns (argv, schema_version). Look at the existing implementation for how the scanned Dag bundle, java_executable, jvm_args, and main_class are assembled into the command. Do not reach into the JVM process from Python beyond what this method provides.


Upgrading Supervisor Schema client

When upgrading to a newer Supervisor Schema version:

  • Regenerate models with ./gradlew generateJsonSchema2Pojo
  • Modify execution/Client.kt to handle changes

The java-sdk/README.md#contributing section walks through the full "adding a new Client method" sequence step by step.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

aip-tracker

FreeSummary

Assess Airflow Improvement Proposals by comparing Confluence specifications with pull requests, commits, and codebase files. Produce evidence-backed progress reports showing delivered items, remaining work, and specification updates needed across one or more proposals.

  • Check implementation progress for an Airflow proposal
  • Compare specification deliverables with shipped code
  • Compile a progress report across multiple proposals
apache/airflow47.2KUpdated Oct 18, 2026

aip-user-stories

FreeSummary

Turn Airflow Improvement Proposals into practical guides checked against current code, or proposed user stories for design review before implementation. Organize use cases, distinguish verified examples from speculative code, and capture specific design questions.

  • Create implementation-backed guides for an Airflow proposal
  • Explore user stories before a feature is implemented
  • Separate implemented features from proposed functionality
apache/airflow47.2KUpdated Oct 18, 2026

airflow-new-sdk

FreeSummary

Guides contributors through adding a new programming language to Airflow, covering SDK structure, runtime coordination, communication rules, executable packaging, tests, and the documentation and configuration changes needed for a pull request.

  • Adding support for a new programming language
  • Choosing how Airflow launches a language runtime
  • Implementing communication and executable bundles
apache/airflow47.2KUpdated Oct 18, 2026

Draft commit messages, pull request titles and descriptions, and GitHub comments or reviews for Apache Airflow contributions. Follows project wording and AI attribution rules, and helps decide whether a change needs a release note.

  • Draft commit messages and pull request titles
  • Prepare pull request descriptions using the project template
  • Draft GitHub comments and review text
apache/airflow47.2KUpdated Oct 18, 2026

Guides preparation and authorized publication of Apache Airflow changes, including existing pull request checks, remote verification, reviews, tests, rebasing, and a prefilled submission page. Also explains how to track work deferred by temporary fixes.

  • Planning the steps for submitting Airflow changes
  • Checking existing pull requests and Git remote destinations
  • Reviewing and testing changes before pushing
apache/airflow47.2KUpdated Oct 18, 2026

Helps add or update translations for the Apache Airflow interface. Covers language setup, translation file generation, consistent terminology, preserved variables and plural forms, and checks for missing, unfinished, or unused entries.

  • Adding a new interface language to Airflow
  • Filling gaps in an existing translation
  • Aligning terminology and preserving translation variables
apache/airflow47.2KUpdated Oct 18, 2026

See all skills by apache

Report a problem with this skill