Skip to content

Comments

Add task queue guidance documentation#194

Open
bchav wants to merge 1 commit intomainfrom
docs/twd-architecture-diagram
Open

Add task queue guidance documentation#194
bchav wants to merge 1 commit intomainfrom
docs/twd-architecture-diagram

Conversation

@bchav
Copy link

@bchav bchav commented Jan 28, 2026

Summary

  • Adds docs/task-queues.md explaining the relationship between TemporalWorkerDeployment and Task Queues
  • Documents the recommended pattern of one TWD per Task Queue
  • Includes FAQ addressing common questions

Why

Users are asking whether a single TWD can handle multiple Task Queues, or if each TWD should map to a single worker instance. This doc clarifies:

  • Task Queue is defined in application code, not the TWD spec
  • One TWD per Task Queue is recommended for independent scaling and rollouts
  • When multiple queues per TWD might be acceptable

Checklist

  • Follows existing docs structure and style
  • Includes practical YAML examples
  • Links to related concepts (TemporalConnection)

🤖 Generated with Claude Code

@bchav bchav requested review from a team and jlegrone as code owners January 28, 2026 17:21
Explains the relationship between TemporalWorkerDeployment and Task Queues.
Multiple task queues can be grouped in a single TWD by running multiple
containers (each polling one queue) in the same pod. Splitting into
separate TWDs is an optimization when queues have different scaling
requirements or deployment cadences.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bchav bchav force-pushed the docs/twd-architecture-diagram branch from 183f4f2 to 1a88982 Compare January 29, 2026 17:23
└──────────────────────────────────────────────────────────────────┘
```

> **Note:** Each worker process polls exactly one Task Queue. To handle multiple queues, run multiple containers.
Copy link
Collaborator

Choose a reason for hiding this comment

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

From the controller perspective, it's totally fine to handle multiple queues within the same container though. If there are other reasons someone wants to separate pollers of different task queues into different containers, they're free to do that, but I can't think of a compelling benefit.

If different workers have different resource requirements or scaling requirements, they need to be put into different Deployments anyway.


Consider creating separate TemporalWorkerDeployment resources when Task Queues have:

**Different scaling requirements** - One queue may need 10 replicas while another needs 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This guidance makes sense to me given the current state of the controller.

Someday I'd like to see the controller support creating multiple Deployments with the same Version, so that people can have multiple task queues in the same version, with workers scaled separately. I don't think we should block GA or AutoScaling on that though, so it will just have to come later I suppose

value: "notifications"
```

**Different deployment cadences** - You want to roll out changes to one queue without affecting others, or test changes on a low-risk queue before rolling to critical queues.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the best reason to put your worker and task queue in a separate TWD. I'd love to live in a world some day where the only reason to separate your workers is because you want to deploy and version them separately (not just because you want to scale them separately)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants