https://trigger.dev Showcase Blog Changelog Docs Pricing Star 4.7k Login Get started Light rays Get involved in Hacktoberfest 2023 The open source Background Jobs framework for TypeScript Create long-running Jobs directly in your codebase with features like API integrations, webhooks, scheduling and delays. What is Trigger.dev? (in 2 minutes) Get started now Supported frameworks See it in action: 1. Webhook 2. Event 3. Scheduled * subscription.ts 1 client.defineJob({ 2 id: "subscription-plan-changed", 3 name: "Subscription plan changed", 4 version: "0.1.1", 5 integrations: { slack, resend }, 6 trigger: stripe.customer.subscriptionUpdated(), 7 run: async (payload, io, ctx) => { 8 const user = await db.users.find({ stripeId: payload.customer }); 9 10 const planId = getNewPlanId(payload); 11 12 if (user.planId !== planId) { 13 await db.users.update(user.id, { planId }); 14 15 await io.resend.sendEmail("Plan changed email", { 16 to: user.email, 17 from: "[email protected]", 18 subject: "Your plan has changed", 19 html: planEmail(payload), 20 }); 21 22 if (isPlanUpgraded(user.planId, planId)) { 23 await io.slack.postMessage("Notify team", { 24 text: `Plan upgraded for ${user.email} to ${planId}`, 25 channel: "subscriptions", 26 }); 27 } 28 } 29 }, 30 }); A Webhook example When a customer's Stripe subscription updates, check if their plan has changed. If it has, update it in your database, send them an email, and notify the team of upgrades. * tweet-generator.ts 1 client.defineJob({ 2 id: "tweet-generator", 3 name: "Generate tweets from an idea", 4 version: "0.1.4", 5 integrations: { openai, twitter }, 6 trigger: eventTrigger({ 7 name: "tweet.idea", 8 schema: z.object({ 9 idea: z.string(), 10 scheduledTime: z.date(), 11 }), 12 }), 13 run: async (payload, io, ctx) => { 14 const generatedTweet = await io.openai.createCompletion("Generate ", { 15 model: "text-davinci-003", 16 prompt: tweetPrompt(payload.idea), 17 }); 18 19 await io.wait("Wait ", { date: payload.scheduledTime }); 20 21 await io.twitter.tweet("Tweet ", { 22 text: generatedTweet, 23 }); 24 }, 25 }); 26 // Send the "tweet.idea" event to trigger the tweet-generator job 27 await client.sendEvent("tweet.idea", { 28 idea: "Write a funny javascript joke", 29 scheduledTime: new Date(), 30 }); An event example When one of your users submits an idea, generate a tweet using OpenAI. Wait until the time they selected, then send the tweet using their Twitter authentication. * weeky-summary.ts 1 client.defineJob({ 2 id: "weekly-user-activity-summary", 3 name: "Weekly user activity summary", 4 version: "0.1.4", 5 integrations: { sendgrid }, 6 trigger: cronTrigger({ 7 cron: "0 16 * * 5", 8 }), 9 run: async (payload, io, ctx) => { 10 const users = await db.users.findMany({ summariesEnabled: true }); 11 12 for (const user of users) { 13 await io.sendgrid.sendEmail(`Weekly summary for ${user.id}`, { 14 to: user.email, 15 from: "[email protected]", 16 subject: "Your weekly summary", 17 html: weeklySummaryEmail(user), 18 }); 19 } 20 21 await io.slack.postMessage("Notify team", { 22 text: `Weekly summary sent to ${users.length} users`, 23 channel: "summaries", 24 }); 25 }, 26 }); A Scheduled example Every Friday at 4pm UTC, get all users who have opted to receive a summary, then send them an email. Notify your team that they've all been sent. Developer-first features Trigger.dev is designed to seamlessly fit into your existing workflow. Long running jobs diagram Long running Jobs on serverless Reliably run Jobs and don't worry about function timeouts, we handle those for you. Auto-resume after a function timeout Auto-resume after a server outage Add delays of up to a year In your codebase Create Jobs where they belong: in your codebase. Version control, localhost, test, review, and deploy like you're already used to. Secure by design We only receive Triggers and the data you choose to send to us. You can even completely self-host the entire platform. Trigger.dev cloud diagram Don't worry about deployment Just use our SDK to write Jobs in your codebase. There's nothing extra to deploy and no CI to configure, your Jobs just connect to our cloud. Or you can always self-host. Full visibility of every Run View every Task in every Run so you can tell exactly what happened. Webapp Step-by-step Follow the flow of a Job from the Trigger to the Tasks. All the details See the input and output data of every Task, including retries and detailed errors. Re-run Jobs Quickly re-run a Job to check if you've fixed a bug. It all starts with a Trigger Trigger Jobs from a webhook, on a schedule or from a custom event. Trigger types Webhooks Subscribe to webhooks without creating API endpoints Full types for payloads Test with examples from the dashboard Works with localhost without tunneling On a schedule Subscribe to a recurring schedule Use human-readable code or CRON syntax Events Define your own custom events Trigger Jobs from anywhere Type safety as standard Webhook overlay client.defineJob({ id: "subscription-plan-changed", name: "Subscription plan changed", version: "0.1.1", integrations: { slack, resend }, trigger: All the integrations you need Easily integrate with hundreds of third-party APIs - including your own. Use our built-in integrations Easily subscribe to webhooks and perform any actions you want. Use an existing Node.js SDK Use io.runTaskto make it resumable and appear in the dashboard OAuth or API key authentication Use API keys (which never leave your server) or let us handle OAuth for you. Bring-your-own authentication Supply your user's auth credentials, using Clerk.com, Nango, or rolling your own with our custom auth resolvers. [airtable-H] [asana-JBDL] [sendgrid-7] [shopify-5E] [slack-IQ53] [stripe-77A] [supabase-Z] [typeform-2] [whatsapp-Q] [zendesk-HU] [mailgun-3H] [notion-N2F] [posthog-RN] [resend-LGH] [salesforce] [airtable-H] [asana-JBDL] [sendgrid-7] [shopify-5E] [slack-IQ53] [stripe-77A] [supabase-Z] [typeform-2] [whatsapp-Q] [zendesk-HU] [mailgun-3H] [notion-N2F] [posthog-RN] [resend-LGH] [salesforce] [airtable-H] [asana-JBDL] [sendgrid-7] [shopify-5E] [slack-IQ53] [stripe-77A] [supabase-Z] [typeform-2] [whatsapp-Q] [zendesk-HU] [mailgun-3H] [notion-N2F] [posthog-RN] [resend-LGH] [salesforce] [openai-UDE] [pagerduty-] [plausible-] [github-QJT] [google-cal] [google-doc] [google-she] [todoist-LM] [trello-FJV] [twilio-45H] [twitter-BT] [discord-JT] [hubspot-FG] [intercom-U] [jira-NURJM] [linear-WPO] [openai-UDE] [pagerduty-] [plausible-] [github-QJT] [google-cal] [google-doc] [google-she] [todoist-LM] [trello-FJV] [twilio-45H] [twitter-BT] [discord-JT] [hubspot-FG] [intercom-U] [jira-NURJM] [linear-WPO] [openai-UDE] [pagerduty-] [plausible-] [github-QJT] [google-cal] [google-doc] [google-she] [todoist-LM] [trello-FJV] [twilio-45H] [twitter-BT] [discord-JT] [hubspot-FG] [intercom-U] [jira-NURJM] [linear-WPO] We are backed by some of the world's best investors, founders & operators Y Combinator Supabase PagerDuty Dropbox Raycast Instabug Atlassian Amazon Web Services Our mission The complete open source background jobs framework We're building the most comprehensive and easy-to-use background jobs framework for developers. Feature What it does Status Integration kit Official Trigger.dev integrations or build your own Self-hosting Host the platform yourself Cloud Just write code, no deployment required Dashboard View every Task in every Run Serverless Long-running Jobs on your serverless backend React hooks Easily update your UI with Job progress Background Offload long or intense tasks to our functions infrastructure React frameworks Support for Remix, Astro, RedwoodJS & more Long-running Run Jobs on your long-running backend servers Polling Triggers Subscribe to changes without webhooks Trigger.dev Use integrations signed in as your users Connect Vercel Easy deploy and preview environment support integration Streaming Receive data from your Jobs in realtime 100+ integrations Comprehensive support for popular APIs File IO Create Tasks that have file outputs We love the open source community. Get involved! Contribute to Trigger.dev Loved by developers "Trigger.dev is redefining background jobs for modern developers." https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ e82deee8-b8ec-4092-3980-b268688d1900/public Paul Copplestone Supabase [public] "Trigger.dev is a great way to automate email campaigns with Resend, and we've heard nothing but good things from our mutual customers." https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 3aca9c05-4563-4924-61df-867ec8434200/public Zeno Rocha Resend [public] "We love Trigger.dev and it's had a big impact in dev iteration velocity already." https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 3e6a3e0f-e4c9-41e9-3881-ffe4cfc50400/public Andre Neves ZBD [public] "Trigger is packaging end-to-end cron, queues and webhooks platform in a really slick interface. Our integration was pretty quick and we love the support [?]" https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 521fe3ce-20f6-4f9b-d8de-b1c3b4724100/public Aseem Gupta Shaktimaan [public] "We've been looking for a product like Trigger.dev for a really long time - automation that's simple and developer-focused. We can finally build and manage Jobs exactly how we'd like to all in our repo." https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 4e3d1187-c27b-4bdc-feac-d2e5297e9a00/public Han Wang Mintlify [public] "I really enjoyed using Trigger.dev to create Jobs through code. I found the API integrations and scheduling features super useful. In general, Trigger was really user-friendly and reliable, and it definitely made my job easier!" https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 36535ea9-56b4-42e3-4e45-ef08d293dd00/public Adam Shiervani BuildJet [public] "Using Trigger.dev for our Slack Jobs saved us loads of time! Surprisingly, it was so much easier to set up than using a no-code tool." https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 9c9e9c2e-5ff1-4227-f0d3-514aa2e49300/public Vlad Matsiiako Infisical [public] "I'm in love with Trigger.dev - it's so much better than the old bull.js + heroku + redis setup that I used to use. You've knocked it out of the park with this tool!" https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/ 6738d30f-ccd5-4342-8764-a2194fc0d900/public Kushal Byatnal Extend [public] Frequently asked questions Can I self-host Trigger.dev? Does my data get sent to your servers? What frameworks does Trigger.dev support? Can I run Trigger.dev locally? Can I build complex Jobs? Can I use version control or roll-backs? How long does it take to code up a Job? Do you have all the API integrations I need? Is Trigger.dev open source? Is Trigger.dev a no/low-code tool like Zapier? Can I use an API which doesn't have webhooks? Can non-coders use this product? Get started today Try for free Documentation Getting started Create a Job Triggers Integrations Self hosting Example Jobs Developers Documentation Changelog Contributing Open source GitHub Product Pricing Showcase Uptime status Company Blog Contact Careers Privacy policy Terms & conditions OSS friends (c) 2023 Trigger.dev