@@ -6,29 +6,31 @@ sidebarTitle: "Migrating from n8n"
66
77If you've been building with n8n and are ready to move to code-first workflows, this guide is for you. This page maps them to their Trigger.dev equivalents and walks through common patterns side by side.
88
9+ Your task code runs on Trigger.dev's managed infrastructure, so there are no servers for you to provision or maintain.
10+
911## Concept map
1012
11- | n8n | Trigger.dev |
12- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
13- | Workflow | [ ` task ` ] ( /tasks/overview ) plus its config (` queue ` , ` retry ` , ` onFailure ` ) |
14- | Schedule Trigger | [ ` schedules.task ` ] ( /tasks/scheduled ) |
15- | Webhook node | Route handler + [ ` task.trigger() ` ] ( /triggering ) |
16- | Node | A step or library call inside ` run() ` |
17- | Execute Sub-workflow node (wait for completion) | [ ` tasks.triggerAndWait() ` ] ( /triggering#yourtask-triggerandwait ) |
18- | Execute Sub-workflow node (execute in background) | [ ` tasks.trigger() ` ] ( /triggering ) |
19- | Loop over N items → Execute Sub-workflow → Merge | [ ` tasks.batchTriggerAndWait() ` ] ( /tasks#yourtask-batchtriggerandwait ) |
20- | Loop Over Items (Split in Batches) | ` for ` loop or ` .map() ` |
21- | IF / Switch node | ` if ` / ` switch ` statements |
22- | Wait node (time interval or specific time) | [ ` wait.for() ` ] ( /wait-for ) or [ ` wait.until() ` ] ( /wait-until ) |
23- | Error Trigger node / Error Workflow | [ ` onFailure ` ] ( /tasks/overview#onfailure-function ) hook (both collapse into one concept in Trigger.dev) |
24- | Continue On Fail | ` try/catch ` around an individual step |
25- | Stop And Error | ` throw new Error(...) ` |
26- | Code node | A function or step within ` run() ` |
27- | Credentials | [ Environment variable secret] ( /deploy-environment-variables ) |
28- | Execution | Run (visible in the dashboard with full logs) |
29- | Retry on Fail (per-node setting) | [ ` retry.maxAttempts ` ] ( /tasks/overview#retry ) (retries the whole ` run() ` , not a single step) |
30- | AI Agent node | Any AI SDK called inside ` run() ` (Vercel AI SDK, Claude SDK, OpenAI SDK, etc.) |
31- | Respond to Webhook node | Route handler + [ ` task.triggerAndWait() ` ] ( /triggering#yourtask-triggerandwait ) returning the result as HTTP response |
13+ | n8n | Trigger.dev |
14+ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
15+ | Workflow | [ task] ( /tasks/overview ) plus its config (queue, retry, onFailure) |
16+ | Schedule Trigger | [ schedules.task] ( /tasks/scheduled ) |
17+ | Webhook node | Route handler + [ task.trigger()] ( /triggering ) |
18+ | Node | A step or library call inside ` run() ` |
19+ | Execute Sub-workflow node (wait for completion) | [ tasks.triggerAndWait()] ( /triggering#yourtask-triggerandwait ) |
20+ | Execute Sub-workflow node (execute in background) | [ tasks.trigger()] ( /triggering ) |
21+ | Loop over N items → Execute Sub-workflow → Merge | [ tasks.batchTriggerAndWait()] ( /tasks#yourtask-batchtriggerandwait ) |
22+ | Loop Over Items (Split in Batches) | ` for ` loop or ` .map() ` |
23+ | IF / Switch node | ` if ` / ` switch ` statements |
24+ | Wait node (time interval or specific time) | [ wait.for()] ( /wait-for ) or [ wait.until()] ( /wait-until ) |
25+ | Error Trigger node / Error Workflow | [ onFailure] ( /tasks/overview#onfailure-function ) hook (both collapse into one concept in Trigger.dev) |
26+ | Continue On Fail | ` try/catch ` around an individual step |
27+ | Stop And Error | ` throw new Error(...) ` |
28+ | Code node | A function or step within ` run() ` |
29+ | Credentials | [ Environment variable secret] ( /deploy-environment-variables ) |
30+ | Execution | Run (visible in the dashboard with full logs) |
31+ | Retry on Fail (per-node setting) | [ retry.maxAttempts] ( /tasks/overview#retry ) (retries the whole ` run() ` , not a single step) |
32+ | AI Agent node | Any AI SDK called inside ` run() ` (Vercel AI SDK, Claude SDK, OpenAI SDK, etc.) |
33+ | Respond to Webhook node | Route handler + [ task.triggerAndWait()] ( /triggering#yourtask-triggerandwait ) returning the result as HTTP response |
3234
3335---
3436
@@ -76,18 +78,6 @@ In Trigger.dev, your existing route handler receives the webhook and triggers th
7678
7779<CodeGroup >
7880
79- ``` ts trigger/process-webhook.ts
80- import { task } from " @trigger.dev/sdk" ;
81-
82- export const processWebhook = task ({
83- id: " process-webhook" ,
84- run : async (payload : { event: string ; data: Record <string , unknown > }) => {
85- // handle the webhook payload
86- await handleEvent (payload .event , payload .data );
87- },
88- });
89- ```
90-
9181``` ts app/api/webhook/route.ts
9282import { processWebhook } from " @/trigger/process-webhook" ;
9383
@@ -103,6 +93,18 @@ export async function POST(request: Request) {
10393}
10494```
10595
96+ ``` ts trigger/process-webhook.ts
97+ import { task } from " @trigger.dev/sdk" ;
98+
99+ export const processWebhook = task ({
100+ id: " process-webhook" ,
101+ run : async (payload : { event: string ; data: Record <string , unknown > }) => {
102+ // handle the webhook payload
103+ await handleEvent (payload .event , payload .data );
104+ },
105+ });
106+ ```
107+
106108</CodeGroup >
107109
108110---
0 commit comments