Back to Skills

trigger-tasks

Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.

27stars4forksUpdated 6/12/2026

Security Assessment

Safe(100/100)
Security Score100/100

About trigger-tasks

The trigger-tasks skill helps developers build durable background tasks and asynchronous workflows using Trigger.dev. It is designed for work that should run independently from the main application flow, such as long-running jobs, scheduled processes, webhook handling, file processing, and AI agent execution. By leveraging Trigger.dev tasks, developers can create reliable background operations with built-in retry mechanisms, queuing, and execution management, reducing the complexity of implementing resilient asynchronous systems.

The skill covers core Trigger.dev task patterns, including standard tasks, schema-validated tasks, task triggering, batch triggering, task-to-task orchestration, waiting mechanisms, and concurrency controls. It emphasizes important implementation rules such as using the modern `@trigger.dev/sdk`, validating `triggerAndWait()` results through `result.ok`, avoiding unsupported parallel patterns with waits, and exporting tasks from the `trigger/` directory. It also provides guidance for configuring retries, scheduling delayed execution through wait utilities, handling external approvals with tokens, and managing throughput using queues and concurrency limits.

This skill is intended for developers building backend services, workflow automation systems, AI-powered applications, and event-driven architectures. Common use cases include processing webhooks, handling uploaded files, running recurring jobs, coordinating multiple background tasks, managing email processing workloads, and implementing controlled execution pipelines where reliability, observability, and concurrency management are important requirements.

FAQ

When should I use this skill?

Use this skill when creating background jobs, asynchronous workflows, long-running AI agent processes, webhook handlers, file-processing pipelines, or recurring scheduled tasks with Trigger.dev.

Which Trigger.dev SDK should be used?

The skill requires the use of `@trigger.dev/sdk` and explicitly advises against using deprecated `client.defineJob` APIs.

How should results from `triggerAndWait()` be handled?

You should check `result.ok` before accessing `result.output`. Alternatively, you can use `.unwrap()` if you want errors to be thrown automatically.

Can I use `Promise.all()` with task waits or `triggerAndWait()` calls?

No. The documented rules explicitly state that `Promise.all()` should not be used with `triggerAndWait()` or `wait.*` operations.

Are there any file structure requirements?

Yes. Tasks should be exported from files located in the `trigger/` directory.

All Files

4 files
references/scheduled-tasks.md2.6 KB
View
SKILL.md8.0 KB
View
references/basic-tasks.md5.0 KB
View
references/advanced-tasks.md12.1 KB
View

Install trigger-tasks

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill