Made it clearer that tasks need to be exported

This commit is contained in:
Matt Aitken
2024-11-06 15:17:12 +00:00
committed by GitHub
parent f0996686e9
commit 82ebfc7908
+5 -1
View File
@@ -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",
@@ -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).