Skip to main content

Get trigger task (Tasklet)

Stages of the type "Tasklet" are executed once when a task arrives at them. In these stages, you can simply call the function get_trigger_task to retrieve the task that triggered the run of this stage.

from abstra.tasks import get_trigger_task

task = get_trigger_task()
# do some processing
task.complete()

This function returns an instance of the class Task.

info

This function will raise an exception if the stage is not of type "Tasklet".