@zapier/zapier-sdk 0.89.0 → 0.91.0

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,5 +1,25 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.91.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5935b7e: Added `publishWorkflowDraft` (experimental) to publish an open workflow draft as a new immutable version.
8
+ - Publishing advances the workflow's live pointer and **discards the draft** — publish consumes it, so an open draft always means unpublished work. Returns both the new `version` and the consumed `draft` (`status: "discarded"`, `base_version_id` still recording the version it was forked from). Prefer it over `publishWorkflowVersion` once a draft exists, so the open draft is never orphaned; continue editing by creating a new draft off the new version.
9
+ - Accepts optional `enabled` (set the workflow's enabled state as part of the publish; preserved if omitted) and `draftRevision` (optimistic concurrency: publish exactly the revision last read).
10
+ - Failure modes stay distinct: a concurrent-edit or trigger-switchover conflict surfaces as `ZapierConflictError` (retryable after re-reading the draft), a trigger-catalog validation outage surfaces as a retryable 503 API error, and invalid `zapier_durable_version` or trigger config surfaces as a validation error.
11
+
12
+ ## 0.90.0
13
+
14
+ ### Minor Changes
15
+
16
+ - f6eac6f: Added `createWorkflowDraft`, `updateWorkflowDraft`, and `discardWorkflowDraft` (experimental), completing the draft lifecycle alongside the existing read methods.
17
+ - `createWorkflowDraft` forks a new draft from the workflow's live version, with an optional `slug`.
18
+ - `updateWorkflowDraft` saves draft edits — source files, dependencies, trigger, connections, and app-version pins. Pass `draftRevision` to reject the save with a `ZapierConflictError` if the draft changed since it was last read; pass `null` for `trigger`, `connections`, or `appVersions` to clear the stored value, or omit them to leave it unchanged.
19
+ - `discardWorkflowDraft` soft-deletes a draft and returns it with status `discarded`.
20
+
21
+ All ID inputs are UUID-validated at the boundary.
22
+
3
23
  ## 0.89.0
4
24
 
5
25
  ### Minor Changes
package/README.md CHANGED
@@ -29,8 +29,10 @@
29
29
  - [Code Workflows (Experimental)](#code-workflows-experimental)
30
30
  - [`cancelDurableRun`](#canceldurablerun--experimental)
31
31
  - [`createWorkflow`](#createworkflow--experimental)
32
+ - [`createWorkflowDraft`](#createworkflowdraft--experimental)
32
33
  - [`deleteWorkflow`](#deleteworkflow--experimental)
33
34
  - [`disableWorkflow`](#disableworkflow--experimental)
35
+ - [`discardWorkflowDraft`](#discardworkflowdraft--experimental)
34
36
  - [`enableWorkflow`](#enableworkflow--experimental)
35
37
  - [`getDurableRun`](#getdurablerun--experimental)
36
38
  - [`getTriggerRun`](#gettriggerrun--experimental)
@@ -43,10 +45,12 @@
43
45
  - [`listWorkflowRuns`](#listworkflowruns--experimental)
44
46
  - [`listWorkflowVersions`](#listworkflowversions--experimental)
45
47
  - [`listWorkflows`](#listworkflows--experimental)
48
+ - [`publishWorkflowDraft`](#publishworkflowdraft--experimental)
46
49
  - [`publishWorkflowVersion`](#publishworkflowversion--experimental)
47
50
  - [`runDurable`](#rundurable--experimental)
48
51
  - [`triggerWorkflow`](#triggerworkflow--experimental)
49
52
  - [`updateWorkflow`](#updateworkflow--experimental)
53
+ - [`updateWorkflowDraft`](#updateworkflowdraft--experimental)
50
54
  - [Connections](#connections)
51
55
  - [`createConnection`](#createconnection)
52
56
  - [`findFirstConnection`](#findfirstconnection)
@@ -1179,6 +1183,50 @@ const { data: workflow } = await zapier.createWorkflow({
1179
1183
  });
1180
1184
  ```
1181
1185
 
1186
+ #### `createWorkflowDraft` 🧪 _experimental_
1187
+
1188
+ Fork a new draft from the workflow's current live version (or a blank stub before the first publish)
1189
+
1190
+ **Parameters:**
1191
+
1192
+ | Name | Type | Required | Default | Possible Values | Description |
1193
+ | -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------- |
1194
+ | `options` | `object` | ✅ | — | — | |
1195
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1196
+ | ​ ↳ `slug` | `string` | ❌ | — | — | Optional slug for URL routing. When omitted, the server generates one. |
1197
+
1198
+ **Returns:** `Promise<WorkflowDraftItem>`
1199
+
1200
+ | Name | Type | Required | Possible Values | Description |
1201
+ | ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
1202
+ | `data` | `object` | ✅ | — | |
1203
+ | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1204
+ | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1205
+ | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1206
+ | ​ ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
1207
+ | ​ ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1208
+ | ​ ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
1209
+ | ​ ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
1210
+ | ​ ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
1211
+ | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1212
+ | ​ ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
1213
+ | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1214
+ | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1215
+ | ​ ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
1216
+ | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1217
+ | ​ ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
1218
+ | ​ ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
1219
+ | ​ ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
1220
+ | ​ ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
1221
+
1222
+ **Example:**
1223
+
1224
+ ```typescript
1225
+ const { data: workflowDraft } = await zapier.createWorkflowDraft({
1226
+ workflow: "example-workflow",
1227
+ });
1228
+ ```
1229
+
1182
1230
  #### `deleteWorkflow` 🧪 _experimental_
1183
1231
 
1184
1232
  Delete a durable workflow. Throws `ZapierNotFoundError` if the workflow doesn't exist; callers wanting idempotency should catch that themselves.
@@ -1232,6 +1280,51 @@ const { data: workflow } = await zapier.disableWorkflow({
1232
1280
  });
1233
1281
  ```
1234
1282
 
1283
+ #### `discardWorkflowDraft` 🧪 _experimental_
1284
+
1285
+ Discard an open workflow draft (soft delete). The draft's unpublished edits stop resolving; the published version is untouched.
1286
+
1287
+ **Parameters:**
1288
+
1289
+ | Name | Type | Required | Default | Possible Values | Description |
1290
+ | -------------- | -------- | -------- | ------- | --------------- | ------------------- |
1291
+ | `options` | `object` | ✅ | — | — | |
1292
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1293
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
1294
+
1295
+ **Returns:** `Promise<WorkflowDraftItem>`
1296
+
1297
+ | Name | Type | Required | Possible Values | Description |
1298
+ | ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
1299
+ | `data` | `object` | ✅ | — | |
1300
+ | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1301
+ | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1302
+ | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1303
+ | ​ ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
1304
+ | ​ ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1305
+ | ​ ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
1306
+ | ​ ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
1307
+ | ​ ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
1308
+ | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1309
+ | ​ ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
1310
+ | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1311
+ | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1312
+ | ​ ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
1313
+ | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1314
+ | ​ ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
1315
+ | ​ ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
1316
+ | ​ ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
1317
+ | ​ ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
1318
+
1319
+ **Example:**
1320
+
1321
+ ```typescript
1322
+ const result = await zapier.discardWorkflowDraft({
1323
+ workflow: "example-workflow",
1324
+ draft: "example-draft",
1325
+ });
1326
+ ```
1327
+
1235
1328
  #### `enableWorkflow` 🧪 _experimental_
1236
1329
 
1237
1330
  Enable a durable workflow so it accepts triggers
@@ -1395,27 +1488,27 @@ Get full details of a workflow draft including source files
1395
1488
 
1396
1489
  **Returns:** `Promise<WorkflowDraftItem>`
1397
1490
 
1398
- | Name | Type | Required | Possible Values | Description |
1399
- | ---------------------------- | -------- | -------- | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
1400
- | `data` | `object` | ✅ | — | |
1401
- | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1402
- | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1403
- | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1404
- | ​ ↳ `base_version_id` | `string` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
1405
- | ​ ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1406
- | ​ ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
1407
- | ​ ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
1408
- | ​ ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
1409
- | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1410
- | ​ ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
1411
- | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1412
- | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1413
- | ​ ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
1414
- | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1415
- | ​ ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
1416
- | ​ ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
1417
- | ​ ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
1418
- | ​ ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
1491
+ | Name | Type | Required | Possible Values | Description |
1492
+ | ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
1493
+ | `data` | `object` | ✅ | — | |
1494
+ | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1495
+ | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1496
+ | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1497
+ | ​ ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
1498
+ | ​ ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1499
+ | ​ ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
1500
+ | ​ ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
1501
+ | ​ ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
1502
+ | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1503
+ | ​ ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
1504
+ | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1505
+ | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1506
+ | ​ ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
1507
+ | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1508
+ | ​ ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
1509
+ | ​ ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
1510
+ | ​ ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
1511
+ | ​ ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
1419
1512
 
1420
1513
  **Example:**
1421
1514
 
@@ -1563,18 +1656,18 @@ List drafts for a workflow, most recently edited first (open drafts by default)
1563
1656
 
1564
1657
  **Returns:** `Promise<PaginatedResult<WorkflowDraftItem>>`
1565
1658
 
1566
- | Name | Type | Required | Possible Values | Description |
1567
- | ---------------------------- | ---------- | -------- | ------------------- | -------------------------------------------------------------------------------------------------- |
1568
- | `data[]` | `object[]` | ✅ | — | |
1569
- | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1570
- | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1571
- | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1572
- | ​ ↳ `base_version_id` | `string` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
1573
- | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1574
- | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1575
- | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1576
- | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1577
- | `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
1659
+ | Name | Type | Required | Possible Values | Description |
1660
+ | ---------------------------- | ---------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
1661
+ | `data[]` | `object[]` | ✅ | — | |
1662
+ | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1663
+ | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1664
+ | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1665
+ | ​ ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
1666
+ | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1667
+ | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1668
+ | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1669
+ | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1670
+ | `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
1578
1671
 
1579
1672
  **Example:**
1580
1673
 
@@ -1774,6 +1867,65 @@ for await (const workflow of zapier.listWorkflows().items()) {
1774
1867
  }
1775
1868
  ```
1776
1869
 
1870
+ #### `publishWorkflowDraft` 🧪 _experimental_
1871
+
1872
+ Publish an open draft as a new immutable workflow version. Advances the workflow's live pointer and discards the draft — publish consumes it, so an open draft always means unpublished work. Continue editing by creating a new draft, which forks from the just-published version.
1873
+
1874
+ **Parameters:**
1875
+
1876
+ | Name | Type | Required | Default | Possible Values | Description |
1877
+ | ------------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1878
+ | `options` | `object` | ✅ | — | — | |
1879
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1880
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
1881
+ | ​ ↳ `enabled` | `boolean` | ❌ | — | — | Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved. |
1882
+ | ​ ↳ `draftRevision` | `number` | ❌ | — | — | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the publish with a conflict if the draft has changed since. Omit to skip the check. |
1883
+
1884
+ **Returns:** `Promise<PublishWorkflowDraftResponse>`
1885
+
1886
+ | Name | Type | Required | Possible Values | Description |
1887
+ | ------------------------------ | -------- | -------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
1888
+ | `data` | `object` | ✅ | — | |
1889
+ | ​ ↳ `draft` | `object` | ✅ | — | The consumed draft: status is 'discarded' and discarded_at is set. base_version_id still records the version the draft was forked from. |
1890
+ | ​   ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
1891
+ | ​   ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1892
+ | ​   ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
1893
+ | ​   ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
1894
+ | ​   ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1895
+ | ​   ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
1896
+ | ​   ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
1897
+ | ​   ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
1898
+ | ​   ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
1899
+ | ​   ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
1900
+ | ​   ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
1901
+ | ​   ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
1902
+ | ​   ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
1903
+ | ​   ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
1904
+ | ​   ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
1905
+ | ​   ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
1906
+ | ​   ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
1907
+ | ​   ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
1908
+ | ​ ↳ `version` | `object` | ✅ | — | The newly published immutable workflow version, now live. |
1909
+ | ​   ↳ `id` | `string` | ✅ | — | Workflow version ID (UUID) |
1910
+ | ​   ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
1911
+ | ​   ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
1912
+ | ​   ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this version's runs |
1913
+ | ​   ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this version (or null) |
1914
+ | ​   ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who published this version |
1915
+ | ​   ↳ `created_at` | `string` | ✅ | — | When the version was published (ISO-8601) |
1916
+ | ​   ↳ `trigger` | `object` | ✅ | — | Trigger configuration persisted on this version, or null for webhook-only workflows. |
1917
+ | ​   ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this version (or null). |
1918
+ | ​   ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this version (or null). |
1919
+
1920
+ **Example:**
1921
+
1922
+ ```typescript
1923
+ const { data: workflowVersion } = await zapier.publishWorkflowDraft({
1924
+ workflow: "example-workflow",
1925
+ draft: "example-draft",
1926
+ });
1927
+ ```
1928
+
1777
1929
  #### `publishWorkflowVersion` 🧪 _experimental_
1778
1930
 
1779
1931
  Publish a new version of a durable workflow. Enables the workflow by default.
@@ -1926,6 +2078,59 @@ const { data: workflow } = await zapier.updateWorkflow({
1926
2078
  });
1927
2079
  ```
1928
2080
 
2081
+ #### `updateWorkflowDraft` 🧪 _experimental_
2082
+
2083
+ Update (autosave) an open workflow draft
2084
+
2085
+ **Parameters:**
2086
+
2087
+ | Name | Type | Required | Default | Possible Values | Description |
2088
+ | -------------------------- | -------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2089
+ | `options` | `object` | ✅ | — | — | |
2090
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
2091
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
2092
+ | ​ ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
2093
+ | ​ ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Leaves the stored pin unchanged if omitted. |
2094
+ | ​ ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
2095
+ | ​ ↳ `draftRevision` | `number` | ❌ | — | — | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the save with a conflict if the draft has changed since. Omit to skip the check. |
2096
+ | ​ ↳ `trigger` | `object` | ❌ | — | — | Trigger configuration. Omit to leave the stored trigger unchanged, pass null to clear it, or pass an object to replace it. |
2097
+ | ​ ↳ `connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
2098
+ | ​ ↳ `appVersions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
2099
+
2100
+ **Returns:** `Promise<WorkflowDraftItem>`
2101
+
2102
+ | Name | Type | Required | Possible Values | Description |
2103
+ | ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
2104
+ | `data` | `object` | ✅ | — | |
2105
+ | ​ ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
2106
+ | ​ ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
2107
+ | ​ ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
2108
+ | ​ ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
2109
+ | ​ ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
2110
+ | ​ ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
2111
+ | ​ ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
2112
+ | ​ ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
2113
+ | ​ ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
2114
+ | ​ ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
2115
+ | ​ ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
2116
+ | ​ ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
2117
+ | ​ ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
2118
+ | ​ ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
2119
+ | ​ ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
2120
+ | ​ ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
2121
+ | ​ ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
2122
+ | ​ ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
2123
+
2124
+ **Example:**
2125
+
2126
+ ```typescript
2127
+ const { data: workflowDraft } = await zapier.updateWorkflowDraft({
2128
+ workflow: "example-workflow",
2129
+ draft: "example-draft",
2130
+ sourceFiles: {},
2131
+ });
2132
+ ```
2133
+
1929
2134
  ### Connections
1930
2135
 
1931
2136
  #### `createConnection`
@@ -5999,7 +5999,7 @@ function parseDeprecationDate(value) {
5999
5999
  }
6000
6000
 
6001
6001
  // src/sdk-version.ts
6002
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.89.0" : void 0) || "unknown";
6002
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.0" : void 0) || "unknown";
6003
6003
 
6004
6004
  // src/utils/open-url.ts
6005
6005
  var nodePrefix = "node:";
@@ -15808,6 +15808,7 @@ exports.durableRunIdResolver = durableRunIdResolver;
15808
15808
  exports.eventEmissionHookPlugin = eventEmissionHookPlugin;
15809
15809
  exports.eventEmissionPlugin = eventEmissionPlugin;
15810
15810
  exports.eventEmissionPluginRef = eventEmissionPluginRef;
15811
+ exports.extractErrorDetail = extractErrorDetail;
15811
15812
  exports.fetchPlugin = fetchPlugin;
15812
15813
  exports.findFirstConnectionPlugin = findFirstConnectionPlugin;
15813
15814
  exports.findManifestEntry = findManifestEntry;
@@ -5997,7 +5997,7 @@ function parseDeprecationDate(value) {
5997
5997
  }
5998
5998
 
5999
5999
  // src/sdk-version.ts
6000
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.89.0" : void 0) || "unknown";
6000
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.0" : void 0) || "unknown";
6001
6001
 
6002
6002
  // src/utils/open-url.ts
6003
6003
  var nodePrefix = "node:";
@@ -15656,4 +15656,4 @@ var registryPlugin = (_sdk) => {
15656
15656
  return {};
15657
15657
  };
15658
15658
 
15659
- export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
15659
+ export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };