I found a solution by setting:
for i in range(0,dag.params["input_number"]):
This way the dag is created with all the tasks from 0
to 12
, as set by default in params
but when I run it it gets the input I give for that run, which can be lower than 13
.