Skip to main content

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"
}
)
info

The get_tasks function has a maximum limit of 10,000 records per request. If you need to retrieve more than 10,000 tasks, use the iter_tasks function instead, which handles pagination automatically for large datasets.

Parameters

ParameterDescriptionType
limitSpecifies the maximum number of tasks to return in a single response.int
offsetSpecifies the number of records to skip before starting to return the results.int
whereSpecifies 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