Hi all,

The TypeScript SDK `0.1.0-beta1` is now published to npm. Note that this is
a **beta**, neither a release candidate nor an official release.

You will need Node `22+` and Airflow built from upstream `main`. The
coordinator layer this SDK runs on is not in a released Airflow yet, so a
build from `main` is required for now.

Getting started takes four commands. `airflow-ts-pack` ships inside the SDK
package, so installing the SDK also gives you the packer.
`esbuild` is a build-time only peer dependency, which is why it is a
separate dev install:

```bash
npm init -y
npm install [email protected]
npm install --save-dev esbuild
# after writing your bundle's entrypoint:
npx airflow-ts-pack src/main.ts --outdir dist
```

For writing the bundle and wiring it up to Airflow (Python stub Dags,
TypeScript task handlers, coordinator config), see the TypeScript SDK API
reference [1] and the Non-Python Task SDKs documentation [2]. The package
itself is on npm [3].

The packer emits a single `dist/bundle.mjs` with the Dag/task manifest
embedded in it, so there is no sidecar file to keep in sync and nothing to
cross-compile — the same bundle runs on any platform your worker uses. Each
directory listed in the coordinator's `bundles_root` must contain that
`bundle.mjs`:

```ini
[sdk]
coordinators = {
  "ts": {
    "classpath": "airflow.sdk.coordinators.node.NodeCoordinator",
    "kwargs": {"bundles_root": ["/opt/airflow/ts-bundles"]}
  }
}
queue_to_coordinator = {"typescript": "ts"}
```

If you encounter any issue during setup or would like to provide feedback,
please discuss in the `#sig-lang-sdks` Slack channel [4].
Many thanks to everyone who contributed to getting the TypeScript SDK this
far!

[1] TypeScript SDK API reference:
https://airflow.staged.apache.org/docs/ts-sdk/stable/
[2] More about Non-Python Task SDKs in the Airflow documentation:
http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/stable/authoring-and-scheduling/language-sdks/typescript.html
[3] npm package (tarball shasum: 743d8d9e2a2d1011de897859201b9f16857071e1):
https://www.npmjs.com/package/apache-airflow-ts-sdk
[4] `#sig-lang-sdks` Slack channel:
https://apache-airflow.slack.com/archives/C08UCFRNAD8

Best regards,
Jason

Reply via email to