Unlock the true power of your AI applications and agentic workflows by making them data-aware. With trigger.do, you can initiate any defined process, workflow, or action within your .do environment, not just as a stateless event, but with the rich context of relevant data. This ability to pass custom payloads transforms simple automation into intelligent, reactive systems.
Imagine you've built an agentic workflow that processes new customer sign-ups. Without data, you can only trigger a generic "new user" event. But what if you need to know who signed up, when, and from where? Passing this information directly within your trigger call allows your workflow to immediately personalize its response, initiate tailored onboarding sequences, or perform specific actions based on the user's attributes.
This enables a new level of sophistication in your applications:
Passing data with trigger.do is incredibly straightforward. When you make an API call to trigger a workflow or action, you include a payload object in the request body. This payload can contain any JSON-serializable data – strings, numbers, booleans, objects, arrays – whatever information is relevant to the process you are initiating.
Here's a look at how it works using the @do/sdk (you can also achieve this via direct API calls or other libraries):
In this example, we're passing a payload containing the user_id, event_type, signup_source, and timestamp. Within your .do workflow or action, you can then access and utilize this data to drive the subsequent steps and logic.
Agentic workflows thrive on information. By easily passing data with trigger.do, you empower your AI agents to perform more intelligent and nuanced tasks. They can:
[Start Anything Now]
Ready to build more intelligent, data-driven automations and agentic workflows? Start integrating trigger.do into your applications today.
FAQs
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", // Your unique workflow or action ID
{
payload: { // The data payload you want to pass
"user_id": "abc123",
"event_type": "user_registered",
"signup_source": "marketing_campaign_q3",
"timestamp": new Date().toISOString()
}
}
);
console.log("Trigger successful:", result);
} catch (error) {
console.error("Failed to trigger workflow:", error);
}
}
triggerWorkflow();