[#3495] Wrap generation in a task