trigger-tasks

Build durable background tasks, scheduled jobs, and AI agent workflows with Trigger.dev.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-tasks-inventashif
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trigger-tasks
Source: https://github.com/inventashif/helpful-code-sidekick/tree/main/scripts/hackerai/.agents/skills/trigger-tasks
Command: npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-tasks-inventashif

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk, zod, and includes references (resource) components.

What problem does it solve? Long-running work like AI agent execution, webhook processing, and scheduled jobs cannot safely run inside a web request cycle. This Skill provides the patterns to build durable background tasks with automatic retries, queues, and observability using Trigger.dev v4. ## Core Features & Use Cases - Durable Task Execution: Define tasks with task() and schemaTask() from @trigger.dev/sdk, with typed payloads, retry policies, and machine presets. - Orchestration & Control: Trigger tasks from backend code or other tasks, use triggerAndWait() with Result handling, waits, debouncing, idempotency keys, and per-tenant concurrency queues. - Scheduled Jobs: Create cron-based recurring tasks with timezone support and dynamic multi-tenant schedules via the schedules API. - Use Case: You need to process uploaded files asynchronously without blocking your app. Define a task with retries and a concurrency-limited queue, trigger it from your API route, and track progress with metadata. ## Quick Start Create a Trigger.dev task that processes user data in the background with retries and a concurrency limit of five.

Frequently Asked Questions about trigger-tasks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a background task with Trigger.dev?▼

Import task from @trigger.dev/sdk and define it with an id, retry configuration, and a run function receiving a typed payload. Export the task from a file in your trigger directory, then trigger it from backend code using tasks.trigger.

How do I schedule cron jobs with Trigger.dev?▼

Use schedules.task with a cron pattern and optional IANA timezone for declarative schedules, or call schedules.create imperatively for dynamic multi-tenant schedules with externalId and deduplicationKey.

Why does triggerAndWait not return my task output directly?▼

triggerAndWait returns a Result object, not the raw output. Check result.ok before accessing result.output, or call .unwrap() to get the output directly and throw on failure.

Can I use Promise.all with Trigger.dev wait or trigger calls?▼

No. Wrapping triggerAndWait, batchTriggerAndWait, or wait calls in Promise.all or Promise.allSettled is not supported in Trigger.dev tasks and will break execution.

How do I prevent duplicate task executions in Trigger.dev?▼

Use idempotency keys created with idempotencyKeys.create and pass them with an idempotencyKeyTTL when triggering. For rapid repeated triggers, use debouncing with a key, delay, and leading or trailing mode.

Is client.defineJob still supported in Trigger.dev v4?▼

No. client.defineJob is deprecated v2 syntax and breaks applications. Always use task, schemaTask, or schedules.task from @trigger.dev/sdk instead.