Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/migrating-from-v3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const batchHandle = await tasks.batchTrigger([
console.log(batchHandle.runs);
```

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

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

// Now you need to call runs.list()
const runs = await batchHandle.runs.list();
console.log(runs);
// Now you need to retrieve the batch to get the runs
const batch = await batch.retrieve(batchHandle.batchId);
console.log(batch.runs);
```

### OpenTelemetry
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/migrate-v4-using-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ const batchHandle = await tasks.batchTrigger([
[myOtherTask, { baz: "qux" }],
]);

const runs = await batchHandle.runs.list(); // Use runs.list()
console.log(runs);
const batch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
console.log(batch.runs);

Comment on lines +203 to 205
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Variable name collision: batch shadows the imported module

const batch = await batch.retrieve(...) shadows the module/namespace and will either be invalid TS or highly confusing. Rename the local variable.

Apply this diff:

-const batch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
-console.log(batch.runs);
+const retrievedBatch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
+console.log(retrievedBatch.runs);

Additionally, ensure the snippet (or surrounding text) shows where batch comes from, e.g.:

import { batch } from "@trigger.dev/sdk";
🤖 Prompt for AI Agents
In docs/snippets/migrate-v4-using-ai.mdx around lines 203-205, the local
declaration "const batch = await batch.retrieve(...)" shadows the imported
"batch" module; rename the local variable (e.g., batchRecord or batchInstance)
and update subsequent references (console.log) to use the new name, and add or
ensure the snippet shows the module import (import { batch } from
"@trigger.dev/sdk";) earlier in the snippet so it's clear where the module comes
from.


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.
Expand Down
2 changes: 1 addition & 1 deletion docs/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const myTask = task({
});
```

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.
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify there are no remaining references to a 5-tag limit elsewhere

To avoid conflicting guidance, scan the repo for stale mentions of a 5-tag maximum.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for common phrasings of the old 5-tag limit across docs
rg -n -C2 -S -g '!**/node_modules/**' -g '!**/dist/**' -e \
$'up to 5 tags|maximum of 5 tags|max(imum)? 5 tags|5 tags per run|no more than 5 tags|limit of 5 tags|only 5 tags' || true

Length of output: 1342


Update stale 5-tag references in the OpenAPI spec

We still have lingering “5 tags” limits in the v3 OpenAPI YAML. Please update them to reflect the new 10-tag maximum.

• docs/v3-openapi.yaml:1610
• docs/v3-openapi.yaml:1831
• docs/v3-openapi.yaml:2008

Suggested diffs:

--- a/docs/v3-openapi.yaml
+++ b/docs/v3-openapi.yaml
@@ -1608,7 +1608,7 @@
-                You can set up to 5 tags per run, they must be less than 64 characters each.
+                You can set up to 10 tags per run, they must be less than 64 characters each.

@@ -1831,7 +1831,7 @@
-            description: A tag must be between 1 and 64 characters, a run can have up to 5 tags attached to it.
+            description: A tag must be between 1 and 64 characters, a run can have up to 10 tags attached to it.

@@ -2008,7 +2008,7 @@
-            description: A tag must be between 1 and 64 characters, a run can have up to 5 tags attached to it.
+            description: A tag must be between 1 and 64 characters, a run can have up to 10 tags attached to it.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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.
++ b/docs/v3-openapi.yaml
@@ -1608,7 +1608,7 @@
You can set up to 10 tags per run, they must be less than 64 characters each.
@@ -1831,7 +1831,7 @@
description: A tag must be between 1 and 64 characters, a run can have up to 10 tags attached to it.
@@ -2008,7 +2008,7 @@
description: A tag must be between 1 and 64 characters, a run can have up to 10 tags attached to it.


### Propagating tags to child runs

Expand Down
Loading