> trigger-dev-v3
You are an expert in Trigger.dev v3, the background jobs platform for TypeScript. You help developers run long-running tasks, scheduled jobs, event-driven workflows, and AI pipelines in the cloud — with automatic retries, concurrency control, real-time logs, and up to 5-minute (or longer) execution times that serverless functions can't handle.
curl "https://skillshub.wtf/TerminalSkills/skills/trigger-dev-v3?format=md"Trigger.dev v3 — Background Jobs for TypeScript
You are an expert in Trigger.dev v3, the background jobs platform for TypeScript. You help developers run long-running tasks, scheduled jobs, event-driven workflows, and AI pipelines in the cloud — with automatic retries, concurrency control, real-time logs, and up to 5-minute (or longer) execution times that serverless functions can't handle.
Core Capabilities
import { task, schedules } from "@trigger.dev/sdk/v3";
// Define a background task
export const processVideo = task({
id: "process-video",
retry: { maxAttempts: 3, minTimeoutInMs: 1000, factor: 2 },
run: async (payload: { videoUrl: string; userId: string }) => {
const downloaded = await downloadVideo(payload.videoUrl);
const transcoded = await transcodeToMP4(downloaded);
const thumbnail = await generateThumbnail(transcoded);
await uploadToS3(transcoded, thumbnail);
await db.videos.update(payload.userId, { status: "ready", thumbnail });
return { success: true };
},
});
// Trigger from your API
app.post("/api/upload", async (req, res) => {
const handle = await processVideo.trigger({ videoUrl: req.body.url, userId: req.user.id });
res.json({ jobId: handle.id }); // Returns immediately
});
// Scheduled task (cron)
export const dailyReport = schedules.task({
id: "daily-report",
cron: "0 9 * * *", // 9 AM daily
run: async () => {
const stats = await generateDailyStats();
await sendSlackMessage("#reports", formatReport(stats));
},
});
// Fan-out: process items in parallel with concurrency limit
export const batchProcess = task({
id: "batch-process",
run: async (payload: { items: string[] }) => {
const results = await processVideo.batchTriggerAndWait(
payload.items.map(url => ({ payload: { videoUrl: url, userId: "system" } })),
);
return results;
},
});
Installation
npm install @trigger.dev/sdk
npx trigger.dev@latest init
npx trigger.dev@latest dev # Local dev server
Best Practices
- Long-running — Tasks can run for minutes/hours; not limited to serverless timeouts
- Automatic retries — Configure retry with exponential backoff; handles transient failures
- Concurrency — Set
concurrencyLimitto control parallel execution; prevent overwhelming APIs - Fan-out — Use
batchTriggerAndWaitto process arrays in parallel; collect all results - Idempotent — Design tasks to be safely re-runnable; retries may re-execute partially completed tasks
- Real-time logs — Dashboard shows live logs, status, duration; debug without local reproduction
- Scheduled tasks — Cron expressions for periodic jobs; replaces node-cron with managed infrastructure
- Type-safe — Payload types enforced; trigger and task share TypeScript types
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.