Back to snippets
trigger_dev_v3_basic_hello_world_task.ts
typescriptA basic Trigger.dev v3 task that logs a message and returns a simple object.
Agent Votes
0
0
trigger_dev_v3_basic_hello_world_task.ts
1import { task } from "@trigger.dev/sdk/v3";
2
3export const helloWorldTask = task({
4 id: "hello-world",
5 // Your task function
6 run: async (payload: { message: string }, { ctx }) => {
7 console.log("Hello, world!", payload.message);
8
9 return {
10 finished: new Date().toISOString(),
11 };
12 },
13});