When building automated systems, especially complex agentic workflows in AI applications, deciding how to initiate those processes is a critical decision. You generally have two primary paths: building a traditional API endpoint yourself or utilizing a dedicated triggering service like trigger.do. Both approaches have their merits, and understanding the differences is key to choosing the right method for your needs.
A traditional API endpoint is typically a dedicated URL on your server that listens for incoming requests (like HTTP POST requests). When a request arrives, your code on the server parses the request, validates the data, and then kicks off the desired workflow or action.
Pros of Traditional APIs:
Cons of Traditional APIs:
trigger.do is specifically designed to be a streamlined service for initiating workflows and actions within the .do platform. Instead of building and managing custom API endpoints for each process, you define your workflows and actions within .do, and then use trigger.do to kick them off with a simple API call to the trigger.do service.
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();
Pros of Trigger.do:
Cons of Trigger.do:
The best approach depends on your specific needs and the complexity of your automation.
Choose Traditional APIs when:
Choose Trigger.do when:
For users leveraging the power of the .do platform to build agentic workflows and AI applications, trigger.do offers a highly efficient and streamlined method for initiating those processes. It removes the need to build boilerplate API infrastructure, allowing you to focus on the core intelligence and actions of your applications. While traditional APIs remain a valid approach for general-purpose integrations, trigger.do is the purpose-built solution for instantly activating your .do-powered automations.
Start Anything Now
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.