Triggers
Triggers define how and when workflows start executing. They specify the entry point for your workflow and define the schema for input data. Compozy supports several types of triggers to accommodate different use cases and integration needs.
Trigger Types
Webhook
HTTP endpoints that start workflows when called
Schedule
Time-based triggers using cron expressions
Event
React to system or custom events
Message
Process messages from queues or streams
Configuration
Each trigger type has its own configuration options. Here are examples for each type:
Schema Validation
Triggers support JSON Schema validation for input data. This ensures that workflows only process valid data and fail early if the input doesn’t match the expected format.
Advanced Features
Error Handling
Configure how trigger errors should be handled:
Rate Limiting
Control the rate of workflow executions:
Conditional Execution
Add conditions to control when triggers should start workflows:
API Reference
Type of trigger (webhook, schedule, event, message)
Trigger-specific configuration
JSON Schema for validating trigger input
Error handling configuration
Rate limiting configuration
Template expression for conditional execution
Type of trigger (webhook, schedule, event, message)
Trigger-specific configuration
JSON Schema for validating trigger input
Error handling configuration
Rate limiting configuration
Template expression for conditional execution
Best Practices
Schema Definition
- Always define input schemas
- Validate required fields
- Set appropriate constraints
- Document field purposes
Error Handling
- Configure retry policies
- Implement fallback mechanisms
- Log trigger failures
- Monitor trigger health
Security
- Use HTTPS for webhooks
- Implement authentication
- Validate request origins
- Sanitize input data
Performance
- Set appropriate rate limits
- Configure batch sizes
- Use efficient schemas
- Monitor trigger latency