Skip to content

Commit 11cbd1b

Browse files
authored
Docs: Fixes incorrect retrieving runs from batchTrigger (#2427)
* Docs: fix for retrieving runs in batchTrigger * Removes old v3-to-v4 migration guide (we have a redirect) * Corrects tag limit from 5 to 10
1 parent 82401ec commit 11cbd1b

File tree

4 files changed

+7
-1221
lines changed

4 files changed

+7
-1221
lines changed

docs/migrating-from-v3.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const batchHandle = await tasks.batchTrigger([
290290
console.log(batchHandle.runs);
291291
```
292292

293-
In v4, you now need to use the `runs.list()` method to get the list of runs:
293+
In v4, you now need to use the `batch.retrieve()` method to get the batch with its runs:
294294

295295
```ts
296296
// In v4
@@ -299,9 +299,9 @@ const batchHandle = await tasks.batchTrigger([
299299
[myOtherTask, { baz: "qux" }],
300300
]);
301301

302-
// Now you need to call runs.list()
303-
const runs = await batchHandle.runs.list();
304-
console.log(runs);
302+
// Now you need to retrieve the batch to get the runs
303+
const batch = await batch.retrieve(batchHandle.batchId);
304+
console.log(batch.runs);
305305
```
306306

307307
### OpenTelemetry

docs/snippets/migrate-v4-using-ai.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ const batchHandle = await tasks.batchTrigger([
200200
[myOtherTask, { baz: "qux" }],
201201
]);
202202

203-
const runs = await batchHandle.runs.list(); // Use runs.list()
204-
console.log(runs);
203+
const batch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
204+
console.log(batch.runs);
205205

206206

207207
Can you help me convert the following code from v3 to v4? Please include the full converted code in the answer, do not truncate it anywhere.

docs/tags.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const myTask = task({
7575
});
7676
```
7777

78-
Reminder: you can only have up to 5 tags per run. If you call `tags.add()` and the total number of tags will be more than 5 we log an error and ignore the new tags. That includes tags from triggering and from inside the run function.
78+
Reminder: you can only have up to 10 tags per run. If you call `tags.add()` and the total number of tags will be more than 10 we log an error and ignore the new tags. That includes tags from triggering and from inside the run function.
7979

8080
### Propagating tags to child runs
8181

0 commit comments

Comments
 (0)