Trigger authoring tasks

From code-with-antonio/browser-automation-app · View interactive version

Trigger authoring tasks is an AI agent skill from the GitHub repository code-with-antonio/browser-automation-app. Covers writing backend Trigger.dev tasks with @trigger.dev/sdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and concurrency, idempotency keys, run metadata, logging, triggering other tasks (and the Result shape), scheduled/cron tasks, and the essentials of

How to use this skill

Skill file

Authoring Trigger.dev Tasks

The full, version-pinned reference for authoring tasks ships inside your installed @trigger.dev/sdk. Read it before writing code — it always matches the SDK version in this project, so it never drifts:

If those paths don't exist, @trigger.dev/sdk isn't installed yet — install it first. In a non-hoisted layout, resolve the package with node -p "require.resolve('@trigger.dev/sdk/package.json')" and read skills/ + docs/ beside it.

Always import from @trigger.dev/sdk — never @trigger.dev/sdk/v3 (deprecated alias) or @trigger.dev/core.

Common mistakes

  1. CRITICAL: Treating the wait result as the output. triggerAndWait and wait.forToken return a Result object, not the raw output.
  1. Wrapping triggerAndWait / batchTriggerAndWait / wait in Promise.all.
  1. Importing the task instance into backend code.
  1. Calling metadata.set/get outside run().
  1. Assuming child tasks inherit the parent's queue or metadata.
  1. Bundling native/WASM packages.
  1. Relying on a raw string idempotency key being global.

References

Sibling skills: trigger-realtime-and-frontend (subscribe to runs, trigger from the frontend), trigger-authoring-chat-agent and trigger-chat-agent-advanced (AI chat agents).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.