In today's digital ecosystem, your business doesn't run on a single application—it runs on a symphony of specialized tools. Slack handles communication, Stripe manages payments, your CRM tracks customers, and a dozen other apps perform critical functions. The challenge? These tools often live in isolated silos, forcing you into tedious, manual work to keep everything in sync.
What if you could build bridges between these applications? What if a new sale in Stripe could instantly post a celebration message in Slack? What if a daily sales report could automatically generate and land in your inbox every morning at 9 AM?
This isn't just a fantasy; it's the power of event-driven automation. With trigger.do, you can turn your collection of standalone apps into a cohesive, automated powerhouse. It's time to trigger anything and automate everything.
At its heart, event-driven automation is simple: when something happens (an event), do something else (an action).
Event: A customer's subscription payment succeeds in Stripe.
Action: A "thank you" email is sent, and an invoice is generated.
Event: It's 5:00 PM on a Friday.
Action: A workflow runs to back up critical databases.
This "if-this-then-that" logic is the foundation of modern automation. Workflow trigger mechanisms are the key, listening for specific events and initiating predefined business processes. This is precisely where trigger.do shines, acting as the central nervous system for your digital operations.
So, how do you get apps like Stripe and Slack to talk to each other? The magic ingredient is often a webhook.
Think of a webhook as a special phone number for an application. When a specific event occurs (like a new sale), one app can call the webhook URL of another to deliver a message containing all the details of that event.
trigger.do makes webhook automation incredibly simple. When you create a webhook trigger, we provide a unique URL. You simply paste this URL into the settings of a third-party service like Stripe, GitHub, or any other app that supports webhooks. Now, whenever an event happens in that service, it will securely send the data to trigger.do, which will kick off your designated workflow.
Example: Real-Time Sales Alerts in Slack
The result is instant visibility for your team without anyone having to lift a finger.
Automation isn't just about reacting to events—it's also about being proactive. Many essential business processes need to run on a fixed schedule, like daily, weekly, or at the end of each month. This is where scheduled tasks come in.
trigger.do uses standard cron syntax, a powerful and universally understood way to define schedules. You can create a trigger that runs a workflow at any interval you can imagine.
Let's look at a simple code example for creating a daily trigger.
import { Trigger } from '@do-sdk/agent';
// Create a new trigger that runs a workflow every day at 9 AM UTC
const dailyReportTrigger = new Trigger({
name: 'daily-sales-report',
schedule: '0 9 * * *', // Cron expression for 9:00 AM daily
workflow: 'generate-sales-report',
input: {
period: 'daily',
recipients: ['team@example.com']
}
});
await dailyReportTrigger.enable();
console.log(`Trigger '${dailyReportTrigger.name}' is now active.`);
In this case, the generate-sales-report workflow is triggered automatically every single day. This workflow could connect to the Stripe API, pull all sales data from the previous 24 hours, format it into a PDF, and email it to the leadership team. It's a set-and-forget process that delivers consistent value.
While webhooks and schedules cover a vast range of use cases, sometimes you need to initiate a workflow from within your own custom application. An API trigger allows you to do just that.
With a simple, authenticated API call to trigger.do, you can launch any workflow on-demand. This turns complex business logic into a simple, reusable service.
Example: New User Onboarding
By combining the power of webhooks, schedules, and API triggers, trigger.do provides a complete toolkit for building robust, event-driven integrations. Stop wasting time on manual data entry and repetitive tasks. Start connecting your apps and automating your business logic to create seamless, efficient, and intelligent workflows.
What kinds of events can I use with trigger.do?
You can use a variety of events, including time-based schedules (using cron syntax), incoming webhooks from external services, and internal system events from other .do agents or services.
How do I create a trigger for a webhook?
You can define a new trigger and specify its type as 'webhook'. The platform will provide a unique URL to receive incoming HTTP POST requests, which will then execute your designated workflow.
Can I pass data from the trigger to my workflow?
Yes. For webhooks, the entire request body is passed as input to the workflow. For scheduled triggers, you can define a static JSON object to be used as the input each time the workflow runs.
How does trigger.do handle webhook security?
Security is paramount. Webhook triggers can be secured using secret keys for signature verification, ensuring that only authorized services can initiate your workflows.