[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-astronomer-authoring-java-sdk-tasks":3,"mdc--5kb22o-key":53,"related-repo-astronomer-authoring-java-sdk-tasks":2146,"related-org-astronomer-authoring-java-sdk-tasks":2248},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":48,"sourceUrl":51,"mdContent":52},"authoring-java-sdk-tasks","implement Airflow tasks in Java","Writes Airflow task logic in Java, Kotlin, or any JVM language using the Airflow Java SDK. Use when the user wants to implement Airflow tasks in Java\u002FJVM, asks about `@Builder.Dag`\u002F`@Builder.Task`\u002F`@Builder.XCom`, the `Task`\u002F`BundleBuilder` interfaces, reading connections\u002Fvariables\u002FXComs from Java, the JSON-to-Java type mapping, or logging from Java tasks. This skill covers the Java-specific native API; the shared Python-stub pattern and conceptual model live in authoring-language-sdk-tasks. For building\u002Fshipping the bundle see deploying-java-sdk-bundles; for coordinator config see configuring-airflow-language-sdks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"astronomer","Astronomer","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fastronomer.png",[12,16,19],{"name":13,"slug":14,"type":15},"Java","java","tag",{"name":17,"slug":18,"type":15},"Data Pipeline","data-pipeline",{"name":20,"slug":21,"type":15},"Engineering","engineering",412,"https:\u002F\u002Fgithub.com\u002Fastronomer\u002Fagents","2026-07-18T05:48:13.374003",null,55,[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"agentic-workflow","agents","ai","ai-agents","airflow","apache-airflow","claude","cursor","dag","data-engineering","data-pipelines","dbt","llm","mcp","orchestrator","skills","workflow-automation","workflow-management","workflow-orchestration","workflows",{"repoUrl":23,"stars":22,"forks":26,"topics":49,"description":50},[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"AI agent tooling for data engineering workflows.","https:\u002F\u002Fgithub.com\u002Fastronomer\u002Fagents\u002Ftree\u002FHEAD\u002Fskills\u002Fauthoring-java-sdk-tasks","---\nname: authoring-java-sdk-tasks\ndescription: Writes Airflow task logic in Java, Kotlin, or any JVM language using the Airflow Java SDK. Use when the user wants to implement Airflow tasks in Java\u002FJVM, asks about `@Builder.Dag`\u002F`@Builder.Task`\u002F`@Builder.XCom`, the `Task`\u002F`BundleBuilder` interfaces, reading connections\u002Fvariables\u002FXComs from Java, the JSON-to-Java type mapping, or logging from Java tasks. This skill covers the Java-specific native API; the shared Python-stub pattern and conceptual model live in authoring-language-sdk-tasks. For building\u002Fshipping the bundle see deploying-java-sdk-bundles; for coordinator config see configuring-airflow-language-sdks.\n---\n\n# Authoring Java SDK Tasks\n\nThe Airflow Java SDK implements the language-SDK model for the JVM: your DAG stays in Python, and each task instance runs in a short-lived JVM subprocess. This skill covers the **Java-specific** native API. The shared model — the Python `@task.stub` pattern, ID matching, and the XCom-as-JSON contract — lives in **authoring-language-sdk-tasks**; read that first if you're new to language SDKs.\n\n> **Experimental.** The Java SDK is in preview. Artifact coordinates and APIs may change.\n\n> **Related skills:** **authoring-language-sdk-tasks** (shared Python stub + concepts), **configuring-airflow-language-sdks** (route the queue to `JavaCoordinator`), **deploying-java-sdk-bundles** (compile and ship the JAR).\n\n---\n\n## Recap: the Python side\n\nJava tasks are paired with Python stubs that carry no logic — they declare the task, queue, dependency graph, and retries. IDs must match the Java annotations exactly, and an upstream argument on a stub only declares the dependency (the value is fetched in Java). Full rules are in **authoring-language-sdk-tasks**; the minimal shape:\n\n```python\nfrom airflow.sdk import dag, task\n\n\n@dag\ndef sales_pipeline():                     # dag_id \"sales_pipeline\" -> @Builder.Dag(id=\"sales_pipeline\")\n    @task.stub(queue=\"java\")\n    def extract(): ...                    # task_id \"extract\" -> @Builder.Task(id=\"extract\")\n\n    @task.stub(queue=\"java\")\n    def transform(extracted): ...\n\n    transform(extract())\n\n\nsales_pipeline()\n```\n\n---\n\n## Java side: two APIs\n\nBoth APIs produce identical runtime behavior; pick by style, and you can mix them in one bundle.\n\n### Annotation-based API (recommended)\n\nAnnotate a plain class; an annotation processor generates the wiring (`\u003CClassName>Builder`) at compile time.\n\n```java\nimport static java.lang.System.Logger.Level.INFO;\nimport org.apache.airflow.sdk.*;\n\n@Builder.Dag(id = \"sales_pipeline\")          \u002F\u002F must match the Python dag_id\npublic class SalesPipeline {\n  private static final System.Logger log = System.getLogger(SalesPipeline.class.getName());\n\n  @Builder.Task(id = \"extract\")              \u002F\u002F must match the Python @task.stub name\n  public long extract(Client client) {\n    var conn = client.getConnection(\"sales_db\");\n    log.log(INFO, \"connected to {0}\", conn.host);\n    return 42L;                              \u002F\u002F return value is pushed as the return_value XCom\n  }\n\n  @Builder.Task(id = \"transform\")\n  public long transform(\n      Client client,\n      @Builder.XCom(task = \"extract\") long recordCount) {  \u002F\u002F pulls extract's return_value\n    var threshold = (String) client.getVariable(\"transform_threshold\");\n    return recordCount * 2;\n  }\n\n  @Builder.Task   \u002F\u002F id omitted -> the method name \"load\" is used\n  public void load(Context context, @Builder.XCom(task = \"transform\") long transformed) {\n    log.log(INFO, \"attempt {0}, value {1}\", context.ti.tryNumber, transformed);\n  }\n}\n```\n\nAnnotation reference:\n\n| Annotation | Purpose |\n|------------|---------|\n| `@Builder.Dag(id = \"...\")` | Marks the class as a task container. `id` must match the Python `dag_id`; if omitted, the class name is used. Optional `to = \"...\"` renames the generated builder (default `\u003CClassName>Builder`). |\n| `@Builder.Task(id = \"...\")` | Marks a method as a task. `id` must match the Python `@task.stub` function name; if omitted, the method name is used. |\n| `@Builder.XCom(task = \"...\", key = \"...\")` | Injects an upstream task's XCom as a parameter. `task` defaults to the parameter name; `key` defaults to the producing task's `return_value`. The parameter type must be compatible with the stored JSON value. |\n\nA task method's return value is automatically pushed as that task's `return_value` XCom. A method may declare `throws Exception`; any uncaught exception fails the task instance (which triggers retries if the stub configured them).\n\n### Interface-based API\n\nImplement `Task` directly when you want full control over registration and XCom handling.\n\n```java\nimport org.apache.airflow.sdk.*;\n\npublic class ExtractTask implements Task {\n  @Override\n  public void execute(Context context, Client client) throws Exception {\n    var conn = client.getConnection(\"sales_db\");\n    \u002F\u002F ... do work ...\n    client.setXCom(42L);   \u002F\u002F push return_value explicitly\n  }\n}\n```\n\nRegister tasks manually in a `Dag` and expose it through a `BundleBuilder`:\n\n```java\npublic class MyBundle implements BundleBuilder {\n  @Override\n  public Iterable\u003CDag> getDags() {\n    var dag = new Dag(\"sales_pipeline\");      \u002F\u002F DAG ID matches Python\n    dag.addTask(\"extract\", ExtractTask.class);\n    dag.addTask(\"transform\", TransformTask.class);\n    return java.util.List.of(dag);\n  }\n}\n```\n\nEach `Task` class needs a public no-arg constructor. Task IDs must be unique within a DAG, and DAG IDs unique within a bundle.\n\n---\n\n## The entry point\n\nEvery bundle has a `main` that hands your DAGs to the SDK server. The server connects to the coordinator, runs one task instance, and exits.\n\n```java\nimport java.util.List;\nimport org.apache.airflow.sdk.*;\n\npublic class Main implements BundleBuilder {\n  @Override\n  public Iterable\u003CDag> getDags() {\n    \u002F\u002F With the annotation API, the *Builder classes are generated at compile time.\n    return List.of(SalesPipelineBuilder.build());\n  }\n\n  public static void main(String[] args) {\n    Server.create(args).serve(new Main().build());\n  }\n}\n```\n\n`Server.create(args)` parses the connection details Airflow passes on the command line — don't construct them by hand. Record this `main` class as the bundle's main class when you build it (see **deploying-java-sdk-bundles**).\n\n---\n\n## Talking to Airflow from a task: `Client`\n\nA `Client` is passed into every task and is scoped to the current DAG run and task instance.\n\n| Call | Returns | Notes |\n|------|---------|-------|\n| `client.getConnection(id)` | `Connection` | Fields: `id`, `type`, `host`, `schema`, `login`, `password`, `port`, `extra`. Any unset field is `null`. Throws if the connection doesn't exist. |\n| `client.getVariable(key)` | `Object` (or `null`) | Cast to the type you expect, e.g. `(String) client.getVariable(\"threshold\")`. |\n| `client.getXCom(taskId)` | `Object` (or `null`) | Reads another task's `return_value` by default. Overloads accept `key`, `dagId`, `runId`, `mapIndex`, and `includePriorDates` for cross-DAG\u002Frun reads and mapped tasks. |\n| `client.setXCom(value)` | — | Pushes the `return_value` XCom (interface API). Value must be JSON-serializable. With the annotation API, returning a value does this for you. |\n\n### `Context`\n\nThe `Context` parameter exposes run metadata: `context.dagRun` (`dagId`, `runId`) and `context.ti` (`dagId`, `runId`, `taskId`, `mapIndex`, `tryNumber`). `tryNumber` is useful for retry-aware logic.\n\n---\n\n## XCom: Java types\n\nXComs cross the boundary as JSON (the shared contract is in **authoring-language-sdk-tasks**). When you read one back in Java you get:\n\n| Python type | JSON | Java type from `getXCom` |\n|-------------|------|--------------------------|\n| `int` | integer | `Long` (or `BigInteger` if too large) |\n| `float` | decimal | `Double` |\n| `str` | string | `String` |\n| `bool` | boolean | `Boolean` |\n| `None` | null | `null` |\n| `list` | array | `List\u003CObject>` |\n| `dict` | object | `Map\u003CString, Object>` |\n\nDeclare `@Builder.XCom` parameter types to match. A mismatch (e.g. declaring `int` when the value is a `String`) fails the task.\n\n---\n\n## Logging\n\nDeclare a logger as a static field named after the class — the conventional pattern regardless of framework:\n\n```java\nprivate static final System.Logger log = System.getLogger(SalesPipeline.class.getName());\n```\n\nFor records to reach Airflow's task log store (and show in the UI), the bundle must include one of the SDK logging integration artifacts (`airflow-sdk-jpl`, `airflow-sdk-slf4j`, `airflow-sdk-log4j2`, or `airflow-sdk-jul`). The dependencies and per-framework setup are in the logging integration section of **deploying-java-sdk-bundles**. `System.Logger` (JPL) with `airflow-sdk-jpl` is the lightest option and needs no configuration.\n\n---\n\n## A complete worked example ships with the SDK\n\nThe SDK repository includes a runnable example under `java-sdk\u002Fexample\u002F`:\n\n- `src\u002Fresources\u002Fdags\u002Fjava_examples.py` — Python DAGs pairing Python tasks with Java stubs, including a `load` stub with `retries=1`.\n- `src\u002Fjava\u002F...\u002FAnnotationExample.java` — annotation API, including a task that fails on `tryNumber == 1` and succeeds on retry.\n- `src\u002Fjava\u002F...\u002FInterfaceExampleBuilder.java` — the same tasks via the `Task` interface and `Dag.addTask(...)`.\n- `src\u002Fjava\u002F...\u002FExampleBundleBuilder.java` — a `BundleBuilder` returning both DAGs plus the `main` entry point.\n\nPoint users there for an end-to-end reference.\n\n---\n\n## Java-specific pitfalls\n\n- **Cast `Object` returns deliberately.** `getVariable` and `getXCom` return `Object`; match the cast to the JSON type (see the table above).\n- **`@Builder.XCom` parameter types must match the stored JSON type**, or the task fails at runtime.\n- **The annotation processor must be on the build** for the annotation API (generates `\u003CClassName>Builder`); it is not needed for the interface API. See **deploying-java-sdk-bundles**.\n- See **authoring-language-sdk-tasks** for the language-agnostic pitfalls (ID matching, one JVM per task instance, queue\u002Fretries on the stub).\n\n---\n\n## Related Skills\n\n- **authoring-language-sdk-tasks**: Shared Python-stub pattern and concepts (read first).\n- **configuring-airflow-language-sdks**: Route the `java` queue to `JavaCoordinator` and set JRE\u002Fcoordinator options.\n- **deploying-java-sdk-bundles**: Build the bundle (Gradle\u002FMaven) and place the JAR where Airflow can find it.\n- **authoring-dags**: General Airflow DAG authoring.\n",{"data":54,"body":55},{"name":4,"description":6},{"type":56,"children":57},"root",[58,66,96,110,151,155,162,173,316,319,325,330,337,350,580,585,732,752,758,771,853,874,950,962,965,971,984,1095,1118,1121,1133,1145,1410,1420,1500,1503,1509,1520,1742,1769,1772,1778,1783,1797,1853,1856,1862,1874,1974,1979,1982,1988,2077,2080,2086,2140],{"type":59,"tag":60,"props":61,"children":62},"element","h1",{"id":4},[63],{"type":64,"value":65},"text","Authoring Java SDK Tasks",{"type":59,"tag":67,"props":68,"children":69},"p",{},[70,72,78,80,87,89,94],{"type":64,"value":71},"The Airflow Java SDK implements the language-SDK model for the JVM: your DAG stays in Python, and each task instance runs in a short-lived JVM subprocess. This skill covers the ",{"type":59,"tag":73,"props":74,"children":75},"strong",{},[76],{"type":64,"value":77},"Java-specific",{"type":64,"value":79}," native API. The shared model — the Python ",{"type":59,"tag":81,"props":82,"children":84},"code",{"className":83},[],[85],{"type":64,"value":86},"@task.stub",{"type":64,"value":88}," pattern, ID matching, and the XCom-as-JSON contract — lives in ",{"type":59,"tag":73,"props":90,"children":91},{},[92],{"type":64,"value":93},"authoring-language-sdk-tasks",{"type":64,"value":95},"; read that first if you're new to language SDKs.",{"type":59,"tag":97,"props":98,"children":99},"blockquote",{},[100],{"type":59,"tag":67,"props":101,"children":102},{},[103,108],{"type":59,"tag":73,"props":104,"children":105},{},[106],{"type":64,"value":107},"Experimental.",{"type":64,"value":109}," The Java SDK is in preview. Artifact coordinates and APIs may change.",{"type":59,"tag":97,"props":111,"children":112},{},[113],{"type":59,"tag":67,"props":114,"children":115},{},[116,121,123,127,129,134,136,142,144,149],{"type":59,"tag":73,"props":117,"children":118},{},[119],{"type":64,"value":120},"Related skills:",{"type":64,"value":122}," ",{"type":59,"tag":73,"props":124,"children":125},{},[126],{"type":64,"value":93},{"type":64,"value":128}," (shared Python stub + concepts), ",{"type":59,"tag":73,"props":130,"children":131},{},[132],{"type":64,"value":133},"configuring-airflow-language-sdks",{"type":64,"value":135}," (route the queue to ",{"type":59,"tag":81,"props":137,"children":139},{"className":138},[],[140],{"type":64,"value":141},"JavaCoordinator",{"type":64,"value":143},"), ",{"type":59,"tag":73,"props":145,"children":146},{},[147],{"type":64,"value":148},"deploying-java-sdk-bundles",{"type":64,"value":150}," (compile and ship the JAR).",{"type":59,"tag":152,"props":153,"children":154},"hr",{},[],{"type":59,"tag":156,"props":157,"children":159},"h2",{"id":158},"recap-the-python-side",[160],{"type":64,"value":161},"Recap: the Python side",{"type":59,"tag":67,"props":163,"children":164},{},[165,167,171],{"type":64,"value":166},"Java tasks are paired with Python stubs that carry no logic — they declare the task, queue, dependency graph, and retries. IDs must match the Java annotations exactly, and an upstream argument on a stub only declares the dependency (the value is fetched in Java). Full rules are in ",{"type":59,"tag":73,"props":168,"children":169},{},[170],{"type":64,"value":93},{"type":64,"value":172},"; the minimal shape:",{"type":59,"tag":174,"props":175,"children":180},"pre",{"className":176,"code":177,"language":178,"meta":179,"style":179},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from airflow.sdk import dag, task\n\n\n@dag\ndef sales_pipeline():                     # dag_id \"sales_pipeline\" -> @Builder.Dag(id=\"sales_pipeline\")\n    @task.stub(queue=\"java\")\n    def extract(): ...                    # task_id \"extract\" -> @Builder.Task(id=\"extract\")\n\n    @task.stub(queue=\"java\")\n    def transform(extracted): ...\n\n    transform(extract())\n\n\nsales_pipeline()\n","python","",[181],{"type":59,"tag":81,"props":182,"children":183},{"__ignoreMap":179},[184,195,205,213,222,231,240,249,257,265,274,282,291,299,307],{"type":59,"tag":185,"props":186,"children":189},"span",{"class":187,"line":188},"line",1,[190],{"type":59,"tag":185,"props":191,"children":192},{},[193],{"type":64,"value":194},"from airflow.sdk import dag, task\n",{"type":59,"tag":185,"props":196,"children":198},{"class":187,"line":197},2,[199],{"type":59,"tag":185,"props":200,"children":202},{"emptyLinePlaceholder":201},true,[203],{"type":64,"value":204},"\n",{"type":59,"tag":185,"props":206,"children":208},{"class":187,"line":207},3,[209],{"type":59,"tag":185,"props":210,"children":211},{"emptyLinePlaceholder":201},[212],{"type":64,"value":204},{"type":59,"tag":185,"props":214,"children":216},{"class":187,"line":215},4,[217],{"type":59,"tag":185,"props":218,"children":219},{},[220],{"type":64,"value":221},"@dag\n",{"type":59,"tag":185,"props":223,"children":225},{"class":187,"line":224},5,[226],{"type":59,"tag":185,"props":227,"children":228},{},[229],{"type":64,"value":230},"def sales_pipeline():                     # dag_id \"sales_pipeline\" -> @Builder.Dag(id=\"sales_pipeline\")\n",{"type":59,"tag":185,"props":232,"children":234},{"class":187,"line":233},6,[235],{"type":59,"tag":185,"props":236,"children":237},{},[238],{"type":64,"value":239},"    @task.stub(queue=\"java\")\n",{"type":59,"tag":185,"props":241,"children":243},{"class":187,"line":242},7,[244],{"type":59,"tag":185,"props":245,"children":246},{},[247],{"type":64,"value":248},"    def extract(): ...                    # task_id \"extract\" -> @Builder.Task(id=\"extract\")\n",{"type":59,"tag":185,"props":250,"children":252},{"class":187,"line":251},8,[253],{"type":59,"tag":185,"props":254,"children":255},{"emptyLinePlaceholder":201},[256],{"type":64,"value":204},{"type":59,"tag":185,"props":258,"children":260},{"class":187,"line":259},9,[261],{"type":59,"tag":185,"props":262,"children":263},{},[264],{"type":64,"value":239},{"type":59,"tag":185,"props":266,"children":268},{"class":187,"line":267},10,[269],{"type":59,"tag":185,"props":270,"children":271},{},[272],{"type":64,"value":273},"    def transform(extracted): ...\n",{"type":59,"tag":185,"props":275,"children":277},{"class":187,"line":276},11,[278],{"type":59,"tag":185,"props":279,"children":280},{"emptyLinePlaceholder":201},[281],{"type":64,"value":204},{"type":59,"tag":185,"props":283,"children":285},{"class":187,"line":284},12,[286],{"type":59,"tag":185,"props":287,"children":288},{},[289],{"type":64,"value":290},"    transform(extract())\n",{"type":59,"tag":185,"props":292,"children":294},{"class":187,"line":293},13,[295],{"type":59,"tag":185,"props":296,"children":297},{"emptyLinePlaceholder":201},[298],{"type":64,"value":204},{"type":59,"tag":185,"props":300,"children":302},{"class":187,"line":301},14,[303],{"type":59,"tag":185,"props":304,"children":305},{"emptyLinePlaceholder":201},[306],{"type":64,"value":204},{"type":59,"tag":185,"props":308,"children":310},{"class":187,"line":309},15,[311],{"type":59,"tag":185,"props":312,"children":313},{},[314],{"type":64,"value":315},"sales_pipeline()\n",{"type":59,"tag":152,"props":317,"children":318},{},[],{"type":59,"tag":156,"props":320,"children":322},{"id":321},"java-side-two-apis",[323],{"type":64,"value":324},"Java side: two APIs",{"type":59,"tag":67,"props":326,"children":327},{},[328],{"type":64,"value":329},"Both APIs produce identical runtime behavior; pick by style, and you can mix them in one bundle.",{"type":59,"tag":331,"props":332,"children":334},"h3",{"id":333},"annotation-based-api-recommended",[335],{"type":64,"value":336},"Annotation-based API (recommended)",{"type":59,"tag":67,"props":338,"children":339},{},[340,342,348],{"type":64,"value":341},"Annotate a plain class; an annotation processor generates the wiring (",{"type":59,"tag":81,"props":343,"children":345},{"className":344},[],[346],{"type":64,"value":347},"\u003CClassName>Builder",{"type":64,"value":349},") at compile time.",{"type":59,"tag":174,"props":351,"children":354},{"className":352,"code":353,"language":14,"meta":179,"style":179},"language-java shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import static java.lang.System.Logger.Level.INFO;\nimport org.apache.airflow.sdk.*;\n\n@Builder.Dag(id = \"sales_pipeline\")          \u002F\u002F must match the Python dag_id\npublic class SalesPipeline {\n  private static final System.Logger log = System.getLogger(SalesPipeline.class.getName());\n\n  @Builder.Task(id = \"extract\")              \u002F\u002F must match the Python @task.stub name\n  public long extract(Client client) {\n    var conn = client.getConnection(\"sales_db\");\n    log.log(INFO, \"connected to {0}\", conn.host);\n    return 42L;                              \u002F\u002F return value is pushed as the return_value XCom\n  }\n\n  @Builder.Task(id = \"transform\")\n  public long transform(\n      Client client,\n      @Builder.XCom(task = \"extract\") long recordCount) {  \u002F\u002F pulls extract's return_value\n    var threshold = (String) client.getVariable(\"transform_threshold\");\n    return recordCount * 2;\n  }\n\n  @Builder.Task   \u002F\u002F id omitted -> the method name \"load\" is used\n  public void load(Context context, @Builder.XCom(task = \"transform\") long transformed) {\n    log.log(INFO, \"attempt {0}, value {1}\", context.ti.tryNumber, transformed);\n  }\n}\n",[355],{"type":59,"tag":81,"props":356,"children":357},{"__ignoreMap":179},[358,366,374,381,389,397,405,412,420,428,436,444,452,460,467,475,484,493,502,511,520,528,536,545,554,563,571],{"type":59,"tag":185,"props":359,"children":360},{"class":187,"line":188},[361],{"type":59,"tag":185,"props":362,"children":363},{},[364],{"type":64,"value":365},"import static java.lang.System.Logger.Level.INFO;\n",{"type":59,"tag":185,"props":367,"children":368},{"class":187,"line":197},[369],{"type":59,"tag":185,"props":370,"children":371},{},[372],{"type":64,"value":373},"import org.apache.airflow.sdk.*;\n",{"type":59,"tag":185,"props":375,"children":376},{"class":187,"line":207},[377],{"type":59,"tag":185,"props":378,"children":379},{"emptyLinePlaceholder":201},[380],{"type":64,"value":204},{"type":59,"tag":185,"props":382,"children":383},{"class":187,"line":215},[384],{"type":59,"tag":185,"props":385,"children":386},{},[387],{"type":64,"value":388},"@Builder.Dag(id = \"sales_pipeline\")          \u002F\u002F must match the Python dag_id\n",{"type":59,"tag":185,"props":390,"children":391},{"class":187,"line":224},[392],{"type":59,"tag":185,"props":393,"children":394},{},[395],{"type":64,"value":396},"public class SalesPipeline {\n",{"type":59,"tag":185,"props":398,"children":399},{"class":187,"line":233},[400],{"type":59,"tag":185,"props":401,"children":402},{},[403],{"type":64,"value":404},"  private static final System.Logger log = System.getLogger(SalesPipeline.class.getName());\n",{"type":59,"tag":185,"props":406,"children":407},{"class":187,"line":242},[408],{"type":59,"tag":185,"props":409,"children":410},{"emptyLinePlaceholder":201},[411],{"type":64,"value":204},{"type":59,"tag":185,"props":413,"children":414},{"class":187,"line":251},[415],{"type":59,"tag":185,"props":416,"children":417},{},[418],{"type":64,"value":419},"  @Builder.Task(id = \"extract\")              \u002F\u002F must match the Python @task.stub name\n",{"type":59,"tag":185,"props":421,"children":422},{"class":187,"line":259},[423],{"type":59,"tag":185,"props":424,"children":425},{},[426],{"type":64,"value":427},"  public long extract(Client client) {\n",{"type":59,"tag":185,"props":429,"children":430},{"class":187,"line":267},[431],{"type":59,"tag":185,"props":432,"children":433},{},[434],{"type":64,"value":435},"    var conn = client.getConnection(\"sales_db\");\n",{"type":59,"tag":185,"props":437,"children":438},{"class":187,"line":276},[439],{"type":59,"tag":185,"props":440,"children":441},{},[442],{"type":64,"value":443},"    log.log(INFO, \"connected to {0}\", conn.host);\n",{"type":59,"tag":185,"props":445,"children":446},{"class":187,"line":284},[447],{"type":59,"tag":185,"props":448,"children":449},{},[450],{"type":64,"value":451},"    return 42L;                              \u002F\u002F return value is pushed as the return_value XCom\n",{"type":59,"tag":185,"props":453,"children":454},{"class":187,"line":293},[455],{"type":59,"tag":185,"props":456,"children":457},{},[458],{"type":64,"value":459},"  }\n",{"type":59,"tag":185,"props":461,"children":462},{"class":187,"line":301},[463],{"type":59,"tag":185,"props":464,"children":465},{"emptyLinePlaceholder":201},[466],{"type":64,"value":204},{"type":59,"tag":185,"props":468,"children":469},{"class":187,"line":309},[470],{"type":59,"tag":185,"props":471,"children":472},{},[473],{"type":64,"value":474},"  @Builder.Task(id = \"transform\")\n",{"type":59,"tag":185,"props":476,"children":478},{"class":187,"line":477},16,[479],{"type":59,"tag":185,"props":480,"children":481},{},[482],{"type":64,"value":483},"  public long transform(\n",{"type":59,"tag":185,"props":485,"children":487},{"class":187,"line":486},17,[488],{"type":59,"tag":185,"props":489,"children":490},{},[491],{"type":64,"value":492},"      Client client,\n",{"type":59,"tag":185,"props":494,"children":496},{"class":187,"line":495},18,[497],{"type":59,"tag":185,"props":498,"children":499},{},[500],{"type":64,"value":501},"      @Builder.XCom(task = \"extract\") long recordCount) {  \u002F\u002F pulls extract's return_value\n",{"type":59,"tag":185,"props":503,"children":505},{"class":187,"line":504},19,[506],{"type":59,"tag":185,"props":507,"children":508},{},[509],{"type":64,"value":510},"    var threshold = (String) client.getVariable(\"transform_threshold\");\n",{"type":59,"tag":185,"props":512,"children":514},{"class":187,"line":513},20,[515],{"type":59,"tag":185,"props":516,"children":517},{},[518],{"type":64,"value":519},"    return recordCount * 2;\n",{"type":59,"tag":185,"props":521,"children":523},{"class":187,"line":522},21,[524],{"type":59,"tag":185,"props":525,"children":526},{},[527],{"type":64,"value":459},{"type":59,"tag":185,"props":529,"children":531},{"class":187,"line":530},22,[532],{"type":59,"tag":185,"props":533,"children":534},{"emptyLinePlaceholder":201},[535],{"type":64,"value":204},{"type":59,"tag":185,"props":537,"children":539},{"class":187,"line":538},23,[540],{"type":59,"tag":185,"props":541,"children":542},{},[543],{"type":64,"value":544},"  @Builder.Task   \u002F\u002F id omitted -> the method name \"load\" is used\n",{"type":59,"tag":185,"props":546,"children":548},{"class":187,"line":547},24,[549],{"type":59,"tag":185,"props":550,"children":551},{},[552],{"type":64,"value":553},"  public void load(Context context, @Builder.XCom(task = \"transform\") long transformed) {\n",{"type":59,"tag":185,"props":555,"children":557},{"class":187,"line":556},25,[558],{"type":59,"tag":185,"props":559,"children":560},{},[561],{"type":64,"value":562},"    log.log(INFO, \"attempt {0}, value {1}\", context.ti.tryNumber, transformed);\n",{"type":59,"tag":185,"props":564,"children":566},{"class":187,"line":565},26,[567],{"type":59,"tag":185,"props":568,"children":569},{},[570],{"type":64,"value":459},{"type":59,"tag":185,"props":572,"children":574},{"class":187,"line":573},27,[575],{"type":59,"tag":185,"props":576,"children":577},{},[578],{"type":64,"value":579},"}\n",{"type":59,"tag":67,"props":581,"children":582},{},[583],{"type":64,"value":584},"Annotation reference:",{"type":59,"tag":586,"props":587,"children":588},"table",{},[589,608],{"type":59,"tag":590,"props":591,"children":592},"thead",{},[593],{"type":59,"tag":594,"props":595,"children":596},"tr",{},[597,603],{"type":59,"tag":598,"props":599,"children":600},"th",{},[601],{"type":64,"value":602},"Annotation",{"type":59,"tag":598,"props":604,"children":605},{},[606],{"type":64,"value":607},"Purpose",{"type":59,"tag":609,"props":610,"children":611},"tbody",{},[612,661,691],{"type":59,"tag":594,"props":613,"children":614},{},[615,625],{"type":59,"tag":616,"props":617,"children":618},"td",{},[619],{"type":59,"tag":81,"props":620,"children":622},{"className":621},[],[623],{"type":64,"value":624},"@Builder.Dag(id = \"...\")",{"type":59,"tag":616,"props":626,"children":627},{},[628,630,636,638,644,646,652,654,659],{"type":64,"value":629},"Marks the class as a task container. ",{"type":59,"tag":81,"props":631,"children":633},{"className":632},[],[634],{"type":64,"value":635},"id",{"type":64,"value":637}," must match the Python ",{"type":59,"tag":81,"props":639,"children":641},{"className":640},[],[642],{"type":64,"value":643},"dag_id",{"type":64,"value":645},"; if omitted, the class name is used. Optional ",{"type":59,"tag":81,"props":647,"children":649},{"className":648},[],[650],{"type":64,"value":651},"to = \"...\"",{"type":64,"value":653}," renames the generated builder (default ",{"type":59,"tag":81,"props":655,"children":657},{"className":656},[],[658],{"type":64,"value":347},{"type":64,"value":660},").",{"type":59,"tag":594,"props":662,"children":663},{},[664,673],{"type":59,"tag":616,"props":665,"children":666},{},[667],{"type":59,"tag":81,"props":668,"children":670},{"className":669},[],[671],{"type":64,"value":672},"@Builder.Task(id = \"...\")",{"type":59,"tag":616,"props":674,"children":675},{},[676,678,683,684,689],{"type":64,"value":677},"Marks a method as a task. ",{"type":59,"tag":81,"props":679,"children":681},{"className":680},[],[682],{"type":64,"value":635},{"type":64,"value":637},{"type":59,"tag":81,"props":685,"children":687},{"className":686},[],[688],{"type":64,"value":86},{"type":64,"value":690}," function name; if omitted, the method name is used.",{"type":59,"tag":594,"props":692,"children":693},{},[694,703],{"type":59,"tag":616,"props":695,"children":696},{},[697],{"type":59,"tag":81,"props":698,"children":700},{"className":699},[],[701],{"type":64,"value":702},"@Builder.XCom(task = \"...\", key = \"...\")",{"type":59,"tag":616,"props":704,"children":705},{},[706,708,714,716,722,724,730],{"type":64,"value":707},"Injects an upstream task's XCom as a parameter. ",{"type":59,"tag":81,"props":709,"children":711},{"className":710},[],[712],{"type":64,"value":713},"task",{"type":64,"value":715}," defaults to the parameter name; ",{"type":59,"tag":81,"props":717,"children":719},{"className":718},[],[720],{"type":64,"value":721},"key",{"type":64,"value":723}," defaults to the producing task's ",{"type":59,"tag":81,"props":725,"children":727},{"className":726},[],[728],{"type":64,"value":729},"return_value",{"type":64,"value":731},". The parameter type must be compatible with the stored JSON value.",{"type":59,"tag":67,"props":733,"children":734},{},[735,737,742,744,750],{"type":64,"value":736},"A task method's return value is automatically pushed as that task's ",{"type":59,"tag":81,"props":738,"children":740},{"className":739},[],[741],{"type":64,"value":729},{"type":64,"value":743}," XCom. A method may declare ",{"type":59,"tag":81,"props":745,"children":747},{"className":746},[],[748],{"type":64,"value":749},"throws Exception",{"type":64,"value":751},"; any uncaught exception fails the task instance (which triggers retries if the stub configured them).",{"type":59,"tag":331,"props":753,"children":755},{"id":754},"interface-based-api",[756],{"type":64,"value":757},"Interface-based API",{"type":59,"tag":67,"props":759,"children":760},{},[761,763,769],{"type":64,"value":762},"Implement ",{"type":59,"tag":81,"props":764,"children":766},{"className":765},[],[767],{"type":64,"value":768},"Task",{"type":64,"value":770}," directly when you want full control over registration and XCom handling.",{"type":59,"tag":174,"props":772,"children":774},{"className":352,"code":773,"language":14,"meta":179,"style":179},"import org.apache.airflow.sdk.*;\n\npublic class ExtractTask implements Task {\n  @Override\n  public void execute(Context context, Client client) throws Exception {\n    var conn = client.getConnection(\"sales_db\");\n    \u002F\u002F ... do work ...\n    client.setXCom(42L);   \u002F\u002F push return_value explicitly\n  }\n}\n",[775],{"type":59,"tag":81,"props":776,"children":777},{"__ignoreMap":179},[778,785,792,800,808,816,823,831,839,846],{"type":59,"tag":185,"props":779,"children":780},{"class":187,"line":188},[781],{"type":59,"tag":185,"props":782,"children":783},{},[784],{"type":64,"value":373},{"type":59,"tag":185,"props":786,"children":787},{"class":187,"line":197},[788],{"type":59,"tag":185,"props":789,"children":790},{"emptyLinePlaceholder":201},[791],{"type":64,"value":204},{"type":59,"tag":185,"props":793,"children":794},{"class":187,"line":207},[795],{"type":59,"tag":185,"props":796,"children":797},{},[798],{"type":64,"value":799},"public class ExtractTask implements Task {\n",{"type":59,"tag":185,"props":801,"children":802},{"class":187,"line":215},[803],{"type":59,"tag":185,"props":804,"children":805},{},[806],{"type":64,"value":807},"  @Override\n",{"type":59,"tag":185,"props":809,"children":810},{"class":187,"line":224},[811],{"type":59,"tag":185,"props":812,"children":813},{},[814],{"type":64,"value":815},"  public void execute(Context context, Client client) throws Exception {\n",{"type":59,"tag":185,"props":817,"children":818},{"class":187,"line":233},[819],{"type":59,"tag":185,"props":820,"children":821},{},[822],{"type":64,"value":435},{"type":59,"tag":185,"props":824,"children":825},{"class":187,"line":242},[826],{"type":59,"tag":185,"props":827,"children":828},{},[829],{"type":64,"value":830},"    \u002F\u002F ... do work ...\n",{"type":59,"tag":185,"props":832,"children":833},{"class":187,"line":251},[834],{"type":59,"tag":185,"props":835,"children":836},{},[837],{"type":64,"value":838},"    client.setXCom(42L);   \u002F\u002F push return_value explicitly\n",{"type":59,"tag":185,"props":840,"children":841},{"class":187,"line":259},[842],{"type":59,"tag":185,"props":843,"children":844},{},[845],{"type":64,"value":459},{"type":59,"tag":185,"props":847,"children":848},{"class":187,"line":267},[849],{"type":59,"tag":185,"props":850,"children":851},{},[852],{"type":64,"value":579},{"type":59,"tag":67,"props":854,"children":855},{},[856,858,864,866,872],{"type":64,"value":857},"Register tasks manually in a ",{"type":59,"tag":81,"props":859,"children":861},{"className":860},[],[862],{"type":64,"value":863},"Dag",{"type":64,"value":865}," and expose it through a ",{"type":59,"tag":81,"props":867,"children":869},{"className":868},[],[870],{"type":64,"value":871},"BundleBuilder",{"type":64,"value":873},":",{"type":59,"tag":174,"props":875,"children":877},{"className":352,"code":876,"language":14,"meta":179,"style":179},"public class MyBundle implements BundleBuilder {\n  @Override\n  public Iterable\u003CDag> getDags() {\n    var dag = new Dag(\"sales_pipeline\");      \u002F\u002F DAG ID matches Python\n    dag.addTask(\"extract\", ExtractTask.class);\n    dag.addTask(\"transform\", TransformTask.class);\n    return java.util.List.of(dag);\n  }\n}\n",[878],{"type":59,"tag":81,"props":879,"children":880},{"__ignoreMap":179},[881,889,896,904,912,920,928,936,943],{"type":59,"tag":185,"props":882,"children":883},{"class":187,"line":188},[884],{"type":59,"tag":185,"props":885,"children":886},{},[887],{"type":64,"value":888},"public class MyBundle implements BundleBuilder {\n",{"type":59,"tag":185,"props":890,"children":891},{"class":187,"line":197},[892],{"type":59,"tag":185,"props":893,"children":894},{},[895],{"type":64,"value":807},{"type":59,"tag":185,"props":897,"children":898},{"class":187,"line":207},[899],{"type":59,"tag":185,"props":900,"children":901},{},[902],{"type":64,"value":903},"  public Iterable\u003CDag> getDags() {\n",{"type":59,"tag":185,"props":905,"children":906},{"class":187,"line":215},[907],{"type":59,"tag":185,"props":908,"children":909},{},[910],{"type":64,"value":911},"    var dag = new Dag(\"sales_pipeline\");      \u002F\u002F DAG ID matches Python\n",{"type":59,"tag":185,"props":913,"children":914},{"class":187,"line":224},[915],{"type":59,"tag":185,"props":916,"children":917},{},[918],{"type":64,"value":919},"    dag.addTask(\"extract\", ExtractTask.class);\n",{"type":59,"tag":185,"props":921,"children":922},{"class":187,"line":233},[923],{"type":59,"tag":185,"props":924,"children":925},{},[926],{"type":64,"value":927},"    dag.addTask(\"transform\", TransformTask.class);\n",{"type":59,"tag":185,"props":929,"children":930},{"class":187,"line":242},[931],{"type":59,"tag":185,"props":932,"children":933},{},[934],{"type":64,"value":935},"    return java.util.List.of(dag);\n",{"type":59,"tag":185,"props":937,"children":938},{"class":187,"line":251},[939],{"type":59,"tag":185,"props":940,"children":941},{},[942],{"type":64,"value":459},{"type":59,"tag":185,"props":944,"children":945},{"class":187,"line":259},[946],{"type":59,"tag":185,"props":947,"children":948},{},[949],{"type":64,"value":579},{"type":59,"tag":67,"props":951,"children":952},{},[953,955,960],{"type":64,"value":954},"Each ",{"type":59,"tag":81,"props":956,"children":958},{"className":957},[],[959],{"type":64,"value":768},{"type":64,"value":961}," class needs a public no-arg constructor. Task IDs must be unique within a DAG, and DAG IDs unique within a bundle.",{"type":59,"tag":152,"props":963,"children":964},{},[],{"type":59,"tag":156,"props":966,"children":968},{"id":967},"the-entry-point",[969],{"type":64,"value":970},"The entry point",{"type":59,"tag":67,"props":972,"children":973},{},[974,976,982],{"type":64,"value":975},"Every bundle has a ",{"type":59,"tag":81,"props":977,"children":979},{"className":978},[],[980],{"type":64,"value":981},"main",{"type":64,"value":983}," that hands your DAGs to the SDK server. The server connects to the coordinator, runs one task instance, and exits.",{"type":59,"tag":174,"props":985,"children":987},{"className":352,"code":986,"language":14,"meta":179,"style":179},"import java.util.List;\nimport org.apache.airflow.sdk.*;\n\npublic class Main implements BundleBuilder {\n  @Override\n  public Iterable\u003CDag> getDags() {\n    \u002F\u002F With the annotation API, the *Builder classes are generated at compile time.\n    return List.of(SalesPipelineBuilder.build());\n  }\n\n  public static void main(String[] args) {\n    Server.create(args).serve(new Main().build());\n  }\n}\n",[988],{"type":59,"tag":81,"props":989,"children":990},{"__ignoreMap":179},[991,999,1006,1013,1021,1028,1035,1043,1051,1058,1065,1073,1081,1088],{"type":59,"tag":185,"props":992,"children":993},{"class":187,"line":188},[994],{"type":59,"tag":185,"props":995,"children":996},{},[997],{"type":64,"value":998},"import java.util.List;\n",{"type":59,"tag":185,"props":1000,"children":1001},{"class":187,"line":197},[1002],{"type":59,"tag":185,"props":1003,"children":1004},{},[1005],{"type":64,"value":373},{"type":59,"tag":185,"props":1007,"children":1008},{"class":187,"line":207},[1009],{"type":59,"tag":185,"props":1010,"children":1011},{"emptyLinePlaceholder":201},[1012],{"type":64,"value":204},{"type":59,"tag":185,"props":1014,"children":1015},{"class":187,"line":215},[1016],{"type":59,"tag":185,"props":1017,"children":1018},{},[1019],{"type":64,"value":1020},"public class Main implements BundleBuilder {\n",{"type":59,"tag":185,"props":1022,"children":1023},{"class":187,"line":224},[1024],{"type":59,"tag":185,"props":1025,"children":1026},{},[1027],{"type":64,"value":807},{"type":59,"tag":185,"props":1029,"children":1030},{"class":187,"line":233},[1031],{"type":59,"tag":185,"props":1032,"children":1033},{},[1034],{"type":64,"value":903},{"type":59,"tag":185,"props":1036,"children":1037},{"class":187,"line":242},[1038],{"type":59,"tag":185,"props":1039,"children":1040},{},[1041],{"type":64,"value":1042},"    \u002F\u002F With the annotation API, the *Builder classes are generated at compile time.\n",{"type":59,"tag":185,"props":1044,"children":1045},{"class":187,"line":251},[1046],{"type":59,"tag":185,"props":1047,"children":1048},{},[1049],{"type":64,"value":1050},"    return List.of(SalesPipelineBuilder.build());\n",{"type":59,"tag":185,"props":1052,"children":1053},{"class":187,"line":259},[1054],{"type":59,"tag":185,"props":1055,"children":1056},{},[1057],{"type":64,"value":459},{"type":59,"tag":185,"props":1059,"children":1060},{"class":187,"line":267},[1061],{"type":59,"tag":185,"props":1062,"children":1063},{"emptyLinePlaceholder":201},[1064],{"type":64,"value":204},{"type":59,"tag":185,"props":1066,"children":1067},{"class":187,"line":276},[1068],{"type":59,"tag":185,"props":1069,"children":1070},{},[1071],{"type":64,"value":1072},"  public static void main(String[] args) {\n",{"type":59,"tag":185,"props":1074,"children":1075},{"class":187,"line":284},[1076],{"type":59,"tag":185,"props":1077,"children":1078},{},[1079],{"type":64,"value":1080},"    Server.create(args).serve(new Main().build());\n",{"type":59,"tag":185,"props":1082,"children":1083},{"class":187,"line":293},[1084],{"type":59,"tag":185,"props":1085,"children":1086},{},[1087],{"type":64,"value":459},{"type":59,"tag":185,"props":1089,"children":1090},{"class":187,"line":301},[1091],{"type":59,"tag":185,"props":1092,"children":1093},{},[1094],{"type":64,"value":579},{"type":59,"tag":67,"props":1096,"children":1097},{},[1098,1104,1106,1111,1113,1117],{"type":59,"tag":81,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":64,"value":1103},"Server.create(args)",{"type":64,"value":1105}," parses the connection details Airflow passes on the command line — don't construct them by hand. Record this ",{"type":59,"tag":81,"props":1107,"children":1109},{"className":1108},[],[1110],{"type":64,"value":981},{"type":64,"value":1112}," class as the bundle's main class when you build it (see ",{"type":59,"tag":73,"props":1114,"children":1115},{},[1116],{"type":64,"value":148},{"type":64,"value":660},{"type":59,"tag":152,"props":1119,"children":1120},{},[],{"type":59,"tag":156,"props":1122,"children":1124},{"id":1123},"talking-to-airflow-from-a-task-client",[1125,1127],{"type":64,"value":1126},"Talking to Airflow from a task: ",{"type":59,"tag":81,"props":1128,"children":1130},{"className":1129},[],[1131],{"type":64,"value":1132},"Client",{"type":59,"tag":67,"props":1134,"children":1135},{},[1136,1138,1143],{"type":64,"value":1137},"A ",{"type":59,"tag":81,"props":1139,"children":1141},{"className":1140},[],[1142],{"type":64,"value":1132},{"type":64,"value":1144}," is passed into every task and is scoped to the current DAG run and task instance.",{"type":59,"tag":586,"props":1146,"children":1147},{},[1148,1169],{"type":59,"tag":590,"props":1149,"children":1150},{},[1151],{"type":59,"tag":594,"props":1152,"children":1153},{},[1154,1159,1164],{"type":59,"tag":598,"props":1155,"children":1156},{},[1157],{"type":64,"value":1158},"Call",{"type":59,"tag":598,"props":1160,"children":1161},{},[1162],{"type":64,"value":1163},"Returns",{"type":59,"tag":598,"props":1165,"children":1166},{},[1167],{"type":64,"value":1168},"Notes",{"type":59,"tag":609,"props":1170,"children":1171},{},[1172,1263,1306,1381],{"type":59,"tag":594,"props":1173,"children":1174},{},[1175,1184,1193],{"type":59,"tag":616,"props":1176,"children":1177},{},[1178],{"type":59,"tag":81,"props":1179,"children":1181},{"className":1180},[],[1182],{"type":64,"value":1183},"client.getConnection(id)",{"type":59,"tag":616,"props":1185,"children":1186},{},[1187],{"type":59,"tag":81,"props":1188,"children":1190},{"className":1189},[],[1191],{"type":64,"value":1192},"Connection",{"type":59,"tag":616,"props":1194,"children":1195},{},[1196,1198,1203,1205,1211,1212,1218,1219,1225,1226,1232,1233,1239,1240,1246,1247,1253,1255,1261],{"type":64,"value":1197},"Fields: ",{"type":59,"tag":81,"props":1199,"children":1201},{"className":1200},[],[1202],{"type":64,"value":635},{"type":64,"value":1204},", ",{"type":59,"tag":81,"props":1206,"children":1208},{"className":1207},[],[1209],{"type":64,"value":1210},"type",{"type":64,"value":1204},{"type":59,"tag":81,"props":1213,"children":1215},{"className":1214},[],[1216],{"type":64,"value":1217},"host",{"type":64,"value":1204},{"type":59,"tag":81,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":64,"value":1224},"schema",{"type":64,"value":1204},{"type":59,"tag":81,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":64,"value":1231},"login",{"type":64,"value":1204},{"type":59,"tag":81,"props":1234,"children":1236},{"className":1235},[],[1237],{"type":64,"value":1238},"password",{"type":64,"value":1204},{"type":59,"tag":81,"props":1241,"children":1243},{"className":1242},[],[1244],{"type":64,"value":1245},"port",{"type":64,"value":1204},{"type":59,"tag":81,"props":1248,"children":1250},{"className":1249},[],[1251],{"type":64,"value":1252},"extra",{"type":64,"value":1254},". Any unset field is ",{"type":59,"tag":81,"props":1256,"children":1258},{"className":1257},[],[1259],{"type":64,"value":1260},"null",{"type":64,"value":1262},". Throws if the connection doesn't exist.",{"type":59,"tag":594,"props":1264,"children":1265},{},[1266,1275,1293],{"type":59,"tag":616,"props":1267,"children":1268},{},[1269],{"type":59,"tag":81,"props":1270,"children":1272},{"className":1271},[],[1273],{"type":64,"value":1274},"client.getVariable(key)",{"type":59,"tag":616,"props":1276,"children":1277},{},[1278,1284,1286,1291],{"type":59,"tag":81,"props":1279,"children":1281},{"className":1280},[],[1282],{"type":64,"value":1283},"Object",{"type":64,"value":1285}," (or ",{"type":59,"tag":81,"props":1287,"children":1289},{"className":1288},[],[1290],{"type":64,"value":1260},{"type":64,"value":1292},")",{"type":59,"tag":616,"props":1294,"children":1295},{},[1296,1298,1304],{"type":64,"value":1297},"Cast to the type you expect, e.g. ",{"type":59,"tag":81,"props":1299,"children":1301},{"className":1300},[],[1302],{"type":64,"value":1303},"(String) client.getVariable(\"threshold\")",{"type":64,"value":1305},".",{"type":59,"tag":594,"props":1307,"children":1308},{},[1309,1318,1333],{"type":59,"tag":616,"props":1310,"children":1311},{},[1312],{"type":59,"tag":81,"props":1313,"children":1315},{"className":1314},[],[1316],{"type":64,"value":1317},"client.getXCom(taskId)",{"type":59,"tag":616,"props":1319,"children":1320},{},[1321,1326,1327,1332],{"type":59,"tag":81,"props":1322,"children":1324},{"className":1323},[],[1325],{"type":64,"value":1283},{"type":64,"value":1285},{"type":59,"tag":81,"props":1328,"children":1330},{"className":1329},[],[1331],{"type":64,"value":1260},{"type":64,"value":1292},{"type":59,"tag":616,"props":1334,"children":1335},{},[1336,1338,1343,1345,1350,1351,1357,1358,1364,1365,1371,1373,1379],{"type":64,"value":1337},"Reads another task's ",{"type":59,"tag":81,"props":1339,"children":1341},{"className":1340},[],[1342],{"type":64,"value":729},{"type":64,"value":1344}," by default. Overloads accept ",{"type":59,"tag":81,"props":1346,"children":1348},{"className":1347},[],[1349],{"type":64,"value":721},{"type":64,"value":1204},{"type":59,"tag":81,"props":1352,"children":1354},{"className":1353},[],[1355],{"type":64,"value":1356},"dagId",{"type":64,"value":1204},{"type":59,"tag":81,"props":1359,"children":1361},{"className":1360},[],[1362],{"type":64,"value":1363},"runId",{"type":64,"value":1204},{"type":59,"tag":81,"props":1366,"children":1368},{"className":1367},[],[1369],{"type":64,"value":1370},"mapIndex",{"type":64,"value":1372},", and ",{"type":59,"tag":81,"props":1374,"children":1376},{"className":1375},[],[1377],{"type":64,"value":1378},"includePriorDates",{"type":64,"value":1380}," for cross-DAG\u002Frun reads and mapped tasks.",{"type":59,"tag":594,"props":1382,"children":1383},{},[1384,1393,1398],{"type":59,"tag":616,"props":1385,"children":1386},{},[1387],{"type":59,"tag":81,"props":1388,"children":1390},{"className":1389},[],[1391],{"type":64,"value":1392},"client.setXCom(value)",{"type":59,"tag":616,"props":1394,"children":1395},{},[1396],{"type":64,"value":1397},"—",{"type":59,"tag":616,"props":1399,"children":1400},{},[1401,1403,1408],{"type":64,"value":1402},"Pushes the ",{"type":59,"tag":81,"props":1404,"children":1406},{"className":1405},[],[1407],{"type":64,"value":729},{"type":64,"value":1409}," XCom (interface API). Value must be JSON-serializable. With the annotation API, returning a value does this for you.",{"type":59,"tag":331,"props":1411,"children":1413},{"id":1412},"context",[1414],{"type":59,"tag":81,"props":1415,"children":1417},{"className":1416},[],[1418],{"type":64,"value":1419},"Context",{"type":59,"tag":67,"props":1421,"children":1422},{},[1423,1425,1430,1432,1438,1440,1445,1446,1451,1453,1459,1460,1465,1466,1471,1472,1478,1479,1484,1485,1491,1493,1498],{"type":64,"value":1424},"The ",{"type":59,"tag":81,"props":1426,"children":1428},{"className":1427},[],[1429],{"type":64,"value":1419},{"type":64,"value":1431}," parameter exposes run metadata: ",{"type":59,"tag":81,"props":1433,"children":1435},{"className":1434},[],[1436],{"type":64,"value":1437},"context.dagRun",{"type":64,"value":1439}," (",{"type":59,"tag":81,"props":1441,"children":1443},{"className":1442},[],[1444],{"type":64,"value":1356},{"type":64,"value":1204},{"type":59,"tag":81,"props":1447,"children":1449},{"className":1448},[],[1450],{"type":64,"value":1363},{"type":64,"value":1452},") and ",{"type":59,"tag":81,"props":1454,"children":1456},{"className":1455},[],[1457],{"type":64,"value":1458},"context.ti",{"type":64,"value":1439},{"type":59,"tag":81,"props":1461,"children":1463},{"className":1462},[],[1464],{"type":64,"value":1356},{"type":64,"value":1204},{"type":59,"tag":81,"props":1467,"children":1469},{"className":1468},[],[1470],{"type":64,"value":1363},{"type":64,"value":1204},{"type":59,"tag":81,"props":1473,"children":1475},{"className":1474},[],[1476],{"type":64,"value":1477},"taskId",{"type":64,"value":1204},{"type":59,"tag":81,"props":1480,"children":1482},{"className":1481},[],[1483],{"type":64,"value":1370},{"type":64,"value":1204},{"type":59,"tag":81,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":64,"value":1490},"tryNumber",{"type":64,"value":1492},"). ",{"type":59,"tag":81,"props":1494,"children":1496},{"className":1495},[],[1497],{"type":64,"value":1490},{"type":64,"value":1499}," is useful for retry-aware logic.",{"type":59,"tag":152,"props":1501,"children":1502},{},[],{"type":59,"tag":156,"props":1504,"children":1506},{"id":1505},"xcom-java-types",[1507],{"type":64,"value":1508},"XCom: Java types",{"type":59,"tag":67,"props":1510,"children":1511},{},[1512,1514,1518],{"type":64,"value":1513},"XComs cross the boundary as JSON (the shared contract is in ",{"type":59,"tag":73,"props":1515,"children":1516},{},[1517],{"type":64,"value":93},{"type":64,"value":1519},"). When you read one back in Java you get:",{"type":59,"tag":586,"props":1521,"children":1522},{},[1523,1550],{"type":59,"tag":590,"props":1524,"children":1525},{},[1526],{"type":59,"tag":594,"props":1527,"children":1528},{},[1529,1534,1539],{"type":59,"tag":598,"props":1530,"children":1531},{},[1532],{"type":64,"value":1533},"Python type",{"type":59,"tag":598,"props":1535,"children":1536},{},[1537],{"type":64,"value":1538},"JSON",{"type":59,"tag":598,"props":1540,"children":1541},{},[1542,1544],{"type":64,"value":1543},"Java type from ",{"type":59,"tag":81,"props":1545,"children":1547},{"className":1546},[],[1548],{"type":64,"value":1549},"getXCom",{"type":59,"tag":609,"props":1551,"children":1552},{},[1553,1588,1614,1640,1666,1690,1716],{"type":59,"tag":594,"props":1554,"children":1555},{},[1556,1565,1570],{"type":59,"tag":616,"props":1557,"children":1558},{},[1559],{"type":59,"tag":81,"props":1560,"children":1562},{"className":1561},[],[1563],{"type":64,"value":1564},"int",{"type":59,"tag":616,"props":1566,"children":1567},{},[1568],{"type":64,"value":1569},"integer",{"type":59,"tag":616,"props":1571,"children":1572},{},[1573,1579,1580,1586],{"type":59,"tag":81,"props":1574,"children":1576},{"className":1575},[],[1577],{"type":64,"value":1578},"Long",{"type":64,"value":1285},{"type":59,"tag":81,"props":1581,"children":1583},{"className":1582},[],[1584],{"type":64,"value":1585},"BigInteger",{"type":64,"value":1587}," if too large)",{"type":59,"tag":594,"props":1589,"children":1590},{},[1591,1600,1605],{"type":59,"tag":616,"props":1592,"children":1593},{},[1594],{"type":59,"tag":81,"props":1595,"children":1597},{"className":1596},[],[1598],{"type":64,"value":1599},"float",{"type":59,"tag":616,"props":1601,"children":1602},{},[1603],{"type":64,"value":1604},"decimal",{"type":59,"tag":616,"props":1606,"children":1607},{},[1608],{"type":59,"tag":81,"props":1609,"children":1611},{"className":1610},[],[1612],{"type":64,"value":1613},"Double",{"type":59,"tag":594,"props":1615,"children":1616},{},[1617,1626,1631],{"type":59,"tag":616,"props":1618,"children":1619},{},[1620],{"type":59,"tag":81,"props":1621,"children":1623},{"className":1622},[],[1624],{"type":64,"value":1625},"str",{"type":59,"tag":616,"props":1627,"children":1628},{},[1629],{"type":64,"value":1630},"string",{"type":59,"tag":616,"props":1632,"children":1633},{},[1634],{"type":59,"tag":81,"props":1635,"children":1637},{"className":1636},[],[1638],{"type":64,"value":1639},"String",{"type":59,"tag":594,"props":1641,"children":1642},{},[1643,1652,1657],{"type":59,"tag":616,"props":1644,"children":1645},{},[1646],{"type":59,"tag":81,"props":1647,"children":1649},{"className":1648},[],[1650],{"type":64,"value":1651},"bool",{"type":59,"tag":616,"props":1653,"children":1654},{},[1655],{"type":64,"value":1656},"boolean",{"type":59,"tag":616,"props":1658,"children":1659},{},[1660],{"type":59,"tag":81,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":64,"value":1665},"Boolean",{"type":59,"tag":594,"props":1667,"children":1668},{},[1669,1678,1682],{"type":59,"tag":616,"props":1670,"children":1671},{},[1672],{"type":59,"tag":81,"props":1673,"children":1675},{"className":1674},[],[1676],{"type":64,"value":1677},"None",{"type":59,"tag":616,"props":1679,"children":1680},{},[1681],{"type":64,"value":1260},{"type":59,"tag":616,"props":1683,"children":1684},{},[1685],{"type":59,"tag":81,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":64,"value":1260},{"type":59,"tag":594,"props":1691,"children":1692},{},[1693,1702,1707],{"type":59,"tag":616,"props":1694,"children":1695},{},[1696],{"type":59,"tag":81,"props":1697,"children":1699},{"className":1698},[],[1700],{"type":64,"value":1701},"list",{"type":59,"tag":616,"props":1703,"children":1704},{},[1705],{"type":64,"value":1706},"array",{"type":59,"tag":616,"props":1708,"children":1709},{},[1710],{"type":59,"tag":81,"props":1711,"children":1713},{"className":1712},[],[1714],{"type":64,"value":1715},"List\u003CObject>",{"type":59,"tag":594,"props":1717,"children":1718},{},[1719,1728,1733],{"type":59,"tag":616,"props":1720,"children":1721},{},[1722],{"type":59,"tag":81,"props":1723,"children":1725},{"className":1724},[],[1726],{"type":64,"value":1727},"dict",{"type":59,"tag":616,"props":1729,"children":1730},{},[1731],{"type":64,"value":1732},"object",{"type":59,"tag":616,"props":1734,"children":1735},{},[1736],{"type":59,"tag":81,"props":1737,"children":1739},{"className":1738},[],[1740],{"type":64,"value":1741},"Map\u003CString, Object>",{"type":59,"tag":67,"props":1743,"children":1744},{},[1745,1747,1753,1755,1760,1762,1767],{"type":64,"value":1746},"Declare ",{"type":59,"tag":81,"props":1748,"children":1750},{"className":1749},[],[1751],{"type":64,"value":1752},"@Builder.XCom",{"type":64,"value":1754}," parameter types to match. A mismatch (e.g. declaring ",{"type":59,"tag":81,"props":1756,"children":1758},{"className":1757},[],[1759],{"type":64,"value":1564},{"type":64,"value":1761}," when the value is a ",{"type":59,"tag":81,"props":1763,"children":1765},{"className":1764},[],[1766],{"type":64,"value":1639},{"type":64,"value":1768},") fails the task.",{"type":59,"tag":152,"props":1770,"children":1771},{},[],{"type":59,"tag":156,"props":1773,"children":1775},{"id":1774},"logging",[1776],{"type":64,"value":1777},"Logging",{"type":59,"tag":67,"props":1779,"children":1780},{},[1781],{"type":64,"value":1782},"Declare a logger as a static field named after the class — the conventional pattern regardless of framework:",{"type":59,"tag":174,"props":1784,"children":1786},{"className":352,"code":1785,"language":14,"meta":179,"style":179},"private static final System.Logger log = System.getLogger(SalesPipeline.class.getName());\n",[1787],{"type":59,"tag":81,"props":1788,"children":1789},{"__ignoreMap":179},[1790],{"type":59,"tag":185,"props":1791,"children":1792},{"class":187,"line":188},[1793],{"type":59,"tag":185,"props":1794,"children":1795},{},[1796],{"type":64,"value":1785},{"type":59,"tag":67,"props":1798,"children":1799},{},[1800,1802,1808,1809,1815,1816,1822,1824,1830,1832,1836,1838,1844,1846,1851],{"type":64,"value":1801},"For records to reach Airflow's task log store (and show in the UI), the bundle must include one of the SDK logging integration artifacts (",{"type":59,"tag":81,"props":1803,"children":1805},{"className":1804},[],[1806],{"type":64,"value":1807},"airflow-sdk-jpl",{"type":64,"value":1204},{"type":59,"tag":81,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":64,"value":1814},"airflow-sdk-slf4j",{"type":64,"value":1204},{"type":59,"tag":81,"props":1817,"children":1819},{"className":1818},[],[1820],{"type":64,"value":1821},"airflow-sdk-log4j2",{"type":64,"value":1823},", or ",{"type":59,"tag":81,"props":1825,"children":1827},{"className":1826},[],[1828],{"type":64,"value":1829},"airflow-sdk-jul",{"type":64,"value":1831},"). The dependencies and per-framework setup are in the logging integration section of ",{"type":59,"tag":73,"props":1833,"children":1834},{},[1835],{"type":64,"value":148},{"type":64,"value":1837},". ",{"type":59,"tag":81,"props":1839,"children":1841},{"className":1840},[],[1842],{"type":64,"value":1843},"System.Logger",{"type":64,"value":1845}," (JPL) with ",{"type":59,"tag":81,"props":1847,"children":1849},{"className":1848},[],[1850],{"type":64,"value":1807},{"type":64,"value":1852}," is the lightest option and needs no configuration.",{"type":59,"tag":152,"props":1854,"children":1855},{},[],{"type":59,"tag":156,"props":1857,"children":1859},{"id":1858},"a-complete-worked-example-ships-with-the-sdk",[1860],{"type":64,"value":1861},"A complete worked example ships with the SDK",{"type":59,"tag":67,"props":1863,"children":1864},{},[1865,1867,1873],{"type":64,"value":1866},"The SDK repository includes a runnable example under ",{"type":59,"tag":81,"props":1868,"children":1870},{"className":1869},[],[1871],{"type":64,"value":1872},"java-sdk\u002Fexample\u002F",{"type":64,"value":873},{"type":59,"tag":1875,"props":1876,"children":1877},"ul",{},[1878,1905,1924,1949],{"type":59,"tag":1879,"props":1880,"children":1881},"li",{},[1882,1888,1890,1896,1898,1904],{"type":59,"tag":81,"props":1883,"children":1885},{"className":1884},[],[1886],{"type":64,"value":1887},"src\u002Fresources\u002Fdags\u002Fjava_examples.py",{"type":64,"value":1889}," — Python DAGs pairing Python tasks with Java stubs, including a ",{"type":59,"tag":81,"props":1891,"children":1893},{"className":1892},[],[1894],{"type":64,"value":1895},"load",{"type":64,"value":1897}," stub with ",{"type":59,"tag":81,"props":1899,"children":1901},{"className":1900},[],[1902],{"type":64,"value":1903},"retries=1",{"type":64,"value":1305},{"type":59,"tag":1879,"props":1906,"children":1907},{},[1908,1914,1916,1922],{"type":59,"tag":81,"props":1909,"children":1911},{"className":1910},[],[1912],{"type":64,"value":1913},"src\u002Fjava\u002F...\u002FAnnotationExample.java",{"type":64,"value":1915}," — annotation API, including a task that fails on ",{"type":59,"tag":81,"props":1917,"children":1919},{"className":1918},[],[1920],{"type":64,"value":1921},"tryNumber == 1",{"type":64,"value":1923}," and succeeds on retry.",{"type":59,"tag":1879,"props":1925,"children":1926},{},[1927,1933,1935,1940,1942,1948],{"type":59,"tag":81,"props":1928,"children":1930},{"className":1929},[],[1931],{"type":64,"value":1932},"src\u002Fjava\u002F...\u002FInterfaceExampleBuilder.java",{"type":64,"value":1934}," — the same tasks via the ",{"type":59,"tag":81,"props":1936,"children":1938},{"className":1937},[],[1939],{"type":64,"value":768},{"type":64,"value":1941}," interface and ",{"type":59,"tag":81,"props":1943,"children":1945},{"className":1944},[],[1946],{"type":64,"value":1947},"Dag.addTask(...)",{"type":64,"value":1305},{"type":59,"tag":1879,"props":1950,"children":1951},{},[1952,1958,1960,1965,1967,1972],{"type":59,"tag":81,"props":1953,"children":1955},{"className":1954},[],[1956],{"type":64,"value":1957},"src\u002Fjava\u002F...\u002FExampleBundleBuilder.java",{"type":64,"value":1959}," — a ",{"type":59,"tag":81,"props":1961,"children":1963},{"className":1962},[],[1964],{"type":64,"value":871},{"type":64,"value":1966}," returning both DAGs plus the ",{"type":59,"tag":81,"props":1968,"children":1970},{"className":1969},[],[1971],{"type":64,"value":981},{"type":64,"value":1973}," entry point.",{"type":59,"tag":67,"props":1975,"children":1976},{},[1977],{"type":64,"value":1978},"Point users there for an end-to-end reference.",{"type":59,"tag":152,"props":1980,"children":1981},{},[],{"type":59,"tag":156,"props":1983,"children":1985},{"id":1984},"java-specific-pitfalls",[1986],{"type":64,"value":1987},"Java-specific pitfalls",{"type":59,"tag":1875,"props":1989,"children":1990},{},[1991,2029,2044,2066],{"type":59,"tag":1879,"props":1992,"children":1993},{},[1994,2006,2007,2013,2015,2020,2022,2027],{"type":59,"tag":73,"props":1995,"children":1996},{},[1997,1999,2004],{"type":64,"value":1998},"Cast ",{"type":59,"tag":81,"props":2000,"children":2002},{"className":2001},[],[2003],{"type":64,"value":1283},{"type":64,"value":2005}," returns deliberately.",{"type":64,"value":122},{"type":59,"tag":81,"props":2008,"children":2010},{"className":2009},[],[2011],{"type":64,"value":2012},"getVariable",{"type":64,"value":2014}," and ",{"type":59,"tag":81,"props":2016,"children":2018},{"className":2017},[],[2019],{"type":64,"value":1549},{"type":64,"value":2021}," return ",{"type":59,"tag":81,"props":2023,"children":2025},{"className":2024},[],[2026],{"type":64,"value":1283},{"type":64,"value":2028},"; match the cast to the JSON type (see the table above).",{"type":59,"tag":1879,"props":2030,"children":2031},{},[2032,2042],{"type":59,"tag":73,"props":2033,"children":2034},{},[2035,2040],{"type":59,"tag":81,"props":2036,"children":2038},{"className":2037},[],[2039],{"type":64,"value":1752},{"type":64,"value":2041}," parameter types must match the stored JSON type",{"type":64,"value":2043},", or the task fails at runtime.",{"type":59,"tag":1879,"props":2045,"children":2046},{},[2047,2052,2054,2059,2061,2065],{"type":59,"tag":73,"props":2048,"children":2049},{},[2050],{"type":64,"value":2051},"The annotation processor must be on the build",{"type":64,"value":2053}," for the annotation API (generates ",{"type":59,"tag":81,"props":2055,"children":2057},{"className":2056},[],[2058],{"type":64,"value":347},{"type":64,"value":2060},"); it is not needed for the interface API. See ",{"type":59,"tag":73,"props":2062,"children":2063},{},[2064],{"type":64,"value":148},{"type":64,"value":1305},{"type":59,"tag":1879,"props":2067,"children":2068},{},[2069,2071,2075],{"type":64,"value":2070},"See ",{"type":59,"tag":73,"props":2072,"children":2073},{},[2074],{"type":64,"value":93},{"type":64,"value":2076}," for the language-agnostic pitfalls (ID matching, one JVM per task instance, queue\u002Fretries on the stub).",{"type":59,"tag":152,"props":2078,"children":2079},{},[],{"type":59,"tag":156,"props":2081,"children":2083},{"id":2082},"related-skills",[2084],{"type":64,"value":2085},"Related Skills",{"type":59,"tag":1875,"props":2087,"children":2088},{},[2089,2098,2121,2130],{"type":59,"tag":1879,"props":2090,"children":2091},{},[2092,2096],{"type":59,"tag":73,"props":2093,"children":2094},{},[2095],{"type":64,"value":93},{"type":64,"value":2097},": Shared Python-stub pattern and concepts (read first).",{"type":59,"tag":1879,"props":2099,"children":2100},{},[2101,2105,2107,2112,2114,2119],{"type":59,"tag":73,"props":2102,"children":2103},{},[2104],{"type":64,"value":133},{"type":64,"value":2106},": Route the ",{"type":59,"tag":81,"props":2108,"children":2110},{"className":2109},[],[2111],{"type":64,"value":14},{"type":64,"value":2113}," queue to ",{"type":59,"tag":81,"props":2115,"children":2117},{"className":2116},[],[2118],{"type":64,"value":141},{"type":64,"value":2120}," and set JRE\u002Fcoordinator options.",{"type":59,"tag":1879,"props":2122,"children":2123},{},[2124,2128],{"type":59,"tag":73,"props":2125,"children":2126},{},[2127],{"type":64,"value":148},{"type":64,"value":2129},": Build the bundle (Gradle\u002FMaven) and place the JAR where Airflow can find it.",{"type":59,"tag":1879,"props":2131,"children":2132},{},[2133,2138],{"type":59,"tag":73,"props":2134,"children":2135},{},[2136],{"type":64,"value":2137},"authoring-dags",{"type":64,"value":2139},": General Airflow DAG authoring.",{"type":59,"tag":2141,"props":2142,"children":2143},"style",{},[2144],{"type":64,"value":2145},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2147,"total":2247},[2148,2163,2175,2191,2205,2222,2235],{"slug":32,"name":32,"fn":2149,"description":2150,"org":2151,"tags":2152,"stars":22,"repoUrl":23,"updatedAt":2162},"manage and troubleshoot Airflow via CLI","Queries, manages, and troubleshoots Apache Airflow using the `af` CLI. Use when working with anything related to Airflow - a DAG, a DAG run, a task log, an import or parse error, a broken DAG, or any Airflow operation. Covers listing and triggering DAGs, retrying runs, reading task logs, diagnosing failures, debugging import and parse errors, checking connections, variables and pools, exploring the REST API, and monitoring health (for example \"trigger a pipeline\", \"retry a run\", \"list connections\", \"check Airflow health\", \"why did my DAG fail\"). This is the entrypoint that routes to sibling skills for authoring, testing, deploying, and migrating Airflow 2 to 3. Not for warehouse\u002FSQL analytics on Airflow metadata tables (use analyzing-data); for deep root-cause reports use debugging-dags or airflow-investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2153,2155,2158,2159],{"name":2154,"slug":32,"type":15},"Airflow",{"name":2156,"slug":2157,"type":15},"CLI","cli",{"name":17,"slug":18,"type":15},{"name":2160,"slug":2161,"type":15},"Debugging","debugging","2026-04-06T18:01:43.992997",{"slug":2164,"name":2164,"fn":2165,"description":2166,"org":2167,"tags":2168,"stars":22,"repoUrl":23,"updatedAt":2174},"airflow-hitl","add human-in-the-loop steps to Airflow DAGs","Builds human-in-the-loop (HITL) Airflow workflows - approval gates, form input, and human-driven branching. Use when a DAG needs a human in the loop - an approval or reject step, sign-off before a task runs, a decision or approval UI, branching on a human choice, or collecting form input mid-run; also on mentions of ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, or HITLTrigger. Requires Airflow 3.1+. Not for AI\u002FLLM task calls (see migrating-ai-sdk-to-common-ai).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2169,2170,2173],{"name":2154,"slug":32,"type":15},{"name":2171,"slug":2172,"type":15},"Approvals","approvals",{"name":17,"slug":18,"type":15},"2026-04-06T18:01:46.758548",{"slug":2176,"name":2176,"fn":2177,"description":2178,"org":2179,"tags":2180,"stars":22,"repoUrl":23,"updatedAt":2190},"airflow-plugins","build Airflow UI plugins","Builds Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use when building anything custom inside Airflow 3.1+ that involves Python and a browser-facing interface - creating an Airflow plugin, adding a custom UI page or nav entry, building FastAPI-backed endpoints inside Airflow, serving static assets from a plugin, embedding a React app, adding middleware to the API server, creating custom operator extra links, or calling the Airflow REST API from inside a plugin; also when AirflowPlugin, fastapi_apps, external_views, react_apps, or plugin registration come up.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2181,2182,2185,2187],{"name":2154,"slug":32,"type":15},{"name":2183,"slug":2184,"type":15},"Plugin Development","plugin-development",{"name":2186,"slug":178,"type":15},"Python",{"name":2188,"slug":2189,"type":15},"UI Components","ui-components","2026-04-06T18:01:56.827891",{"slug":2192,"name":2192,"fn":2193,"description":2194,"org":2195,"tags":2196,"stars":22,"repoUrl":23,"updatedAt":2204},"airflow-state-store","persist Airflow task and asset state","Persists task and asset state across retries and DAG runs using Airflow 3.3's AIP-103 key\u002Fvalue stores (`task_state_store`, `asset_state_store`) and the crash-safe `ResumableJobMixin`. Use when the user asks about task state store, checkpointing in tasks, persisting state across retries, job IDs surviving worker crashes, watermarks, asset metadata, resumable tasks, crash-safe operators, or \"what's new in Airflow 3.3\". Also use proactively when reading a DAG that uses Variables or XCom for intra-task coordination state — flag the anti-pattern and recommend task_state_store or asset_state_store instead. Requires Airflow 3.3+.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2197,2198,2200,2201],{"name":2154,"slug":32,"type":15},{"name":2199,"slug":37,"type":15},"Data Engineering",{"name":17,"slug":18,"type":15},{"name":2202,"slug":2203,"type":15},"Operations","operations","2026-07-07T06:43:11.160671",{"slug":2206,"name":2206,"fn":2207,"description":2208,"org":2209,"tags":2210,"stars":22,"repoUrl":23,"updatedAt":2221},"analyzing-data","query data warehouses for business questions","Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example \"who uses X\", \"how many Y\", \"show me Z\", \"find customers\", \"what is the count\").",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2211,2214,2217,2218],{"name":2212,"slug":2213,"type":15},"Analytics","analytics",{"name":2215,"slug":2216,"type":15},"Data Analysis","data-analysis",{"name":2199,"slug":37,"type":15},{"name":2219,"slug":2220,"type":15},"SQL","sql","2026-04-06T18:01:49.599775",{"slug":2223,"name":2223,"fn":2224,"description":2225,"org":2226,"tags":2227,"stars":22,"repoUrl":23,"updatedAt":2234},"annotating-task-lineage","annotate Airflow tasks with data lineage","Annotate Airflow tasks with data lineage using inlets and outlets. Use when the user wants to add lineage metadata to tasks, specify input\u002Foutput datasets, or enable lineage tracking for operators without built-in OpenLineage extraction.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2228,2229,2230,2231],{"name":2154,"slug":32,"type":15},{"name":2199,"slug":37,"type":15},{"name":17,"slug":18,"type":15},{"name":2232,"slug":2233,"type":15},"Observability","observability","2026-04-06T18:02:03.487365",{"slug":2137,"name":2137,"fn":2236,"description":2237,"org":2238,"tags":2239,"stars":22,"repoUrl":23,"updatedAt":2246},"author Airflow DAGs","Workflow and best practices for writing Apache Airflow DAGs. Use when creating a new DAG, write pipeline code, handling questions about DAG patterns and conventions or extending an existing DAG with a follow-up\u002Fdownstream task. ANY request shaped like 'add a DAG named X', 'write a pipeline', 'add a task that runs after Y', or 'extend the DAG'. For testing and debugging DAGs, see the testing-dags skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2240,2241,2242,2245],{"name":2154,"slug":32,"type":15},{"name":17,"slug":18,"type":15},{"name":2243,"slug":2244,"type":15},"ETL","etl",{"name":2186,"slug":178,"type":15},"2026-04-06T18:01:52.679888",34,{"items":2249,"total":2247},[2250,2257,2263,2270,2277,2284,2291,2298,2313,2319,2328,2341],{"slug":32,"name":32,"fn":2149,"description":2150,"org":2251,"tags":2252,"stars":22,"repoUrl":23,"updatedAt":2162},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2253,2254,2255,2256],{"name":2154,"slug":32,"type":15},{"name":2156,"slug":2157,"type":15},{"name":17,"slug":18,"type":15},{"name":2160,"slug":2161,"type":15},{"slug":2164,"name":2164,"fn":2165,"description":2166,"org":2258,"tags":2259,"stars":22,"repoUrl":23,"updatedAt":2174},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2260,2261,2262],{"name":2154,"slug":32,"type":15},{"name":2171,"slug":2172,"type":15},{"name":17,"slug":18,"type":15},{"slug":2176,"name":2176,"fn":2177,"description":2178,"org":2264,"tags":2265,"stars":22,"repoUrl":23,"updatedAt":2190},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2266,2267,2268,2269],{"name":2154,"slug":32,"type":15},{"name":2183,"slug":2184,"type":15},{"name":2186,"slug":178,"type":15},{"name":2188,"slug":2189,"type":15},{"slug":2192,"name":2192,"fn":2193,"description":2194,"org":2271,"tags":2272,"stars":22,"repoUrl":23,"updatedAt":2204},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2273,2274,2275,2276],{"name":2154,"slug":32,"type":15},{"name":2199,"slug":37,"type":15},{"name":17,"slug":18,"type":15},{"name":2202,"slug":2203,"type":15},{"slug":2206,"name":2206,"fn":2207,"description":2208,"org":2278,"tags":2279,"stars":22,"repoUrl":23,"updatedAt":2221},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2280,2281,2282,2283],{"name":2212,"slug":2213,"type":15},{"name":2215,"slug":2216,"type":15},{"name":2199,"slug":37,"type":15},{"name":2219,"slug":2220,"type":15},{"slug":2223,"name":2223,"fn":2224,"description":2225,"org":2285,"tags":2286,"stars":22,"repoUrl":23,"updatedAt":2234},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2287,2288,2289,2290],{"name":2154,"slug":32,"type":15},{"name":2199,"slug":37,"type":15},{"name":17,"slug":18,"type":15},{"name":2232,"slug":2233,"type":15},{"slug":2137,"name":2137,"fn":2236,"description":2237,"org":2292,"tags":2293,"stars":22,"repoUrl":23,"updatedAt":2246},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2294,2295,2296,2297],{"name":2154,"slug":32,"type":15},{"name":17,"slug":18,"type":15},{"name":2243,"slug":2244,"type":15},{"name":2186,"slug":178,"type":15},{"slug":2299,"name":2299,"fn":2300,"description":2301,"org":2302,"tags":2303,"stars":22,"repoUrl":23,"updatedAt":2312},"authoring-go-sdk-tasks","implement Airflow tasks in Go","Writes Airflow task logic in Go using the Airflow Go SDK. Use when the user wants to implement Airflow tasks in Go, asks about `BundleProvider`\u002F`RegisterDags`, the `bundlev1` Registry\u002FDag interfaces, registering Go tasks (`AddTask`\u002F`AddTaskWithName`), dependency injection by parameter type (`context.Context`, `sdk.TIRunContext`, `*slog.Logger`, `sdk.Client`), or reading connections\u002Fvariables\u002FXComs from Go. This skill covers the Go-specific native API; the shared Python-stub pattern and conceptual model live in authoring-language-sdk-tasks. For building\u002Fpacking\u002Fshipping the bundle see deploying-go-sdk-bundles; for coordinator config see configuring-airflow-language-sdks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2304,2305,2308,2309],{"name":2154,"slug":32,"type":15},{"name":2306,"slug":2307,"type":15},"API Development","api-development",{"name":17,"slug":18,"type":15},{"name":2310,"slug":2311,"type":15},"Go","go","2026-07-11T05:39:13.552213",{"slug":4,"name":4,"fn":5,"description":6,"org":2314,"tags":2315,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2316,2317,2318],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"slug":93,"name":93,"fn":2320,"description":2321,"org":2322,"tags":2323,"stars":22,"repoUrl":23,"updatedAt":2327},"implement non-Python Airflow tasks","The language-neutral foundation for Airflow language SDKs — implement task logic in a non-Python language while the DAG stays in Python. Use when the user wants to run an Airflow task in another language (Java, Kotlin, Go, or other JVM\u002Fnative languages), asks how the Python `@task.stub` pairs with native task code, how task\u002FDAG IDs must match across the two sides, how data passes via XCom as JSON, or which language SDKs exist. This skill owns the shared Python-stub pattern and conceptual model; for a specific language's native API, build, and runtime, use that language's skill (e.g. authoring-java-sdk-tasks, authoring-go-sdk-tasks).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2324,2325,2326],{"name":2154,"slug":32,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},"2026-07-18T05:11:54.496539",{"slug":2329,"name":2329,"fn":2330,"description":2331,"org":2332,"tags":2333,"stars":22,"repoUrl":23,"updatedAt":2340},"blueprint","build reusable Airflow task group templates","Define reusable Airflow task group templates with Pydantic validation and compose DAGs from YAML. Use when creating blueprint templates, composing DAGs from YAML, validating configurations, or enabling no-code DAG authoring for non-engineers.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2334,2335,2336,2337],{"name":2154,"slug":32,"type":15},{"name":17,"slug":18,"type":15},{"name":2243,"slug":2244,"type":15},{"name":2338,"slug":2339,"type":15},"Templates","templates","2026-04-06T18:01:45.361425",{"slug":2342,"name":2342,"fn":2343,"description":2344,"org":2345,"tags":2346,"stars":22,"repoUrl":23,"updatedAt":2353},"checking-freshness","check data freshness in warehouses","Quick data freshness check. Use when the user asks if data is up to date, when a table was last updated, if data is stale, or needs to verify data currency before using it.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2347,2348,2349,2352],{"name":2154,"slug":32,"type":15},{"name":2199,"slug":37,"type":15},{"name":2350,"slug":2351,"type":15},"Data Quality","data-quality",{"name":2243,"slug":2244,"type":15},"2026-04-06T18:02:02.138565"]