Get tasks
This function retrieves all the pending tasks in a stage satisfying the search filters.
from abstra.tasks import get_tasks
pending_tasks = get_tasks()
for task in pending_tasks:
# do some processing
task.complete()
This function returns a list of instances of the class Task
.
Search filter
You can filter the pending tasks to be retrieved with the search filter parameters.
from abstra.tasks import get_tasks
pending_tasks = get_tasks(
limit=100,
offset=20,
where={
"name": "Michael Scott",
"company": "Dunder Mifflin"
}
)
Parameters
Parameter | Description | Type |
---|---|---|
limit | Specifies the maximum number of tasks to return in a single response. | int |
offset | Specifies the number of records to skip before starting to return the results. | int |
where | Specifies a set of key-value pairs that define the filtering criteria for the query. Each key corresponds to a field in the records, and the value specifies the condition to match. The query will return only the records that satisfy all the specified conditions. | dict |