code: def _create_chain_entry(user_id, task_id, task_class, args, kwargs, callbacks, parent=None):
      
      LOGGER.debug(task_class)
      if issubclass(task_class.__class__, UserTaskMixin):
          arguments_dict = task_class.arguments_as_dict(*args, **kwargs)
          name = task_class.generate_name(arguments_dict)
          total_steps = task_class.calculate_total_steps(arguments_dict)
          parent_name = kwargs.get('user_task_name', '')
          with transaction.atomic():
              if parent is None:
                  # First task in the chain, create a status record for it
                  parent = UserTaskStatus.objects.create(
                      is_container=True, name=parent_name, task_class='celery.chain', task_id=str(uuid4()),
                      total_steps=0, user_id=user_id)
              UserTaskStatus.objects.create(
                  name=name, parent=parent, task_class=task_class, task_id=task_id, total_steps=total_steps,
                  user_id=user_id)
              parent.increment_total_steps(total_steps)
              if parent_name and not parent.name:
                  parent.set_name(parent_name)
      for callback in callbacks:
          links = callback.options.get('link', [])
          callback_class = import_string(callback.task)
          _create_chain_entry(user_id, callback.id, callback_class, callback.args, callback.kwargs, links, parent=parent)
docs: Create and update status records for a new :py:class:`UserTaskMixin` in a Celery chain.