Triggers.do  - Event-Driven Workflow Initiation
Initiate workflows based on events from various sources
Overview
Triggers.do provides a framework for defining and handling events that initiate workflows. This event-driven system allows your AI applications to respond to:
- Webhook events from external systems
- Scheduled time-based events
- User actions and interactions
- System state changes
- Data changes and updates
Features
- Multiple Trigger Types: Webhooks, schedules, database changes, and more
- Event Filtering: Process only relevant events based on conditions
- Data Transformation: Shape event data before passing to workflows
- Reliable Delivery: Ensure events are processed even during outages
- Debugging Tools: Trace and replay events for troubleshooting
Usage
import { defineTrigger } from 'triggers.do'
// Define a webhook trigger for new orders
const newOrderTrigger = defineTrigger({
name: 'newOrder',
type: 'webhook',
description: 'Triggers when a new order is created',
// Define the endpoint configuration
endpoint: {
path: '/webhooks/new-order',
method: 'POST',
auth: { type: 'api-key', headerName: 'X-API-Key' },
},
// Define the payload schema
schema: {
orderId: { type: 'string', required: true },
customerId: { type: 'string', required: true },
items: { type: 'array' },
totalAmount: { type: 'number', required: true },
},
// Connect to the target workflow
target: 'processNewOrder',
})
Last updated on