Skip to content

TS SDK: support logicalDate and runAfter in triggerDagRun #74414

Open

Description

@jason810496

Description

triggerDagRun in the TypeScript SDK always triggers the run with the current time as its logical_date, and has no way to set run_after. Python's TriggerDagRunOperator takes both:

  • logical_date: the logical date of the triggered run, or no logical date at all.
  • run_after: when the triggered run may start.

Its generated run_id also depends on them: manual__<isoformat(run_after or logical_date)>, plus a random 8-character suffix when the run has no logical date.

The Go SDK runtime runner for airflow.TriggerDagRun keeps both options, as LogicalDate time.Time (zero means now) and RunAfter, following Python. The TypeScript SDK should offer the same, so a native Dag triggers runs the same way in every Lang SDK:

dag.task(triggerDagRun({
  dagId: "report",
  logicalDate: new Date("2026-10-01T00:00:00Z"), // new
  runAfter: new Date("2026-10-01T06:00:00Z"),    // new
}), { taskId: "trigger_report" });

Scope

  • TriggerDagRunSpec gains logicalDate?: Date | null and runAfter?: Date.
  • trigger-runner.ts follows TriggerDagRunOperator.execute for both, including the run_id rules and sending run_after only when it is set.
  • Like the other options, the values are sent as written, with no Jinja rendering (ADR-0008).

Related

  • ts-sdk/src/sdk/trigger-dag-run.ts, ts-sdk/src/coordinator/trigger-runner.ts
  • airflow-core/adr/lang-sdk/0008-control-flow-constructs.md

Drafted-by: Claude Code (Opus 5.5) (no human review before posting)

Activity

  1. harshitsaxena214 commented on Oct 7, 2026

    @harshitsaxena214

    Hi @jason810496, I'd like to work on this one. Could you assign it to me?

    My plan:

    • Types: add logicalDate?: Date | null and runAfter?: Date to TriggerDagRunSpec. Omitting logicalDate keeps today's behavior (current time), null means no logical date, and runAfter is only sent when set.
    • Runner: update trigger-runner.ts to follow TriggerDagRunOperator.execute. That means ISO-serializing both values, sending run_after only when present, and building run_id as manual__<isoformat(run_after or logical_date)>, with a random 8-char suffix when there's no logical date. No Jinja rendering, per ADR-0008.
    • Tests: cover the default (unchanged) behavior, logicalDate as a date, null and omitted, runAfter set and unset, and the run_id rules for each combination.
    • Docs: update the doc comments and SDK docs with the example from the issue.

    I'll also compare against the Go SDK runner so the two stay consistent. Happy to adjust anything once I'm assigned and start the PR.

  2. Davda-James commented on Oct 10, 2026

    @Davda-James

    PR-74543 @jason810496 I had opened PR for this change, pls review it whenever u get a chance and pls let me know if any changes in implementation is required . (I had taken reference from the implementation of go and python to write this change in ts-sdk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions