Task
A task represents a unit of work in Qrambo that requires review. Tasks are created within Queues and assigned to Reviewers. Qrambo ensures each task is assigned to only one reviewer at a time, unless the reviewer has skipped the task. This enables multiple reviewers to work concurrently within the same queue.
If no target_reviewer
is specified, tasks default to ~ANYONE
, allowing any queue reviewer to process them.
Tasks have 2 main components:
- Input Data: The JSON data that needs to be reviewed. This can be any type of content, such as a document, form, video, etc.
- Output Data: The JSON result provided by the reviewer
Here are some examples of input and output data:
Input Data
{
"image_url": "https://example.com/cat.jpg",
"categories": ["cat", "dog", "bird", "other"],
}
Output Data
{
"category": "cat",
// If we showed it to the human we would like to get more information about it
"attributes": {
"color": "orange",
"age": "adult",
"pose": "sitting"
}
}
States - Status
- SCHEDULED
- Task has been scheduled, waiting to be available
- AVAILABLE
- Ready for assignment
- ASSIGNED
- Under active review
- FINISHED
- Review completed successfully
- CANCELED
- Review terminated before completion
- EXPIRED
- Time limit has been exceeded
Lifecycle
⚠️
FINISHED, CANCELED and EXPIRED tasks are immutable states, you change anything related to task anymore.
Properties
- id
- Unique identifier automatically generated by[object Object]
- queue
- The queue this task belongs to
- requester
- The entity that created the task
- input_data
- The data that needs to be reviewed
- status
- The current state of the task
- created_at
- The time when the task was created
- updated_at
- The time when the task was last updated
- expire_at
- The time when the task will expire
- schedule_to
- The time when the task will be scheduled
- global_keys
- A list of global keys that can be used to track the task across different queues
- topic
- A topic that can be used to categorize the task in the queue
- target_reviewer
- The reviewer who will review the task
- priority
- The priority of the task
- output_data
- The review result provided by the reviewer. If provided during task creation, the task will be automatically marked as finished. This can be useful for converting system events into tasks. (kinda hack)
- reviewer
- The entity who performed the review
Features
Related Notification Events
- TASK_SCHEDULED: When a task is scheduled for future
- TASK_CREATED: When a new task is created
- TASK_FINISHED: When a review is completed
- TASK_EXPIRED: When time limit is exceeded
- TASK_CANCELED: When task is canceled
Best Practices
- Set task priorities to ensure critical work is processed first
- Utilize topics for systematic task organization
- Define appropriate expiration timeframes
- Implement global keys for task tracking across queues
- Configure essential state change notifications
- Configure notifications at the queue level rather than task level to maintain flexibility in destination changes
Last updated on