Concept map
| n8n | Trigger.dev |
|---|---|
| Workflow | task plus its config (queue, retry, onFailure) |
| Schedule Trigger | schedules.task |
| Webhook node | Route handler + task.trigger() |
| Node | A step or library call inside run() |
| Execute Sub-workflow node (wait for completion) | tasks.triggerAndWait() |
| Execute Sub-workflow node (execute in background) | tasks.trigger() |
| Loop over N items → Execute Sub-workflow → Merge | tasks.batchTriggerAndWait() |
| Loop Over Items (Split in Batches) | for loop or .map() |
| IF / Switch node | if / switch statements |
| Wait node (time interval or specific time) | wait.for() or wait.until() |
| Error Trigger node / Error Workflow | onFailure hook (both collapse into one concept in Trigger.dev) |
| Continue On Fail | try/catch around an individual step |
| Stop And Error | throw new Error(...) |
| Code node | A function or step within run() |
| Credentials | Environment variable secret |
| Execution | Run (visible in the dashboard with full logs) |
| Retry on Fail (per-node setting) | retry.maxAttempts (retries the whole run(), not a single step) |
| AI Agent node | Any AI SDK called inside run() (Vercel AI SDK, Claude SDK, OpenAI SDK, etc.) |
| Respond to Webhook node | Route handler + task.triggerAndWait() returning the result as HTTP response |
Setup
Create an account
Go to Trigger.dev Cloud, create an account, and create a project.
Install the CLI and initialize
trigger/ directory for your tasks.Common patterns
Webhook trigger
In n8n you use a Webhook trigger node, which registers a URL that starts the workflow. In Trigger.dev, your existing route handler receives the webhook and triggers the task:Chaining steps (Sub-workflows)
In n8n you use the Execute Sub-workflow node to call another workflow and wait for the result. In Trigger.dev you usetriggerAndWait():
trigger/process-batch.ts
Error handling
In n8n you use Continue On Fail on individual nodes and a separate Error Workflow for workflow-level failures. In Trigger.dev:- Use
try/catchfor recoverable errors at a specific step - Use the
onFailurehook for workflow-level failure handling - Configure
retryfor automatic retries with backoff
trigger/import-data.ts
Waiting and delays
In n8n you use the Wait node to pause a workflow for a fixed time or until a webhook is called. In Trigger.dev:trigger/send-followup.ts
wait.createToken() to generate a URL, send that URL to the external system, then pause with wait.forToken() until the external system POSTs to that URL to resume the run.
trigger/approval-flow.ts
Full example: customer onboarding workflow
Here’s how a typical back office onboarding workflow translates from n8n to Trigger.dev. The n8n setup: Webhook Trigger → HTTP Request (provision account) → HTTP Request (send welcome email) → HTTP Request (notify Slack) → Wait node (3 days) → HTTP Request (check activation) → IF node → HTTP Request (send follow-up). In Trigger.dev, the same workflow is plain TypeScript:trigger/onboard-customer.ts

