Triggers
Overview
To execute a specific task, Performer node invokes the Execution Service using taskDefinitionId
. Othentic framework allows you to customize the logic to trigger a task based on the different use cases.
API Call
Tasks can be manually triggered by sending an HTTP request to the Execution Service.
You can expose an endpoint (e.g., /task/execute
) that allows Operator nodes (Performers) to initiate task execution. This can be done using curl
or any HTTP client.
curl -X POST \
http://localhost:4003/task/execute \
-H 'Content-Type: application/json' \
-d '{
"taskDefinitionID": "your_task_definition_id"
}'
Event-based
Tasks can be automatically triggered based on external events or conditions. This includes factors like data changes, user actions, or events from external systems that indicate the task should be executed. The system listens for specific events and executes tasks when conditions are met.
Implementation
Monitor specific contract addresses for predefined event signatures
Parse and decode emitted events from transaction logs
Trigger task execution when qualifying events occur
Time-based
Tasks can be scheduled to trigger at specific times or after certain time intervals.
Queue-based
Tasks can be queued and executed in order of arrival or priority. A task enters a queue and is executed when its turn comes, or when resources become available.
Custom
Triggers may include specific conditions or thresholds that must be met before the task is executed. For example, a task might be triggered when a user reaches a specific condition in an application or when a predefined error threshold is exceeded.
Last updated