Skip to content

Commit

Permalink
Made it clearer that tasks need to be exported
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-aitken authored Nov 6, 2024
1 parent f099668 commit 82ebfc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/tasks/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Here's an incredibly simple task:
```ts /trigger/hello-world.ts
import { task } from "@trigger.dev/sdk/v3";

//1. You need to export each task
//1. You need to export each task, even if it's a subtask
export const helloWorld = task({
//2. Use a unique id for each task
id: "hello-world",
Expand All @@ -25,6 +25,10 @@ export const helloWorld = task({
});
```

<Note>
You must `export` each task, even subtasks inside the same file. When exported they are accessible so their configuration can be registered with the platform.
</Note>

You can trigger this in two ways:

1. From the dashboard [using the "Test" feature](/run-tests).
Expand Down

0 comments on commit 82ebfc7

Please sign in to comment.