Skip to content

Commit 72bd2fe

Browse files
committed
feat(api): v2 workflow trigger health list and enablement
GET /api/v2/workflows/{workflowId}/triggers lists every schedule, polling, internal-event, and webhook trigger the live deployment serves, disabled ones included, with failure counts. PATCH .../triggers/{blockId} enables or disables one without redeploying: enabling resets the failure counters, re-arms a schedule's next run, and clears polling backoff; a schedule with no future run is a 409. Liveness is the active deployment version plus an active or legacy registration, enforced inside one conditional UPDATE, so a candidate, retired, or older-version row is never revived. Adds workflows.triggers.read / workflows.triggers.set_enabled, the WEBHOOK_UPDATED audit action, and the CLI commands `workflows triggers list|update`.
1 parent 8577aa4 commit 72bd2fe

21 files changed

Lines changed: 1572 additions & 1 deletion

File tree

‎apps/docs/content/docs/api-reference/(generated)/workflows/meta.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"importWorkflow",
2323
"getWorkflowDeployment",
2424
"updateWorkflowPublicApi",
25+
"listWorkflowTriggers",
26+
"updateWorkflowTrigger",
2527
"deployWorkflow",
2628
"undeployWorkflow",
2729
"rollbackWorkflow",

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8228,6 +8228,57 @@ sim workflows list [options]
82288228

82298229
API request and response schemas: [listWorkflows](/api-reference/workflows/listWorkflows).
82308230

8231+
### sim workflows triggers list
8232+
8233+
Show the health of every trigger the live deployment serves
8234+
8235+
```bash
8236+
sim workflows triggers list <workflowId>
8237+
```
8238+
8239+
**Arguments**
8240+
8241+
<CommandTable>
8242+
8243+
| Argument | Required | Description |
8244+
| --- | --- | --- |
8245+
| `workflowId` | Yes | Unique workflow identifier. |
8246+
8247+
</CommandTable>
8248+
8249+
API request and response schemas: [listWorkflowTriggers](/api-reference/workflows/listWorkflowTriggers).
8250+
8251+
### sim workflows triggers update
8252+
8253+
Enable or disable one trigger of the live deployment
8254+
8255+
```bash
8256+
sim workflows triggers update <workflowId> <blockId> [options]
8257+
```
8258+
8259+
**Arguments**
8260+
8261+
<CommandTable>
8262+
8263+
| Argument | Required | Description |
8264+
| --- | --- | --- |
8265+
| `workflowId` | Yes | Unique workflow identifier. |
8266+
| `blockId` | Yes | Trigger block in the deployed workflow. |
8267+
8268+
</CommandTable>
8269+
8270+
**Options**
8271+
8272+
<CommandTable>
8273+
8274+
| Option | Required | Description |
8275+
| --- | --- | --- |
8276+
| `--enabled <true\|false>` | Yes | Whether the trigger should fire. Accepted values: `true`, `false`. |
8277+
8278+
</CommandTable>
8279+
8280+
API request and response schemas: [updateWorkflowTrigger](/api-reference/workflows/updateWorkflowTrigger).
8281+
82318282
### sim workflows move
82328283

82338284
Move workflows

‎apps/docs/content/docs/cli/workflows.mdx‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,53 @@ sim workflows deployment update <workflowId> [options]
431431

432432
API request and response schemas: [updateWorkflowPublicApi](/api-reference/workflows/updateWorkflowPublicApi).
433433

434+
### Show the health of every trigger the live deployment serves
435+
436+
```bash
437+
sim workflows triggers list <workflowId>
438+
```
439+
440+
**Arguments**
441+
442+
<CommandTable>
443+
444+
| Argument | Required | Description |
445+
| --- | --- | --- |
446+
| `workflowId` | Yes | Unique workflow identifier. |
447+
448+
</CommandTable>
449+
450+
API request and response schemas: [listWorkflowTriggers](/api-reference/workflows/listWorkflowTriggers).
451+
452+
### Enable or disable one trigger of the live deployment
453+
454+
```bash
455+
sim workflows triggers update <workflowId> <blockId> [options]
456+
```
457+
458+
**Arguments**
459+
460+
<CommandTable>
461+
462+
| Argument | Required | Description |
463+
| --- | --- | --- |
464+
| `workflowId` | Yes | Unique workflow identifier. |
465+
| `blockId` | Yes | Trigger block in the deployed workflow. |
466+
467+
</CommandTable>
468+
469+
**Options**
470+
471+
<CommandTable>
472+
473+
| Option | Required | Description |
474+
| --- | --- | --- |
475+
| `--enabled <true\|false>` | Yes | Whether the trigger should fire. Accepted values: `true`, `false`. |
476+
477+
</CommandTable>
478+
479+
API request and response schemas: [updateWorkflowTrigger](/api-reference/workflows/updateWorkflowTrigger).
480+
434481
### List workflow versions
435482

436483
```bash

0 commit comments

Comments
 (0)