The open source platform for building AI workflows in TypeScript — long-running tasks with retries, queues & observability.
1import { task, wait, logger } from "@trigger.dev/sdk" 2 3export const processVideo = task({ 4 id: "process-video", 5 retry: { maxAttempts: 3 }, 6 run: async (payload: { url: string }) => { 7 const clip = await transcode(payload.url) 8 await wait.for({ seconds: 30 }) 9 const up = await store.put(clip) 10 logger.info("uploaded", { key: up.key }) 11 return { url: up.url } 12 }, 13})