feat(temporal): support per-node-type taskQueue routing - #142
Open
tbrandenburg wants to merge 1 commit into
Open
tbrandenburg wants to merge 1 commit into
tbrandenburg wants to merge 1 commit into
Conversation
tbrandenburg
requested review from
librowski,
lukasz-jazwa,
piotrblaszczyk and
szymon-t-sc
as code owners
September 14, 2026 09:43
Author
|
Ran the full
Happy to answer questions or make changes based on review. |
tbrandenburg
pushed a commit
to tbrandenburg/workflowbuilder
that referenced
this pull request
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues fixed
Closes #141 — Support per-node-type activity worker routing (dedicated Docker images/tools per node type)
Summary
Adds an optional
taskQueuefield to the per-node-typeActivityProfile, so a specific node type's activity can be pinned to a non-default Temporal task queue and served by a dedicated, minimal worker process/Docker image — while every other node type keeps running exactly as today on the shared worker. Fully additive/backward-compatible: notaskQueuein a profile means the current behavior.Changes:
packages/temporal:ActivityProfile.taskQueue?: string, validated (non-empty string) inprofile-validation.ts, forwarded byresolveFromValidatedProfilesinto the options handed toproxyActivities(only when present). AddedfindProfilesWithUnpolledTaskQueue, the worker-side check for a profile routed to a queue nobody polls (mirrors the existingfindProfilesWithoutExecutor).apps/execution-worker: new activity-only entrypointspecialized-worker.ts(noworkflowsPath) that registers only the AI-agent executor as the illustrative "needs its own image" example, polling a newSPECIALIZED_TASK_QUEUE.deploy/ai-studio: newworker-specializedcompose service reusing the existingruntimeimage/target with its own command and env — no new Dockerfile stage needed since the specialized worker is still plain TS on the same base image.packages/temporal,apps/execution-worker,deploy/ai-studio.No changes to
runGraph, the graph interpreter, the UI, the DB schema, or the backend — purely a worker-topology/deployment change, per the issue's non-goals.Validation commands run
pnpm build:temporalpnpm -F @workflowbuilder/temporal test— 9 files / 92 tests passedpnpm -F @workflowbuilder/temporal typecheck/lint— cleanpnpm -F execution-worker typecheck/lint/test— clean, 3 files / 10 tests passedpnpm exec prettier --check packages/temporal apps/execution-worker deploy/ai-studio— cleanpnpm test(full monorepo, all workspaces) — all passingE2E coverage
packages/temporal/test/task-queue-routing.test.tsis a real end-to-end test: it spins up a realTestWorkflowEnvironment(real embedded Temporal server, no mocks), runs an actual workflow with a node profile carryingtaskQueue, and asserts against the real recorded Event History that theActivityTaskScheduledcommand for that node names the specialized queue rather than the workflow's default queue.Risks / follow-ups
findProfilesWithUnpolledTaskQueueis exported but not auto-wired intoWorkflowBuilderPlugin's constructor (unlikefindProfilesWithoutExecutor), since that would require the plugin to know about every queue in a multi-worker deployment. Left as a standalone check a consumer calls explicitly — documented in the package README.worker-specializedandspecialized-worker.tsare illustrative reference implementations (routesai-studio/ai-agentas the example specialized node type); no node type in this app is actually configured withtaskQueuetoday, so the service idles until an app opts a node type in vianodeActivityProfiles.