Celery – Get task id for current task
UPDATE: use Balthazar’s answer for Celery 3.1+ @task(bind=True) def do_job(self, path): cache.set(self.request.id, operation_results) Feel free to upvote his answer. Old answer: Since Celery 2.2.0, information related to the currently executed task is saved to task.request (it’s called «the context»). So you should get task id from this context (not from keyword arguments, which are deprecated): … Read more