@zapier/zapier-sdk 0.63.0 → 0.65.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 +12 -0
- package/README.md +256 -0
- package/dist/experimental.cjs +387 -2
- package/dist/experimental.d.mts +145 -2
- package/dist/experimental.d.ts +143 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +12 -0
- package/dist/experimental.mjs +386 -3
- package/dist/{index-3fBEDEsp.d.mts → index-JhNxS_mq.d.mts} +39 -1
- package/dist/{index-3fBEDEsp.d.ts → index-JhNxS_mq.d.ts} +39 -1
- package/dist/index.cjs +43 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +42 -2
- package/dist/plugins/codeSubstrate/getTriggerRun/index.d.ts +47 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/index.js +23 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.d.ts +24 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.js +30 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts +49 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.js +25 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.d.ts +26 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.js +43 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +46 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.js +25 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts +17 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.js +25 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts +53 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.js +34 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.d.ts +65 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.js +69 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +49 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.js +34 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts +37 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.js +48 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +49 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.js +33 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts +20 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.js +42 -0
- package/dist/resolvers/index.d.ts +2 -0
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +2 -0
- package/dist/resolvers/workflowRunId.d.ts +6 -0
- package/dist/resolvers/workflowRunId.d.ts.map +1 -0
- package/dist/resolvers/workflowRunId.js +20 -0
- package/dist/resolvers/workflowVersionId.d.ts +6 -0
- package/dist/resolvers/workflowVersionId.d.ts.map +1 -0
- package/dist/resolvers/workflowVersionId.js +20 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.65.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9138968: Add the workflow-run experimental code-substrate plugins: `listWorkflowRuns`, `getWorkflowRun`, and `getTriggerRun`. All three live behind `@zapier/zapier-sdk/experimental` only — the stable subpath does not surface them. `listWorkflowRuns` is paginated against the backend's cursor + limit contract; `getWorkflowRun` looks up a run by id; `getTriggerRun` walks from a trigger id to its associated run, useful immediately after firing a trigger when the caller has the trigger id but not yet the run id. All ID inputs are UUID-validated at the schema boundary. Handlers pass the API response through verbatim — schemas stay as `outputSchema` for docs and types, but consumers see any richer fields the server adds without an SDK release. Adds `workflowRunIdResolver` — a dependent resolver scoped to the parent workflow — so CLI commands taking a run id present an interactive picker via `sdk.listWorkflowRuns({ workflow })`. `getTriggerRun` does not register a picker for `trigger`; users typically have the trigger id from a recent fire and pass it directly.
|
|
8
|
+
|
|
9
|
+
## 0.64.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 913aa6b: Add the workflow-version experimental code-substrate plugins: `publishWorkflowVersion`, `listWorkflowVersions`, and `getWorkflowVersion`. All three are registered only in `@zapier/zapier-sdk/experimental`; the stable subpath does not expose them. `listWorkflowVersions` is paginated (cursor + pageSize); `publishWorkflowVersion` POSTs `source_files` (filename → contents) plus optional `dependencies`, `zapier_durable_version`, and `enabled` (defaults to true) to publish a new version; `getWorkflowVersion` returns the full version state including source files. Handlers pass API responses through verbatim (no client-side `.parse()` re-emission) so callers see any richer fields the server adds later without an SDK release. Adds `workflowVersionIdResolver` — a dependent resolver scoped to a parent workflow, mirrored on `tableRecordIdResolver`'s shape — so commands that take a version id present an interactive picker via `sdk.listWorkflowVersions({ workflow })` in the CLI. All ID inputs are UUID-validated at the boundary so non-UUID strings fail with a clear schema error instead of an opaque 500 from the backend's `::uuid` cast.
|
|
14
|
+
|
|
3
15
|
## 0.63.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -33,9 +33,15 @@
|
|
|
33
33
|
- [`disableWorkflow`](#disableworkflow--experimental)
|
|
34
34
|
- [`enableWorkflow`](#enableworkflow--experimental)
|
|
35
35
|
- [`getDurableRun`](#getdurablerun--experimental)
|
|
36
|
+
- [`getTriggerRun`](#gettriggerrun--experimental)
|
|
36
37
|
- [`getWorkflow`](#getworkflow--experimental)
|
|
38
|
+
- [`getWorkflowRun`](#getworkflowrun--experimental)
|
|
39
|
+
- [`getWorkflowVersion`](#getworkflowversion--experimental)
|
|
37
40
|
- [`listDurableRuns`](#listdurableruns--experimental)
|
|
41
|
+
- [`listWorkflowRuns`](#listworkflowruns--experimental)
|
|
42
|
+
- [`listWorkflowVersions`](#listworkflowversions--experimental)
|
|
38
43
|
- [`listWorkflows`](#listworkflows--experimental)
|
|
44
|
+
- [`publishWorkflowVersion`](#publishworkflowversion--experimental)
|
|
39
45
|
- [`runDurable`](#rundurable--experimental)
|
|
40
46
|
- [`updateWorkflow`](#updateworkflow--experimental)
|
|
41
47
|
- [Connections](#connections)
|
|
@@ -1258,6 +1264,40 @@ const { data: durableRun } = await zapier.getDurableRun({
|
|
|
1258
1264
|
});
|
|
1259
1265
|
```
|
|
1260
1266
|
|
|
1267
|
+
#### `getTriggerRun` 🧪 _experimental_
|
|
1268
|
+
|
|
1269
|
+
Get the workflow run associated with a deployed workflow's trigger. Useful immediately after firing a trigger, when you have the trigger ID but not yet the run ID.
|
|
1270
|
+
|
|
1271
|
+
**Parameters:**
|
|
1272
|
+
|
|
1273
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1274
|
+
| ------------- | -------- | -------- | ------- | --------------- | ------------------- |
|
|
1275
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1276
|
+
| ↳ `trigger` | `string` | ✅ | — | — | Workflow trigger ID |
|
|
1277
|
+
|
|
1278
|
+
**Returns:** `Promise<WorkflowRunItem>`
|
|
1279
|
+
|
|
1280
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1281
|
+
| ------------------------- | -------- | -------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
1282
|
+
| `data` | `object` | ✅ | — | |
|
|
1283
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1284
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1285
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1286
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1287
|
+
| ↳ `input` | `string` | ✅ | — | Input passed to the run |
|
|
1288
|
+
| ↳ `output` | `string` | ✅ | — | Return value, present when status is `finished` |
|
|
1289
|
+
| ↳ `error` | `string` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1290
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1291
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1292
|
+
|
|
1293
|
+
**Example:**
|
|
1294
|
+
|
|
1295
|
+
```typescript
|
|
1296
|
+
const { data: workflowRun } = await zapier.getTriggerRun({
|
|
1297
|
+
trigger: "example-trigger",
|
|
1298
|
+
});
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1261
1301
|
#### `getWorkflow` 🧪 _experimental_
|
|
1262
1302
|
|
|
1263
1303
|
Get a durable workflow with its current version details and trigger claim status
|
|
@@ -1298,6 +1338,76 @@ const { data: workflow } = await zapier.getWorkflow({
|
|
|
1298
1338
|
});
|
|
1299
1339
|
```
|
|
1300
1340
|
|
|
1341
|
+
#### `getWorkflowRun` 🧪 _experimental_
|
|
1342
|
+
|
|
1343
|
+
Get the current state of a workflow run (a triggered execution of a deployed workflow)
|
|
1344
|
+
|
|
1345
|
+
**Parameters:**
|
|
1346
|
+
|
|
1347
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1348
|
+
| -------------- | -------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------- |
|
|
1349
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1350
|
+
| ↳ `workflow` | `string` | ❌ | — | — | Parent workflow ID — used only to scope the CLI run-id picker; ignored by the API call. |
|
|
1351
|
+
| ↳ `run` | `string` | ✅ | — | — | Workflow run ID |
|
|
1352
|
+
|
|
1353
|
+
**Returns:** `Promise<WorkflowRunItem>`
|
|
1354
|
+
|
|
1355
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1356
|
+
| ------------------------- | -------- | -------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
1357
|
+
| `data` | `object` | ✅ | — | |
|
|
1358
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1359
|
+
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any |
|
|
1360
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1361
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1362
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1363
|
+
| ↳ `input` | `string` | ✅ | — | Input passed to the run |
|
|
1364
|
+
| ↳ `output` | `string` | ✅ | — | Return value, present when status is `finished` |
|
|
1365
|
+
| ↳ `error` | `string` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1366
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1367
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1368
|
+
|
|
1369
|
+
**Example:**
|
|
1370
|
+
|
|
1371
|
+
```typescript
|
|
1372
|
+
const { data: workflowRun } = await zapier.getWorkflowRun({
|
|
1373
|
+
run: "example-run",
|
|
1374
|
+
});
|
|
1375
|
+
```
|
|
1376
|
+
|
|
1377
|
+
#### `getWorkflowVersion` 🧪 _experimental_
|
|
1378
|
+
|
|
1379
|
+
Get full details of a workflow version including source files
|
|
1380
|
+
|
|
1381
|
+
**Parameters:**
|
|
1382
|
+
|
|
1383
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1384
|
+
| -------------- | -------- | -------- | ------- | --------------- | ------------------- |
|
|
1385
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1386
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1387
|
+
| ↳ `version` | `string` | ✅ | — | — | Workflow version ID |
|
|
1388
|
+
|
|
1389
|
+
**Returns:** `Promise<WorkflowVersionItem>`
|
|
1390
|
+
|
|
1391
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1392
|
+
| ---------------------------- | -------- | -------- | --------------- | ------------------------------------------------------------------- |
|
|
1393
|
+
| `data` | `object` | ✅ | — | |
|
|
1394
|
+
| ↳ `id` | `string` | ✅ | — | Workflow version ID (UUID) |
|
|
1395
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1396
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1397
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this version's runs |
|
|
1398
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this version (or null) |
|
|
1399
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who published this version |
|
|
1400
|
+
| ↳ `created_at` | `string` | ✅ | — | When the version was published (ISO-8601) |
|
|
1401
|
+
|
|
1402
|
+
**Example:**
|
|
1403
|
+
|
|
1404
|
+
```typescript
|
|
1405
|
+
const { data: workflowVersion } = await zapier.getWorkflowVersion({
|
|
1406
|
+
workflow: "example-workflow",
|
|
1407
|
+
version: "example-version",
|
|
1408
|
+
});
|
|
1409
|
+
```
|
|
1410
|
+
|
|
1301
1411
|
#### `listDurableRuns` 🧪 _experimental_
|
|
1302
1412
|
|
|
1303
1413
|
List run-once durable runs for the authenticated account, newest first
|
|
@@ -1344,6 +1454,115 @@ for await (const durableRun of zapier.listDurableRuns().items()) {
|
|
|
1344
1454
|
}
|
|
1345
1455
|
```
|
|
1346
1456
|
|
|
1457
|
+
#### `listWorkflowRuns` 🧪 _experimental_
|
|
1458
|
+
|
|
1459
|
+
List workflow runs (triggered executions) for a specific deployed workflow, newest first
|
|
1460
|
+
|
|
1461
|
+
**Parameters:**
|
|
1462
|
+
|
|
1463
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1464
|
+
| -------------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
|
|
1465
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1466
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1467
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of runs per page (max 100) |
|
|
1468
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Pagination cursor |
|
|
1469
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total runs to return across all pages |
|
|
1470
|
+
|
|
1471
|
+
**Returns:** `Promise<PaginatedResult<WorkflowRunItem>>`
|
|
1472
|
+
|
|
1473
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1474
|
+
| ------------------------- | ---------- | -------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
1475
|
+
| `data[]` | `object[]` | ✅ | — | |
|
|
1476
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1477
|
+
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any. Null for runs created without a trigger. |
|
|
1478
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1479
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to. Null in rare edge cases. |
|
|
1480
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1481
|
+
| ↳ `input` | `string` | ✅ | — | Input passed to the run |
|
|
1482
|
+
| ↳ `output` | `string` | ✅ | — | Return value, present when status is `finished` |
|
|
1483
|
+
| ↳ `error` | `string` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1484
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1485
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1486
|
+
| `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
|
|
1487
|
+
|
|
1488
|
+
**Example:**
|
|
1489
|
+
|
|
1490
|
+
```typescript
|
|
1491
|
+
// Get first page and a cursor for the second page
|
|
1492
|
+
const { data: workflowRuns, nextCursor } = await zapier.listWorkflowRuns({
|
|
1493
|
+
workflow: "example-workflow",
|
|
1494
|
+
});
|
|
1495
|
+
|
|
1496
|
+
// Or iterate over all pages
|
|
1497
|
+
for await (const page of zapier.listWorkflowRuns({
|
|
1498
|
+
workflow: "example-workflow",
|
|
1499
|
+
})) {
|
|
1500
|
+
// Do something with each page
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
// Or iterate over individual items across all pages
|
|
1504
|
+
for await (const workflowRun of zapier
|
|
1505
|
+
.listWorkflowRuns({
|
|
1506
|
+
workflow: "example-workflow",
|
|
1507
|
+
})
|
|
1508
|
+
.items()) {
|
|
1509
|
+
// Do something with each workflowRun
|
|
1510
|
+
}
|
|
1511
|
+
```
|
|
1512
|
+
|
|
1513
|
+
#### `listWorkflowVersions` 🧪 _experimental_
|
|
1514
|
+
|
|
1515
|
+
List published versions for a workflow, newest first
|
|
1516
|
+
|
|
1517
|
+
**Parameters:**
|
|
1518
|
+
|
|
1519
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1520
|
+
| -------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------- |
|
|
1521
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1522
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1523
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of versions per page (max 100) |
|
|
1524
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Pagination cursor |
|
|
1525
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total versions to return across all pages |
|
|
1526
|
+
|
|
1527
|
+
**Returns:** `Promise<PaginatedResult<WorkflowVersionItem>>`
|
|
1528
|
+
|
|
1529
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1530
|
+
| ---------------------------- | ---------- | -------- | --------------- | ------------------------------------------------------------------- |
|
|
1531
|
+
| `data[]` | `object[]` | ✅ | — | |
|
|
1532
|
+
| ↳ `id` | `string` | ✅ | — | Workflow version ID (UUID) |
|
|
1533
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1534
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this version's runs |
|
|
1535
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this version (or null) |
|
|
1536
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who published this version |
|
|
1537
|
+
| ↳ `created_at` | `string` | ✅ | — | When the version was published (ISO-8601) |
|
|
1538
|
+
| `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
|
|
1539
|
+
|
|
1540
|
+
**Example:**
|
|
1541
|
+
|
|
1542
|
+
```typescript
|
|
1543
|
+
// Get first page and a cursor for the second page
|
|
1544
|
+
const { data: workflowVersions, nextCursor } =
|
|
1545
|
+
await zapier.listWorkflowVersions({
|
|
1546
|
+
workflow: "example-workflow",
|
|
1547
|
+
});
|
|
1548
|
+
|
|
1549
|
+
// Or iterate over all pages
|
|
1550
|
+
for await (const page of zapier.listWorkflowVersions({
|
|
1551
|
+
workflow: "example-workflow",
|
|
1552
|
+
})) {
|
|
1553
|
+
// Do something with each page
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// Or iterate over individual items across all pages
|
|
1557
|
+
for await (const workflowVersion of zapier
|
|
1558
|
+
.listWorkflowVersions({
|
|
1559
|
+
workflow: "example-workflow",
|
|
1560
|
+
})
|
|
1561
|
+
.items()) {
|
|
1562
|
+
// Do something with each workflowVersion
|
|
1563
|
+
}
|
|
1564
|
+
```
|
|
1565
|
+
|
|
1347
1566
|
#### `listWorkflows` 🧪 _experimental_
|
|
1348
1567
|
|
|
1349
1568
|
List all active durable workflows for the authenticated account
|
|
@@ -1389,6 +1608,43 @@ for await (const workflow of zapier.listWorkflows().items()) {
|
|
|
1389
1608
|
}
|
|
1390
1609
|
```
|
|
1391
1610
|
|
|
1611
|
+
#### `publishWorkflowVersion` 🧪 _experimental_
|
|
1612
|
+
|
|
1613
|
+
Publish a new version of a durable workflow. Enables the workflow by default.
|
|
1614
|
+
|
|
1615
|
+
**Parameters:**
|
|
1616
|
+
|
|
1617
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1618
|
+
| ---------------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
1619
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1620
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1621
|
+
| ↳ `source_files` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
1622
|
+
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
1623
|
+
| ↳ `zapier_durable_version` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
1624
|
+
| ↳ `enabled` | `boolean` | ❌ | — | — | Enable the workflow after publishing. Defaults to true; pass false to publish without enabling. |
|
|
1625
|
+
|
|
1626
|
+
**Returns:** `Promise<WorkflowVersionItem>`
|
|
1627
|
+
|
|
1628
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1629
|
+
| ---------------------------- | -------- | -------- | --------------- | ------------------------------------------------------------------- |
|
|
1630
|
+
| `data` | `object` | ✅ | — | |
|
|
1631
|
+
| ↳ `id` | `string` | ✅ | — | Workflow version ID (UUID) |
|
|
1632
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1633
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1634
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this version's runs |
|
|
1635
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this version (or null) |
|
|
1636
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who published this version |
|
|
1637
|
+
| ↳ `created_at` | `string` | ✅ | — | When the version was published (ISO-8601) |
|
|
1638
|
+
|
|
1639
|
+
**Example:**
|
|
1640
|
+
|
|
1641
|
+
```typescript
|
|
1642
|
+
const result = await zapier.publishWorkflowVersion({
|
|
1643
|
+
workflow: "example-workflow",
|
|
1644
|
+
source_files: {},
|
|
1645
|
+
});
|
|
1646
|
+
```
|
|
1647
|
+
|
|
1392
1648
|
#### `runDurable` 🧪 _experimental_
|
|
1393
1649
|
|
|
1394
1650
|
Run a workflow source file as a run-once durable run on sdkdurableapi (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.
|