Skip to content

Commit 0da6a19

Browse files
authored
docs: Update triggering.mdx import for triggering from inside another task (#2215)
When triggering from inside another task, `runs` and `batch` should be imported from `@trigger.dev/sdk/v3`
1 parent 08d84eb commit 0da6a19

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/triggering.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ Triggers a single run of a task with the payload you pass in, and any options yo
238238
</Note>
239239

240240
```ts ./trigger/my-task.ts
241-
import { myOtherTask, runs } from "~/trigger/my-other-task";
241+
import { runs } from "@trigger.dev/sdk/v3";
242+
import { myOtherTask } from "~/trigger/my-other-task";
242243

243244
export const myTask = task({
244245
id: "my-task",
@@ -254,7 +255,8 @@ export const myTask = task({
254255
To pass options to the triggered task, you can use the second argument:
255256

256257
```ts ./trigger/my-task.ts
257-
import { myOtherTask, runs } from "~/trigger/my-other-task";
258+
import { runs } from "@trigger.dev/sdk/v3";
259+
import { myOtherTask } from "~/trigger/my-other-task";
258260

259261
export const myTask = task({
260262
id: "my-task",
@@ -272,7 +274,8 @@ export const myTask = task({
272274
Triggers multiple runs of a single task with the payloads you pass in, and any options you specify.
273275

274276
```ts /trigger/my-task.ts
275-
import { myOtherTask, batch } from "~/trigger/my-other-task";
277+
import { batch } from "@trigger.dev/sdk/v3";
278+
import { myOtherTask } from "~/trigger/my-other-task";
276279

277280
export const myTask = task({
278281
id: "my-task",
@@ -288,7 +291,8 @@ export const myTask = task({
288291
If you need to pass options to `batchTrigger`, you can use the second argument:
289292

290293
```ts /trigger/my-task.ts
291-
import { myOtherTask, batch } from "~/trigger/my-other-task";
294+
import { batch } from "@trigger.dev/sdk/v3";
295+
import { myOtherTask } from "~/trigger/my-other-task";
292296

293297
export const myTask = task({
294298
id: "my-task",
@@ -306,7 +310,8 @@ export const myTask = task({
306310
You can also pass in options for each run in the batch:
307311

308312
```ts /trigger/my-task.ts
309-
import { myOtherTask, batch } from "~/trigger/my-other-task";
313+
import { batch } from "@trigger.dev/sdk/v3";
314+
import { myOtherTask } from "~/trigger/my-other-task";
310315

311316
export const myTask = task({
312317
id: "my-task",

0 commit comments

Comments
 (0)