Sub process-loop

i have a service task that call http-request to get a number of elements as array
i want to loop through this array and check each element if element has a specific property then do another service task otherwise end the workflow

so i try to set sub-process loop to take each user but i have a problem that i don’t know how to set loop cardinality

here is a my model

Use a multi-instance task marker. You can pass it a list of objects and it will run for each instance.

i already use subprocess as loop but each time i deploy, the workflow never enter the subprocess
i only want the subprocess to loop on each element and check

Don’t use a loop on your sup proces, use multi-instance instead

ok, i use multi-instance but i want loop counter inside the sub-process to know which element i check
it seem like sub-process don’t see any process variable from outside

@ayatalat if you use multi-instance, you have execution-local variable available inside your sub-process called ‘loopCounter’ (and few others)

check this: https://docs.camunda.org/manual/7.11/reference/bpmn20/tasks/task-markers/

i try to set process Variable in first service task but it gives me undefined and i also try to set localvariables in service task it has the same problem undefined

Note : i add service task as external and i set process variable in external script