You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`filter` accepts the same filters as [`runs.list()`](/management/runs/list), excluding pagination fields. Provide at least one filter field; use `runIds` when you want to target specific runs. Relative time filters such as `period` are resolved when the bulk action is created, so later batches process the same fixed time range.
77
-
78
-
<Warning>
79
-
Filters inherit the same time semantics as `runs.list()`: when you don't pass `from`, `to`, or `period`, the action defaults to the **last 7 days** and won't target older matching runs. To cover a wider range, pass an explicit `period` (such as `"30d"`), a `from` timestamp, or a `from`/`to` pair. This default only applies to `filter` selections; `runIds` selections are never time-bounded.
80
-
</Warning>
81
-
82
-
<ParamFieldbody="filter"type="BulkActionFilter">
83
-
Selects runs using the same filter shape as `runs.list()`, excluding `limit`, `after`, and `before`.
84
-
</ParamField>
85
-
86
-
<ParamFieldbody="runIds"type="string[]">
87
-
Selects specific run IDs. Provide either `filter` or `runIds`, not both.
Replays matching runs in a specific region. When omitted, each replay keeps the original run's region. This option is only available for `runs.bulk.replay()`.
96
-
</ParamField>
97
-
98
-
## Create a bulk cancel from the SDK
99
-
100
-
Use `runs.bulk.cancel()` to cancel every run that matches a filter, or specific run IDs.
101
-
102
-
```ts Your backend code
103
-
import { runs } from"@trigger.dev/sdk";
104
-
105
-
const action =awaitruns.bulk.cancel({
106
-
runIds: ["run_1234", "run_5678"],
107
-
name: "Cancel selected runs",
108
-
});
109
-
110
-
console.log(action.id);
111
-
```
112
-
113
-
Only runs that are still cancelable when the action reaches them are canceled. Runs that have already reached a final state count as failures in the bulk action summary.
114
-
115
-
## Retrieve progress from the SDK
116
-
117
-
Use `runs.bulk.retrieve()` to read the current status and aggregate counts.
Use `runs.bulk.abort()` to stop future batches from being processed.
183
-
184
-
```ts Your backend code
185
-
import { runs } from"@trigger.dev/sdk";
186
-
187
-
awaitruns.bulk.abort("bulk_1234");
188
-
```
189
-
190
-
Abort is best effort. Runs already being processed in the current batch may still finish.
191
-
192
-
<Note>
193
-
Each environment can only run a limited number of bulk replays at the same time. If you start a replay while too many are still in progress, the call fails and returns an error. Wait for an in-progress replay to finish or abort one before starting another. Bulk cancels are not subject to this limit.
194
-
</Note>
195
-
196
-
## List bulk actions from the SDK
197
-
198
-
Use `runs.bulk.list()` to page through previous bulk actions in the current environment.
199
-
200
-
```ts Your backend code
201
-
import { runs } from"@trigger.dev/sdk";
202
-
203
-
const page =awaitruns.bulk.list({ limit: 25 });
204
-
205
-
for (const action ofpage.data) {
206
-
console.log(action.id, action.status);
207
-
}
208
-
```
209
-
210
-
List results support the same auto-pagination helpers as other management API list methods:
After you deploy a fix, use [bulk actions](/bulk-actions) to replay multiple failed runs from the dashboard or SDK. Bulk replay creates an asynchronous action that targets selected run IDs or a `runs.list()` filter, so you can retry a known failure set without replaying each run individually.
383
+
After you deploy a fix, use [bulk actions](/bulk-actions) to replay multiple failed runs from the dashboard, or [bulk actions with the SDK](/runs/bulk-actions) to replay them from backend code. Bulk replay creates an asynchronous action that targets selected run IDs or a `runs.list()` filter, so you can retry a known failure set without replaying each run individually.
0 commit comments