REST Api to identify if Task is in a loop or get Tasks in a loop

Is there any way to identify if a Task is within a loop OR get all Tasks within a loop ? Havent found anything in API docs - Task | docs.camunda.org.

At the exit of the loop (which is a do-while) we need to execute tasks outside of Camunda and hence need to identify when the process exits a loop.

Hi @samba.pedapalli,

what kind of loop do you mean? Do you have a loop in a BPMN model?
And what do you mean by “tasks within a loop”?

The need is a do-while implementation, which means we will need to draw out as depicted under Loops section here - https://docs.camunda.org/manual/7.6/reference/bpmn20/tasks/task-markers/#loops.
As depicted in there, “Do Something” is a Task within the loop.

Hi @samba.pedapalli,

what about setting and updating a process variable within the “loop task” (e.g. a counter that you would remove after the last run of the loop)?
You could then query for tasks that have this variable assigned.
https://docs.camunda.org/manual/latest/reference/rest/task/post-query/

I hope this helps.
Cheers,
Miklas

Thanks Miklas. Will explore your suggested solution.