Skip to content

TS SDK: Add triggerDagRun to native Dags - #74071

Merged
jason810496 merged 1 commit into
apache:mainfrom
guan404ming:ts-sdk-trigger-dag-run
Oct 7, 2026
Merged

jason810496 merged 1 commit into
apache:mainfrom
guan404ming:ts-sdk-trigger-dag-run

Conversation

@guan404ming

@guan404ming guan404ming commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Related

Why

  • TypeScript Dags cannot trigger another Dag's run yet.
  • Go adds a trigger task as an ordinary task, so TypeScript should too.

How

  • Add dag.task(triggerDagRun(spec), { taskId })(), mirroring Go's dag.Task(airflow.TriggerDagRun(spec), ...).
  • Run the trigger in the TypeScript runtime, with waitForCompletion and deferrable support.
  • Record the triggered Dag as a dependency and add the "Triggered DAG" link.

Was generative AI tooling used to co-author this PR?

@guan404ming guan404ming changed the title TS SDK: Add triggerDagRun as a dag.task body, as Go does TS SDK: Add triggerDagRun as a dag.task body Oct 2, 2026
@guan404ming
guan404ming force-pushed the ts-sdk-trigger-dag-run branch 4 times, most recently from 4ba6faa to 69b2f9b Compare October 2, 2026 07:47
@guan404ming guan404ming changed the title TS SDK: Add triggerDagRun as a dag.task body TS SDK: Add triggerDagRun to native Dags Oct 2, 2026
@guan404ming
guan404ming marked this pull request as ready for review October 2, 2026 07:55

@jason810496 jason810496 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, LGTM overall, here're some findings by claude review that make sense to me.
Not all of them are blocking comments.

Rest of the SDKs (Java and Go) should follow this PR to implement the trigger DagRun runtime to ensure the consistent behavior.

Comment thread ts-sdk/src/coordinator/serde.ts
Comment thread ts-sdk/src/sdk/dag.ts Outdated
Comment thread ts-sdk/src/coordinator/serde.ts Outdated
Comment thread ts-sdk/src/coordinator/serde.ts Outdated
Comment thread ts-sdk/src/sdk/trigger-dag-run.ts Outdated
Comment thread ts-sdk/src/sdk/trigger-dag-run.ts Outdated
Comment thread ts-sdk/src/coordinator/client.ts
Comment thread ts-sdk/src/coordinator/trigger-runner.ts Outdated
Comment thread ts-sdk/src/coordinator/trigger-runner.ts Outdated
Comment thread ts-sdk/src/coordinator/serde.ts
@guan404ming
guan404ming force-pushed the ts-sdk-trigger-dag-run branch from 69b2f9b to 2ce1929 Compare October 6, 2026 15:23
@guan404ming

Copy link
Copy Markdown
Member Author

Thanks for the review! Addressed the doubled JSDoc openers, rpc() reuse, isPlainRecord reuse, Promise.all, and the TaskRecord union. Left the serialization loop for a follow-up as suggested.

@jason810496
jason810496 force-pushed the ts-sdk-trigger-dag-run branch from 2ce1929 to 4fba955 Compare October 7, 2026 02:50
@jason810496

Copy link
Copy Markdown
Member

Just a head up, I will force push this PR as I just merge #74070.

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
@jason810496
jason810496 force-pushed the ts-sdk-trigger-dag-run branch from 4fba955 to af5d485 Compare October 7, 2026 05:07
@jason810496
jason810496 merged commit 202fe70 into apache:main Oct 7, 2026
87 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants