Skip to content

Send X-Databricks-Workspace-Id for workspace routing#216

Merged
Divyansh-db merged 2 commits into
mainfrom
workspace-id-routing-header
Jun 15, 2026
Merged

Send X-Databricks-Workspace-Id for workspace routing#216
Divyansh-db merged 2 commits into
mainfrom
workspace-id-routing-header

Conversation

@Divyansh-db

Copy link
Copy Markdown
Contributor

Summary

On unified Databricks hosts that serve multiple workspaces, the SDK sends a routing header so the gateway can dispatch each workspace-scoped request to the correct workspace. This PR switches that header from X-Databricks-Org-Id to X-Databricks-Workspace-Id.

Why

The Databricks platform is consolidating workspace addressing onto a single header, X-Databricks-Workspace-Id, which accepts a broader range of workspace identifier formats (the server disambiguates). The previous header continues to be accepted by the platform, so older SDK versions keep working; new versions should send the new name. This brings the JS SDK in line with the same migration already shipped in the Go SDK (databricks/databricks-sdk-go#1688).

What changed

Interface changes

None. The workspace ID still comes from the same configuration field — workspaceId on ClientOptions, the workspace_id profile key, and the DATABRICKS_WORKSPACE_ID environment variable — unchanged in name and type (string).

Behavioral changes

Workspace-scoped requests now carry X-Databricks-Workspace-Id: <workspaceId> instead of X-Databricks-Org-Id: <workspaceId> when a workspace ID is configured. Account-scoped requests are unaffected — they send no routing header. The configured value may now be either a classic numeric workspace ID or another workspace identifier format the server understands; the docs for ClientOptions.workspaceId and the workspaceId profile field are widened to note this.

Internal changes

The header literal is emitted by the SDK generator, so the bulk of this PR is regenerated client output: a mechanical rename across 74 generated client.ts files (774 occurrences) with no logic change, isolated in the first commit. The second commit updates the hand-written docs, the profile-client example, and its test.

How is this tested?

npm run build, npm run format:check, npm run lint, npm run typecheck, npm test, and npm run test:browser all pass. The profile-client example test asserts the outgoing request carries X-Databricks-Workspace-Id set to the configured (non-numeric) workspace ID.

This pull request and its description were written by Isaac.

…clients

Regenerated client output: workspace-scoped methods now set the X-Databricks-Workspace-Id header instead of X-Databricks-Org-Id. Mechanical rename across 74 generated client.ts files (774 occurrences); no logic change.

Co-authored-by: Isaac
Signed-off-by: Divyansh Vijayvergia <divyansh.vijayvergia@databricks.com>
Reflect the X-Databricks-Workspace-Id rename in hand-written code:
- options: ClientOptions.workspaceId doc names the new header and notes the value may be a classic numeric workspace ID or another workspace identifier format the server understands.
- core: Profile.workspaceId doc widened with the same note.
- examples: profile-client comment and its test assertion updated.

Co-authored-by: Isaac
Signed-off-by: Divyansh Vijayvergia <divyansh.vijayvergia@databricks.com>
@github-actions

Copy link
Copy Markdown

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

@Divyansh-db Divyansh-db requested a review from parthban-db June 15, 2026 12:57
@Divyansh-db Divyansh-db added this pull request to the merge queue Jun 15, 2026
Merged via the queue into main with commit f02e967 Jun 15, 2026
44 of 45 checks passed
@Divyansh-db Divyansh-db deleted the workspace-id-routing-header branch June 15, 2026 13:26
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