From 82ebfc7908552fdbb8b2e933f446a71942f4b537 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Wed, 6 Nov 2024 15:17:12 +0000 Subject: [PATCH] Made it clearer that tasks need to be exported --- docs/tasks/overview.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/tasks/overview.mdx b/docs/tasks/overview.mdx index cb99c900f..f8733f7f6 100644 --- a/docs/tasks/overview.mdx +++ b/docs/tasks/overview.mdx @@ -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({ }); ``` + + 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. + + You can trigger this in two ways: 1. From the dashboard [using the "Test" feature](/run-tests).