Trigger Types
| Type | Description | Use Case |
|---|---|---|
cron | Time-based scheduling | Daily/weekly scans |
event | Event-driven execution | React to discoveries |
watch | File change detection | Process new data |
manual | On-demand only | Placeholder trigger |
Cron Triggers
Execute workflows on a schedule using cron expressions.Workflow Definition
Cron Expression Format
Common Schedules
| Expression | Description |
|---|---|
0 * * * * | Every hour |
0 2 * * * | Daily at 2 AM |
0 0 * * 0 | Weekly on Sunday |
0 0 1 * * | Monthly on the 1st |
*/15 * * * * | Every 15 minutes |
0 9-17 * * 1-5 | Hourly 9-5 weekdays |
Event Triggers
Execute workflows in response to events.Workflow Definition
Event Topics
Topics support glob patterns for flexible matching:| Topic | Description |
|---|---|
run.started | Workflow run started |
run.completed | Workflow run completed |
run.failed | Workflow run failed |
step.completed | Step completed |
assets.new | New asset discovered |
vulnerabilities.new | New vulnerability found |
Event Filters
JavaScript expressions to filter events:filter_functions:
Event Input Mapping
Two syntaxes are supported: New exports-style syntax (recommended):Event Template Variables
Event-triggered workflows have access to these template variables:| Variable | Description |
|---|---|
{{EventEnvelope}} | Full JSON event envelope |
{{EventTopic}} | Event topic |
{{EventSource}} | Event source |
{{EventDataType}} | Data type |
{{EventTimestamp}} | Event timestamp |
Watch Triggers
Execute workflows when files change. Uses fsnotify for instant inotify-based file system notifications.Workflow Definition
Watch Configuration
| Field | Type | Description |
|---|---|---|
path | string | Directory or file path to watch |
debounce | string | Optional debounce duration (e.g., “500ms”, “1s”, “2s”) |
Debounce
When files are modified rapidly (e.g., during a write operation), multiple events may fire. Usedebounce to consolidate rapid changes into a single trigger:
Watch Events
| Event | Description |
|---|---|
create | New file created |
modify | File modified |
delete | File deleted |
rename | File renamed |
API Management
List Schedules
Create Schedule
Enable/Disable
Trigger Manually
Delete Schedule
Combined Triggers
A workflow can have multiple triggers:Event Emission
Emit events from workflows:Database Storage
Schedules are stored in the database:Best Practices
- Use descriptive trigger names
- Start with disabled triggers during testing
- Set reasonable intervals to avoid overload
- Use event filters to reduce noise
- Monitor trigger execution via event logs
- Combine with distributed mode for scale
Troubleshooting
Schedule not running
Events not triggering
Watch not detecting changes
Next Steps
- Distributed Execution - Scale with workers
- Server CLI - Server setup
- API Overview - Schedule endpoints