In these kind of scenarios we may require the task creation inside a loop, using "while activity" or the "replicator activity". But if you would like to use the "Create Task" activity inside the "while activtiy", make sure you are doing the following settings correctly otherwise workflow will create the task first time but it will give the error in the subsequent loops.
1. Keep all the task related activities (mostly, "create task", "onTaskChanged" and "complete task") inside a Sequential activity.
2. Use a separate correlation token for the activities inside the "Sequential activity"
3. For all the activities inside the "Sequential activity", Change the Owner activity property value to the sequential activity(this is important)
Following picture shows a simple workflow which contains the "create task" activity inside a while loop. Note that all the task related activities are kept inside the "Sequential activity".
This picture shows the properties of "create task activity". Owner activity name and correlation tokens should be changed as shown in the picture. This needs to be done for all the task related activities inside the "Sequential activity"





