Retrieve task result by id in Celery

It works using AsyncResult. (see this answer) So first create the task: from cel.tasks import add res = add.delay(3,4) print(res.status) # ‘SUCCESS’ print(res.id) # ‘432890aa-4f02-437d-aaca-1999b70efe8d’ Then start another python shell: from celery.result import AsyncResult from cel.tasks import app res = AsyncResult(‘432890aa-4f02-437d-aaca-1999b70efe8d’,app=app) print(res.state) # ‘SUCCESS’ print(res.get()) # 7

Setting Time Limit on specific task with celery

You can set task time limits (hard and/or soft) either while defining a task or while calling. from celery.exceptions import SoftTimeLimitExceeded @celery.task(time_limit=20) def mytask(): try: return do_work() except SoftTimeLimitExceeded: cleanup_in_a_hurry() or mytask.apply_async(args=[], kwargs={}, time_limit=30, soft_time_limit=10)