shivaam opened a new pull request, #66289:
URL: https://github.com/apache/airflow/pull/66289
## Summary
Adds a new Node.js / TypeScript Task SDK at `ts-sdk/` for running Airflow
tasks
as TypeScript handlers. Workers run as standalone Node processes and connect
to
Airflow over HTTPS via the **Edge Executor (AIP-69)** and **Task Execution
API
(AIP-72)** — no DB access, no in-cluster Python required.
Marked alpha (`0.1.0-alpha.0`) — a foundation for future PRs to build on.
## What's in
- `registerTask` + `startWorker` public API
- Edge API client (worker register, heartbeat, fetch job, ack)
- Execution API client with two-token lifecycle (workload→execution swap via
`Refreshed-API-Token` header — tracks Airflow PR #60108)
- Graceful SIGTERM drain (worker waits for in-flight task; never kills it)
- Heartbeat circuit breaker
- 71 vitest unit tests
- 4 integration scenarios manually verified
## Intentionally deferred (TODOs in `src/worker.ts:21-24`)
- Per-TI heartbeat
- XCom / Variables / Connections
- Log forwarding to Airflow UI
- Subprocess isolation per task
- Concurrency > 1
- Integrate with Coordinator once the AIP design is approved.
## Testing
**Unit:** `pnpm test` — 71/71 pass.
**End-to-end** against `breeze start-airflow --executor edgeexecutor`. Full
recipe in
[ts-sdk/TESTING.md](ts-sdk/TESTING.md).
Scenarios verified:
| DAG | Expected | Verifies |
|---|---|---|
| `core_integration` | success | Happy path: register, /run + token swap,
handler, markSuccess |
| `core_failure` | failed | Handler throws → markFailed |
| `core_missing_handler` | failed | No handler registered → clean failure
log |
| `core_sigterm_inflight` | success after 2 min | Worker drains by waiting;
never kills the task |
Pure-JS consumer canary (`integration/workers/js-consumer.mjs`) also
verified —
proves the SDK works for users who don't write TypeScript.
## Notes for reviewers
- **CI integration** (lint/typecheck/test on every PR touching `ts-sdk/`) is
deferred to a follow-up. The only CI hook needed for this PR is the prek
`insert-license` exclude for `ts-sdk/src/generated/`, which is in the diff.
- **Generated files** (`src/generated/edge.ts`, `execution.ts`) are produced
by
`openapi-typescript` from the YAML/JSON specs in `airflow-core/docs/_api/`.
Committed (not generated at install time) so the diff is reviewable —
matches `ui/openapi-gen/` precedent.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.7)
Generated-by: Claude Code (Opus 4.7) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]