@camunda8/orchestration-cluster-api 10.0.0-alpha.3 → 10.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,231 @@
1
+ # [10.0.0-alpha.30](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.29...v10.0.0-alpha.30) (2026-08-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * **examples:** add coverage for 7 cluster-admin backup/exporting ops ([#442](https://github.com/camunda/orchestration-cluster-api-js/issues/442)) ([fdc805d](https://github.com/camunda/orchestration-cluster-api-js/commit/fdc805d2877e02b3cb7c89038e05ac9325d76c6a)), closes [#429](https://github.com/camunda/orchestration-cluster-api-js/issues/429) [#441](https://github.com/camunda/orchestration-cluster-api-js/issues/441)
7
+
8
+ # [10.0.0-alpha.29](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.28...v10.0.0-alpha.29) (2026-08-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * add example coverage for restoreAsClusterAdmin, getClusterTopology ([#433](https://github.com/camunda/orchestration-cluster-api-js/issues/433)) ([fab79dc](https://github.com/camunda/orchestration-cluster-api-js/commit/fab79dc97b29c9dcc0c95f30833c832c690a0d6a)), closes [#432](https://github.com/camunda/orchestration-cluster-api-js/issues/432)
14
+
15
+ # [10.0.0-alpha.28](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.27...v10.0.0-alpha.28) (2026-08-14)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **examples:** group plannedChanges by physical tenant ([d494ce7](https://github.com/camunda/orchestration-cluster-api-js/commit/d494ce716fa83a6ef4d406dd77d9e0ffc0797f35))
21
+ * **examples:** group plannedChanges by physical tenant ([525c176](https://github.com/camunda/orchestration-cluster-api-js/commit/525c1760c6f9fe6f7ef0efb06fd6eefa95f2cc8d))
22
+
23
+
24
+ ### Features
25
+
26
+ * **examples:** add cluster admin and history backup example coverage ([185071c](https://github.com/camunda/orchestration-cluster-api-js/commit/185071c9a62eb7d8cf24f903ca36d66342c4e2bf))
27
+
28
+ # [10.0.0-alpha.27](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.26...v10.0.0-alpha.27) (2026-08-12)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * mark agent-definition test scaffolds as todo with void unused local ([5ec2940](https://github.com/camunda/orchestration-cluster-api-js/commit/5ec2940b008314794b3f2a2263fa5f57d07a1ca8))
34
+ * use it.skip instead of it.todo with a callback in test scaffolds ([f96e189](https://github.com/camunda/orchestration-cluster-api-js/commit/f96e189710b86fe4ecc414803d1bed507a89626f))
35
+
36
+
37
+ ### Features
38
+
39
+ * add example coverage for getAgentDefinition, searchAgentDefinitions ([e596713](https://github.com/camunda/orchestration-cluster-api-js/commit/e5967130f963939762d6ccf7508fac94e0c2fe76))
40
+ * **examples:** add agent definition examples for getAgentDefinition and searchAgentDefinitions ([d613ac1](https://github.com/camunda/orchestration-cluster-api-js/commit/d613ac1069dbb253c6a91f900cb39ee94cef1eb7))
41
+
42
+ # [10.0.0-alpha.26](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.25...v10.0.0-alpha.26) (2026-08-10)
43
+
44
+
45
+ ### Features
46
+
47
+ * **examples:** add searchOwnAuthorizations example coverage ([a3749c3](https://github.com/camunda/orchestration-cluster-api-js/commit/a3749c392e725957ad22d7627b2161a6a4866165))
48
+
49
+ # [10.0.0-alpha.25](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.24...v10.0.0-alpha.25) (2026-08-04)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **runtime:** back off job-worker activation retries on transport errors ([#411](https://github.com/camunda/orchestration-cluster-api-js/issues/411)) ([bccaabe](https://github.com/camunda/orchestration-cluster-api-js/commit/bccaabeffc995b30fcb83488538928e57c8de953))
55
+
56
+ # [10.0.0-alpha.24](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.23...v10.0.0-alpha.24) (2026-08-04)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * **client:** reject transport errors regardless of throwOnError ([c1df143](https://github.com/camunda/orchestration-cluster-api-js/commit/c1df143fb001e7b2fb3e928c9c218e52b400a5e1)), closes [#405](https://github.com/camunda/orchestration-cluster-api-js/issues/405)
62
+ * remaining regressions from the @hey-api/openapi-ts 0.86.12 to 0.99.0 upgrade ([37d00cd](https://github.com/camunda/orchestration-cluster-api-js/commit/37d00cd8211af5938fb1ed5ae3320fe25b837a68))
63
+ * **types:** restore discriminators on JobResult and runtime instructions ([dcdf450](https://github.com/camunda/orchestration-cluster-api-js/commit/dcdf450a9ad6182ee6afdd5d5d12ab68b4a19253)), closes [#405](https://github.com/camunda/orchestration-cluster-api-js/issues/405)
64
+ * **validation:** validate path and query params, not just the request body ([5bc2c56](https://github.com/camunda/orchestration-cluster-api-js/commit/5bc2c56d92508cebef7bb43e04494d2f3972679e)), closes [#405](https://github.com/camunda/orchestration-cluster-api-js/issues/405)
65
+
66
+ # [10.0.0-alpha.23](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.22...v10.0.0-alpha.23) (2026-08-03)
67
+
68
+
69
+ ### Bug Fixes
70
+
71
+ * **ci:** align the agent verify gate with the CI gates ([957083c](https://github.com/camunda/orchestration-cluster-api-js/commit/957083c96e14ad9012a5514f59ef0e147a1a4eba))
72
+ * **ci:** fail closed when the verify gate is empty ([35c6f05](https://github.com/camunda/orchestration-cluster-api-js/commit/35c6f059b021a4f688795e21994c9d9bac18da7c))
73
+ * **ci:** stop interpolating the issue body into an unquoted heredoc ([631ee22](https://github.com/camunda/orchestration-cluster-api-js/commit/631ee22057402027b543fe91904c561f2826b303))
74
+ * **ci:** tell the agent which commands actually gate its work ([de6e466](https://github.com/camunda/orchestration-cluster-api-js/commit/de6e4661794c6e3e2d80a7cf72efba76098c13f2))
75
+
76
+ # [10.0.0-alpha.22](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.21...v10.0.0-alpha.22) (2026-08-02)
77
+
78
+
79
+ ### Bug Fixes
80
+
81
+ * **runtime:** reject transport errors instead of silently swallowing them ([#406](https://github.com/camunda/orchestration-cluster-api-js/issues/406)) ([3f84418](https://github.com/camunda/orchestration-cluster-api-js/commit/3f844183442649cfe2a8b8673e3c819b81337553)), closes [#405](https://github.com/camunda/orchestration-cluster-api-js/issues/405)
82
+
83
+ # [10.0.0-alpha.21](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.20...v10.0.0-alpha.21) (2026-08-02)
84
+
85
+
86
+ ### Bug Fixes
87
+
88
+ * **worker:** buffer start() until the transport is ready ([ad4d37f](https://github.com/camunda/orchestration-cluster-api-js/commit/ad4d37f6eeadffb89532af351bd80d404ffc2fde))
89
+ * **worker:** buffer start() until the transport is ready ([708b544](https://github.com/camunda/orchestration-cluster-api-js/commit/708b544f79ffec9ef9060de0dea21ac8ecb2b207)), closes [#401](https://github.com/camunda/orchestration-cluster-api-js/issues/401)
90
+
91
+ # [10.0.0-alpha.20](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.19...v10.0.0-alpha.20) (2026-08-02)
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * **runtime:** keep node:worker_threads out of the public type surface ([685ee15](https://github.com/camunda/orchestration-cluster-api-js/commit/685ee15d86982251eb2c02ec3c01d809fc2eb9a9))
97
+
98
+ # [10.0.0-alpha.19](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.18...v10.0.0-alpha.19) (2026-07-31)
99
+
100
+
101
+ ### Features
102
+
103
+ * add example coverage for getClusterStatus, getRestoreStatus ([ef02297](https://github.com/camunda/orchestration-cluster-api-js/commit/ef02297ee69b1da3346457ff12bbc82c12785332))
104
+ * **examples:** add getClusterStatus and getRestoreStatus examples ([b633b00](https://github.com/camunda/orchestration-cluster-api-js/commit/b633b00f71c4960b5620c56bc109cb41c527213e))
105
+
106
+ # [10.0.0-alpha.18](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.17...v10.0.0-alpha.18) (2026-07-27)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * **gen:** derive semantic-key namespace helper types from alias primitive ([8889015](https://github.com/camunda/orchestration-cluster-api-js/commit/8889015ffc6ef4ec826c1379223ae5eb1465a8fd))
112
+ * **gen:** derive semantic-key namespace helper types from alias primitive ([db969a5](https://github.com/camunda/orchestration-cluster-api-js/commit/db969a51a1a334e0ed0cc2e63868aae161c08054))
113
+
114
+ # [10.0.0-alpha.17](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.16...v10.0.0-alpha.17) (2026-07-27)
115
+
116
+
117
+ ### Bug Fixes
118
+
119
+ * **gen:** forward-compatible generation for @hey-api/openapi-ts 0.97 ([ef36a46](https://github.com/camunda/orchestration-cluster-api-js/commit/ef36a4654eedb7bae905bd56a0b4854d6bbe7ebc))
120
+ * **gen:** forward-compatible generation for @hey-api/openapi-ts 0.97 ([47c7713](https://github.com/camunda/orchestration-cluster-api-js/commit/47c77131da1b51dffebd4745913252697169e5ff))
121
+
122
+ # [10.0.0-alpha.16](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.15...v10.0.0-alpha.16) (2026-07-27)
123
+
124
+
125
+ ### Bug Fixes
126
+
127
+ * **gen:** forward-compatible generation hooks for @hey-api/openapi-ts 0.96 ([2025d83](https://github.com/camunda/orchestration-cluster-api-js/commit/2025d8382d1a922c3bacd0ee946a57c551473270))
128
+ * **gen:** forward-compatible generation hooks for @hey-api/openapi-ts 0.96 ([cb1bddd](https://github.com/camunda/orchestration-cluster-api-js/commit/cb1bdddf72eb44abf35dcbc243fac19adbc52013))
129
+
130
+ # [10.0.0-alpha.15](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.14...v10.0.0-alpha.15) (2026-07-02)
131
+
132
+
133
+ ### Bug Fixes
134
+
135
+ * change default CAMUNDA_SDK_LOG_LEVEL from 'error' to 'info' ([839b7ab](https://github.com/camunda/orchestration-cluster-api-js/commit/839b7abb95fee0e7802980802aa1117b2473486c)), closes [#274](https://github.com/camunda/orchestration-cluster-api-js/issues/274)
136
+
137
+ # [10.0.0-alpha.14](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.13...v10.0.0-alpha.14) (2026-07-01)
138
+
139
+
140
+ ### Features
141
+
142
+ * add example coverage for getProcessInstanceWaitStateStatistics ([9fa53ca](https://github.com/camunda/orchestration-cluster-api-js/commit/9fa53ca512a266ed29b23ceec6ccc9199240e4c8)), closes [camunda/orchestration-cluster-api-js#300](https://github.com/camunda/orchestration-cluster-api-js/issues/300)
143
+
144
+ # [10.0.0-alpha.13](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.12...v10.0.0-alpha.13) (2026-06-28)
145
+
146
+
147
+ ### Bug Fixes
148
+
149
+ * **client:** make generated fetch client work on Deno and Bun ([9260000](https://github.com/camunda/orchestration-cluster-api-js/commit/92600004f344a41d7ea5a5158484a98a440c2be3))
150
+ * **client:** sanitize SSE onRequest init and harden the compat hook ([12eff25](https://github.com/camunda/orchestration-cluster-api-js/commit/12eff25fadac6ce45ca28f2c469ccdeb878bf98d))
151
+
152
+ # [10.0.0-alpha.12](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.11...v10.0.0-alpha.12) (2026-06-18)
153
+
154
+
155
+ ### Features
156
+
157
+ * regenerate src/gen for wait-state details union and job priority-updated state ([e0e8c8c](https://github.com/camunda/orchestration-cluster-api-js/commit/e0e8c8c7e30b88799ec17f1c061a21241648ee7d))
158
+ * regenerate src/gen for wait-state details union and job priority-updated state ([76c5f82](https://github.com/camunda/orchestration-cluster-api-js/commit/76c5f829efcf826ff180e3116c4bbf303254c2b6))
159
+
160
+ # [10.0.0-alpha.11](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.10...v10.0.0-alpha.11) (2026-06-11)
161
+
162
+
163
+ ### Bug Fixes
164
+
165
+ * adopt upstream wait-state details union in example ([8f8603c](https://github.com/camunda/orchestration-cluster-api-js/commit/8f8603cd1ed445ab8062c15d525598a5c36084d4))
166
+ * adopt upstream wait-state details union in example ([07ed89c](https://github.com/camunda/orchestration-cluster-api-js/commit/07ed89c0eb2db17f7979ebd57c88983f8561a137))
167
+
168
+ # [10.0.0-alpha.10](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.9...v10.0.0-alpha.10) (2026-06-09)
169
+
170
+
171
+ ### Bug Fixes
172
+
173
+ * apply eventual consistency only to first searchVariablesAsDto search ([29387b0](https://github.com/camunda/orchestration-cluster-api-js/commit/29387b0b478e0c9a4d1dd0eaaf82c0481be5ddd8))
174
+ * **deps:** bump camunda-schema-bundler to 2.4.3 for IterationId generation ([16a7c5d](https://github.com/camunda/orchestration-cluster-api-js/commit/16a7c5ddccc52b60b0dab3efc6048daaba687013))
175
+ * **deps:** bump camunda-schema-bundler to 2.4.3 for IterationId generation ([8a8cdae](https://github.com/camunda/orchestration-cluster-api-js/commit/8a8cdae5fe9327a991e9670e4aeb50c6d8591356))
176
+ * wait for all declared variables at the collection level for searchVariablesAsDto ([ba2f911](https://github.com/camunda/orchestration-cluster-api-js/commit/ba2f911e1d6254d25ac68c3ebfaa690ef0d9067a))
177
+
178
+
179
+ ### Features
180
+
181
+ * add searchVariablesAsDto for DTO-driven typed variable maps ([52a544f](https://github.com/camunda/orchestration-cluster-api-js/commit/52a544fcc37f7ecc86fcfa153859baf6cf653b9b))
182
+ * add searchVariablesAsDto for DTO-driven typed variable maps ([67418f2](https://github.com/camunda/orchestration-cluster-api-js/commit/67418f2f9ccbdc8b535b82cb8a66ec77b66143e0))
183
+
184
+ # [10.0.0-alpha.9](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.8...v10.0.0-alpha.9) (2026-06-04)
185
+
186
+
187
+ ### Bug Fixes
188
+
189
+ * pass author-association to community notification workflow ([82e7f6e](https://github.com/camunda/orchestration-cluster-api-js/commit/82e7f6e5b34c60d122b93a302c84dda1fc28f6f9))
190
+
191
+ # [10.0.0-alpha.8](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.7...v10.0.0-alpha.8) (2026-06-04)
192
+
193
+
194
+ ### Features
195
+
196
+ * add Slack notifications for release failures and community events ([051e782](https://github.com/camunda/orchestration-cluster-api-js/commit/051e78230ce2a2eeda53bdc604a99a783e4b5caa))
197
+ * add Slack notifications for release failures and community events ([2981264](https://github.com/camunda/orchestration-cluster-api-js/commit/29812649034d2e961d65a7a80bd8bb2590e77dc1))
198
+
199
+ # [10.0.0-alpha.7](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.6...v10.0.0-alpha.7) (2026-05-18)
200
+
201
+
202
+ ### Bug Fixes
203
+
204
+ * update docker-compose env vars for 8.10 config schema ([d343d56](https://github.com/camunda/orchestration-cluster-api-js/commit/d343d56a54d6b83246e3a2b26b6ce2469c2de77c))
205
+
206
+ # [10.0.0-alpha.6](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.5...v10.0.0-alpha.6) (2026-05-13)
207
+
208
+
209
+ ### Features
210
+
211
+ * add example coverage for 4 new operations ([3a2c875](https://github.com/camunda/orchestration-cluster-api-js/commit/3a2c87577bcca87996cc77546216c68fb5124ec5))
212
+ * add example coverage for 4 new operations ([6d757a4](https://github.com/camunda/orchestration-cluster-api-js/commit/6d757a4be85ba733f07bcd08c1b6ae33aacd6c15))
213
+
214
+ # [10.0.0-alpha.5](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.4...v10.0.0-alpha.5) (2026-05-08)
215
+
216
+
217
+ ### Features
218
+
219
+ * add agent instance example coverage ([8a0072d](https://github.com/camunda/orchestration-cluster-api-js/commit/8a0072d03cf426ea895863d7cbdd87178c2e7e2f))
220
+ * v10 migration — bundler 2.4.1, branded type examples, README ([dd4a714](https://github.com/camunda/orchestration-cluster-api-js/commit/dd4a7149682b89d1f8f9c0f627dfef5645b10ea7)), closes [#203](https://github.com/camunda/orchestration-cluster-api-js/issues/203) [#204](https://github.com/camunda/orchestration-cluster-api-js/issues/204)
221
+
222
+ # [10.0.0-alpha.4](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.3...v10.0.0-alpha.4) (2026-04-29)
223
+
224
+
225
+ ### Bug Fixes
226
+
227
+ * **gen:** apply CAMUNDA_DEFAULT_TENANT_ID to activateJobs tenantIds ([fb7c661](https://github.com/camunda/orchestration-cluster-api-js/commit/fb7c661ba1f24dcfcfd738c6e344df09a2e2c52d))
228
+
1
229
  # [10.0.0-alpha.3](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.2...v10.0.0-alpha.3) (2026-04-29)
2
230
 
3
231
 
package/README.md CHANGED
@@ -149,10 +149,51 @@ await camunda.createDeployment({
149
149
  });
150
150
  ```
151
151
 
152
- `TenantId.assumeExists()` validates the string against the tenant ID pattern and brands it at zero runtime cost. See [Branded Keys](#branded-keys) for more on this pattern.
152
+ `TenantId.assumeExists()` validates the string against the tenant ID pattern and returns a branded value. The branded value is just a string at runtime, but `assumeExists()` performs validation and can throw if the input is malformed. See [Branded Keys](#branded-keys) for more on this pattern.
153
153
 
154
154
  > **Tip**: If your tenant ID comes from a validated source (environment variable, config file), call `TenantId.assumeExists()` once at startup and pass the branded value throughout your application.
155
155
 
156
+ ## Migrating from 8.9
157
+
158
+ SDK 10.x (for Camunda 8.10) promotes several identifier and name fields from plain `string` to **branded types** via `CamundaKey<T>`. The wire format and runtime API are unchanged — branded values are still plain strings at runtime and are assignable anywhere a `string` is expected (template literals, logging, JSON serialization). Callers need to brand values using `.assumeExists()` (which performs validation) to satisfy the new types.
159
+
160
+ ### New branded types
161
+
162
+ | Brand | Used for |
163
+ |-------|----------|
164
+ | `RoleId` | Role identifiers |
165
+ | `GroupId` | Group identifiers |
166
+ | `ClientId` | OAuth client identifiers |
167
+ | `MappingRuleId` | Mapping-rule identifiers |
168
+ | `ClusterVariableName` | Cluster variable names |
169
+ | `AgentInstanceKey` | Agent-instance system keys |
170
+
171
+ ### Migration
172
+
173
+ <!-- snippet-source: examples/readme.ts | regions: V9ToV10Migration -->
174
+
175
+ ```ts
176
+ // v9 — plain strings were accepted
177
+ // await camunda.assignRoleToGroup({
178
+ // roleId: 'developer',
179
+ // groupId: 'engineering',
180
+ // });
181
+
182
+ // v10 — use the branded type helpers at the boundary
183
+ await camunda.assignRoleToGroup({
184
+ roleId: RoleId.assumeExists('developer'),
185
+ groupId: GroupId.assumeExists('engineering'),
186
+ });
187
+ ```
188
+
189
+ Each branded type has an `.assumeExists()` method that validates the string and returns the branded value. Validation runs at call time and can throw if the input is malformed, so call it once at the boundary (startup, config parsing, API response) and pass the branded value through your application. See [Branded Keys](#branded-keys) for more on this pattern.
190
+
191
+ ### What does NOT change
192
+
193
+ - The wire format is unchanged — all values are still strings on the wire.
194
+ - No method signatures changed name or arity.
195
+ - Branded values are assignable anywhere a `string` is expected (template literals, logging, JSON serialization), so existing string-handling code continues to work.
196
+
156
197
  ## Quick Start (Zero‑Config – Recommended)
157
198
 
158
199
  Keep configuration out of application code. Let the factory read `CAMUNDA_*` variables from the environment (12‑factor style). This makes rotation, secret management, and environment promotion safer & simpler.
@@ -576,6 +617,41 @@ Benchmark results against a single-node local cluster with multiple independent
576
617
 
577
618
  BALANCED wins 3 of 4 on pure throughput. The only scenario where LEGACY is faster is extreme overload (800 concurrent requests against a single broker) — and in that case LEGACY accumulates 44,505 errors vs BALANCED's 15,527. The default just works.
578
619
 
620
+ ## Typed Variable Map (DTO-driven search)
621
+
622
+ `searchVariablesAsDto` fetches process variables and binds them to a [Zod](https://zod.dev) schema that acts as the DTO. The schema's keys are the exact variable names to fetch, and its shape drives validation. Only the declared variables are queried (via a `name $in [...]` filter), so memory stays bound by the DTO shape rather than the total number of variables on the instance. Results are paged internally until every declared variable is found or the result set is exhausted.
623
+
624
+ The returned `VariableMap` offers two access modes:
625
+
626
+ - **Lenient** — `has(name)` / `get(name)` for defensive reads that never throw on missing variables.
627
+ - **Strict** — `validate()` returns a fully-typed object, or throws a `ZodError` when a required variable is missing or malformed.
628
+
629
+ If a declared variable is found at more than one scope (for example a local variable shadowing a process-level one), the search throws a `VariableScopeCollisionError` rather than silently picking one. Pass an explicit `scopeKey` to disambiguate.
630
+
631
+ <!-- snippet-source: examples/readme.ts | regions: ReadmeTypedVariables -->
632
+
633
+ ```ts
634
+ // The Zod schema is the DTO: its keys are the variable names to fetch, and its
635
+ // shape drives validation. Only these declared variables are queried, so memory
636
+ // stays bound by the DTO — not by the total number of variables on the instance.
637
+ const OrderVariables = z.object({
638
+ orderId: z.string(), // required
639
+ amount: z.number().optional(), // optional
640
+ });
641
+
642
+ const map = await camunda.searchVariablesAsDto(OrderVariables, { processInstanceKey });
643
+
644
+ // Lenient access: defensive reads that never throw on missing variables.
645
+ if (map.has('amount')) {
646
+ console.log('Amount:', map.get('amount'));
647
+ }
648
+
649
+ // Strict access: returns a fully-typed object, or throws a ZodError when a
650
+ // required variable is missing or malformed.
651
+ const order = map.validate(); // { orderId: string; amount?: number }
652
+ console.log('Order:', order.orderId);
653
+ ```
654
+
579
655
  ## Job Workers (Polling API)
580
656
 
581
657
  The SDK provides a lightweight polling job worker for service task job types using `createJobWorker`. It activates jobs in batches (respecting a concurrency limit), validates variables (optional), and offers action helpers on each job.
@@ -681,6 +757,7 @@ Example patterns:
681
757
  return job.complete({ variables: { processed: true } });
682
758
 
683
759
  // GOOD: No-arg completion example, sentinel stored for ultimate return
760
+ // biome-ignore lint/correctness/noUnreachable: intentional — showing multiple completion patterns
684
761
  const ack = await job.complete();
685
762
  // ...
686
763
  return ack;