Get trigger task
Stages of the type "On task" 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.
info
This function is only supported on stages of type "On task". Otherwise, it will raise an exception.
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
.