// [START tasks_within_transactions] from google.appengine.api import taskqueue from google.appengine.ext import ndb @ndb.transactional def do_something_in_transaction(): taskqueue.add(url='/path/to/my/worker', transactional=True) #... do_something_in_transaction() // [END tasks_within_transactions] // [START deleting_tasks] from google.appengine.api import taskqueue # Delete an individual task... q = taskqueue.Queue('queue1') q.delete_tasks(taskqueue.Task(name='foo')) // [END deleting_tasks] // [START purging_tasks] from google.appengine.api import taskqueue # Purge entire queue... q = taskqueue.Queue('queue1') q.purge() // [END purging_tasks]