Skip to content

Go SDK: Dag/Task specs and downstream wiring in the authoring API#67155

Draft
jason810496 wants to merge 3 commits into
apache:mainfrom
jason810496:refactor/go-sdk/dag-authoring-api
Draft

Go SDK: Dag/Task specs and downstream wiring in the authoring API#67155
jason810496 wants to merge 3 commits into
apache:mainfrom
jason810496:refactor/go-sdk/dag-authoring-api

Conversation

@jason810496
Copy link
Copy Markdown
Member

@jason810496 jason810496 commented May 19, 2026

On hold until "Defining Dag in foreign language" out.

Why

The Go authoring API today exposes AddDag(name) and AddTask(fn)
with no way to set the things a real DAG needs — schedule, tags,
queue, retries, or downstream relationships — so any non-trivial Go
DAG has to reach around the registry. This PR adds the missing
configuration surface and the downstream argument so users can author
multi-task DAGs in pure Go without escape hatches.

What

  • bundlev1/registry.go: AddDag now takes an optional DagSpec
    (schedule, description, tags, etc.) and AddTask now takes an
    optional TaskSpec (queue, retries, …) plus a downstream task-id
    list. The registry materialises both into the serialised DAG so the
    coordinator sees the same shape Python sees.
  • pkg/execution/serde.go learns to encode the new spec fields and
    downstream edges into Airflow's task/DAG payload.
  • Example bundle (example/bundle/main.go) updates to the new
    signatures so it doubles as a worked example of the API.
  • Tests: registry_test.go, serde_test.go, integration_test.go,
    and worker/runner_test.go cover the new spec/downstream paths.

Next


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

- Add `messages_test.go` to test message decoding and encoding functionalities.
- Introduce `serde.go` for serialization of various data types to Airflow's format.
- Create `serde_test.go` to validate serialization logic and ensure correctness.
- Implement `server.go` to handle communication with the supervisor and manage task execution.
- Add `task_runner.go` to execute tasks based on received startup details and handle success/failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:go-sdk go-sdk Label to track work items for golang task sdk

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant