Scheduling & Events
Scheduling
- Quartz-backed schedules per workflow (CRON string in
workflow.schedule
). - Endpoints:
GET /v1/vaiworkflow/loadSchedules
to reload. - Service:
scheduleWorkflow(Workflow)
registers jobs and triggers.
Event-driven triggers
- Register:
POST /v1/vaiworkflow/{workflowId}/triggers
with{ "eventType": "order.created" }
. - Publish:
POST /v1/vaiworkflow/event
with{ "type": "order.created", "payload": {...} }
. - Runtime maps event type to workflows and starts the execution asynchronously.
Usage pattern
- Combine schedules for periodic runs and events for instant reactions.
WorkflowEventBus
wraps Spring’s ApplicationEventPublisher.