trigger-authoring-tasks

Guides authoring of Trigger.dev backend tasks with the @trigger.dev/sdk.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/paramcodes/autobro --skill trigger-authoring-tasks-paramcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trigger-authoring-tasks
Source: https://github.com/paramcodes/autobro/tree/main/.cursor/skills/trigger-authoring-tasks
Command: npx skills add https://github.com/paramcodes/autobro --skill trigger-authoring-tasks-paramcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk.

What problem does it solve? Writing background jobs with Trigger.dev involves many subtle APIs—task() vs schemaTask(), retries, waits, queues, idempotency keys, and the Result shape of triggered runs—and small mistakes (like treating a wait result as raw output) cause silent bugs. This Skill loads the version-pinned authoring reference bundled inside your installed @trigger.dev/sdk so the guidance always matches your SDK version. ## Core Features & Use Cases - Version-pinned reference loading: Points the AI to the SKILL.md and docs shipped inside node_modules/@trigger.dev/sdk, eliminating drift between documentation and installed code. - Common mistake prevention: Covers critical pitfalls such as misreading triggerAndWait results, wrapping waits in Promise.all, importing task instances into backend code, and misusing metadata outside run(). - Use Case: You are adding a new scheduled email sequence in your /trigger directory. Load this Skill so the AI writes the schemaTask with correct retries, idempotency keys, and trigger.config.ts settings on the first attempt. ## Quick Start Use the trigger-authoring-tasks skill to write a new Trigger.dev task in my /trigger directory that retries on failure and triggers a child task.

Frequently Asked Questions about trigger-authoring-tasks

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

FAQPage Schema
How do I write a Trigger.dev task with schema validation?▼

Define a schemaTask() from @trigger.dev/sdk with a schema-validated payload and a run function receiving the payload and ctx. The full version-pinned guide ships at node_modules/@trigger.dev/sdk/skills/trigger-authoring-tasks/SKILL.md inside your installed SDK.

How do I trigger one Trigger.dev task from another?▼

Use childTask.triggerAndWait(payload) or batchTriggerAndWait for multiple runs, then check the returned Result object with r.ok and read r.output. Never wrap triggerAndWait calls in Promise.all; use batchTriggerAndWait or a sequential loop instead.

Why does triggerAndWait not return my task output directly?▼

triggerAndWait and wait.forToken return a Result object, not the raw output. Access the output via r.output after checking r.ok, or call .unwrap() to get the output or throw on failure.

Can I import a Trigger.dev task instance into a route handler?▼

No, importing the task instance into backend code is incorrect. Import only the type and call tasks.trigger<typeof myTask>("task-id", payload) so the task is triggered through the SDK rather than executed in-process.

How do I make Trigger.dev task triggers idempotent?▼

Create an idempotency key with await idempotencyKeys.create("my-key", { scope: "global" }) for once-ever semantics. A raw string idempotencyKey option is only globally scoped in SDK v4.3.0 and earlier.

Why does my Trigger.dev build fail with sharp or sqlite3?▼

Native and WASM packages like sharp, re2, sqlite3, or WASM modules cannot be bundled by default. Add them to build.external in trigger.config.ts so they are resolved at runtime instead of bundled.