SQL relationship for nested groups
It may help to separate the hierarchy from the task-like objects, and implement them as inherited types. There would be four tables.
TaskTrees
  ParentTaskId   references Tasks.TaskId
  ChildTaskId    references Tasks.TaskId

Tasks
  TaskId
  TaskType      simple or group

GroupTasks
  TaskId   references Tasks.TaskId
  &lt;group specific columns&gt;

SimpleTasks
  TaskId   references Tasks.TaskId
  &lt;other specific columns&gt;

This way the Trees become simple hierarchies of &quot;things&quot; and don't much care what those things are. There are other ways to implement trees than this.
The domain-specific information is held in GroupTasks and SimpleTasks. This is where the values required to implement each is held. There are other ways to implement inheritance. I'm not sufficiently versed in MySQL to recommend one over another.
Integrity between the tables must be maintained through the application. Ensuring a simple task does not have children, for example, is not guaranteed through the data model alone.