What is the difference between bound and unbound tasks?

Beginner

Answer

  • Unbound tasks: Regular tasks that don't have access to the task instance
  • Bound tasks: Tasks that receive self as the first argument, providing access to task metadata
# Bound task
@app.task(bind=True)
def debug_task(self):
    print(f'Request: {self.request!r}')