In the world of AI applications and agentic workflows, reacting to real-time events and data changes is crucial for building intelligent and responsive systems. When data shifts, new opportunities arise, and your applications need to be ready to act. But how do you elegantly kick off complex processes or specific actions the moment something happens? This is where trigger.do shines.
trigger.do is a powerful enabler within the .do platform, designed to provide a simple and efficient way to initiate any process, workflow, or action you've defined, precisely when you need it. No more polling databases or building complex event listeners from scratch. With trigger.do, a single API call is all it takes to set your automation in motion.
Imagine you have an AI agent monitoring customer support tickets. The moment a high-priority ticket is created (a data change!), you want to immediately initiate a workflow that notifies the relevant team, gathers customer history, and drafts a preliminary response. trigger.do allows you to connect that data change event directly to the "high-priority ticket workflow" defined within your .do environment.
The core functionality of trigger.do revolves around a straightforward API. This means you can integrate triggering capabilities directly into your existing applications, services, or even other workflows. Whether you're building a front-end application that needs to initiate a process when a user performs an action, a backend service reacting to database updates, or an external system needing to communicate with your AI agents, trigger.do makes it simple.
Here's a quick look at how easy it is to use the trigger.do SDK:
import { Do } from "@do/sdk";
const doClient = new Do({
apiKey: "YOUR_API_KEY"
});
async function triggerWorkflow() {
try {
const result = await doClient.trigger(
"your-workflow-id",
{
payload: {
"user_id": "abc123",
"event_type": "user_registered"
}
}
);
console.log("Trigger successful:", result);
} catch (error) {
console.error("Failed to trigger workflow:", error);
}
}
triggerWorkflow();
This simple code snippet demonstrates how to trigger a process and even pass relevant data as part of the trigger call.
Beyond simply kicking off a workflow, trigger.do allows you to pass custom data payloads. This is essential for providing context to the initiated workflow or action. When triggering a workflow based on a data change, you can include the details of that change in the payload. For example, if a user profile is updated, you could trigger a workflow and include the user_id and the specific fields that were modified. This data can then be used by your workflow to perform tailored actions.
So, how do you know what to trigger? Within the .do platform, you can define and manage your workflows and actions. Each of these has a unique ID. You can easily find these IDs within the platform interface, ready to be used in your API calls. This provides clear visibility and control over the processes you're triggering.
trigger.do is the bridge between data changes and dynamic automation in your AI applications. By providing a simple, API-driven way to initiate workflows and actions, it empowers you to build highly responsive and intelligent systems that react instantly to the world around them.
Ready to instantly activate your agentic workflows based on data changes? Explore trigger.do on the .do platform and give your AI applications the power of instant action.
What is trigger.do?
trigger.do allows you to initiate any process, workflow, or action defined within your .do environment by making a simple API call.
Can I pass data when triggering an event?
Yes, you can pass custom data payloads with your trigger calls to provide context and information for the initiated workflow or action.
How do I find the ID of the workflow or action I want to trigger?
You can find your unique workflow or action IDs within the .do platform interface.