What are CloudEvents?
CloudEvents is a specification for describing event data in a common format. Infinitic converts internal messages to CloudEvents, making it easy to:- Monitor workflow and task execution
- Build real-time dashboards
- Integrate with event streaming platforms
- Implement custom alerting and notifications
- Create audit logs
Event Structure
Every CloudEvent from Infinitic follows this structure:Event Fields
- type - Event type (e.g.,
infinitic.workflow.completed) - source - Origin of the event (workflow/service, executor/state engine, name)
- subject - Workflow ID or Task ID
- id - Unique message ID
- time - When the event was published
- data - Event payload with details
Event Types
Infinitic emits CloudEvents for workflows and tasks:Workflow Events
Lifecycle Events
Lifecycle Events
infinitic.workflow.dispatch- Workflow dispatchedinfinitic.workflow.started- Workflow execution startedinfinitic.workflow.completed- Workflow completed successfullyinfinitic.workflow.failed- Workflow failedinfinitic.workflow.canceled- Workflow was canceled
Method Events
Method Events
infinitic.workflow.dispatchMethod- Workflow method dispatchedinfinitic.workflow.methodCompleted- Method completedinfinitic.workflow.methodFailed- Method failedinfinitic.workflow.methodCanceled- Method canceledinfinitic.workflow.methodTimedOut- Method timed out
Task Events (within workflow)
Task Events (within workflow)
infinitic.workflow.taskDispatched- Task dispatched from workflowinfinitic.workflow.taskCompleted- Task completedinfinitic.workflow.taskFailed- Task failedinfinitic.workflow.taskCanceled- Task canceledinfinitic.workflow.taskTimedOut- Task timed outinfinitic.workflow.taskUnknown- Task not found
Remote Method Events
Remote Method Events
infinitic.workflow.remoteMethodDispatched- Child workflow dispatchedinfinitic.workflow.remoteMethodCompleted- Child workflow completedinfinitic.workflow.remoteMethodFailed- Child workflow failedinfinitic.workflow.remoteMethodCanceled- Child workflow canceledinfinitic.workflow.remoteMethodTimedOut- Child workflow timed outinfinitic.workflow.remoteMethodUnknown- Child workflow not found
Signal Events
Signal Events
infinitic.workflow.signal- Signal sent to workflowinfinitic.workflow.signalReceived- Signal received by workflowinfinitic.workflow.signalDiscarded- Signal discarded (workflow not ready)infinitic.workflow.signalDispatched- Signal dispatched to child workflow
Timer Events
Timer Events
infinitic.workflow.timerDispatched- Timer createdinfinitic.workflow.timerCompleted- Timer completed
Executor Events
Executor Events
infinitic.workflow.executorDispatched- Workflow executor startedinfinitic.workflow.executorCompleted- Workflow executor completedinfinitic.workflow.executorFailed- Workflow executor failedinfinitic.workflow.retryExecutor- Retrying workflow executor
Task Events
infinitic.task.dispatch- Task dispatched to serviceinfinitic.task.started- Task execution startedinfinitic.task.completed- Task completed successfullyinfinitic.task.failed- Task failedinfinitic.task.canceled- Task canceledinfinitic.task.retryScheduled- Task retry scheduledinfinitic.task.retryTask- Retrying task
Creating an Event Listener
Implement theCloudEventListener interface to receive events:
Configuring Event Listener
Configure the event listener in your Infinitic setup:Using Builder
Using YAML
Event Filtering
Filter by Workflow
Filter by Service
Filter by Event Type
Implement filtering in your listener:Event Data
Thedata field contains event-specific information:
Workflow Completed Event
Workflow Dispatch Event
Task Failed Event
Use Cases
Real-Time Dashboard
Alerting System
Audit Log
Best Practices
Process events asynchronously
Process events asynchronously
Don’t block event processing with slow operations. Use queues or async handlers.
Handle failures gracefully
Handle failures gracefully
Ensure your event listener doesn’t crash on unexpected event formats or data.
Filter events efficiently
Filter events efficiently
Use allow/disallow lists to reduce the number of events your listener receives.
Use batching for high throughput
Use batching for high throughput
Configure batch settings to process multiple events together for better performance.
Monitor listener health
Monitor listener health
Track event processing latency and errors in your listener.
Store events for analysis
Store events for analysis
Consider storing events in a data warehouse for historical analysis and debugging.
Related Topics
- Monitoring - Build monitoring systems with CloudEvents
- Tags - Access workflow tags in events
- Metadata - Access workflow metadata in events
- Error Handling - Handle error events