FetchAndLock oldest tasks first


when using Camunda 7.11, is there any way to tell /external-task/fetchAndLock to return the oldest external task first?

We know about the usePriority flag, but this only allows certain service tasks to be prioritized. What we would ideally like to have is the option to process these external service tasks in a (roughly) FIFO manner. This would be helpful in scenarios where workers that run compute heavy tasks are busy, and new tasks are created faster than they can be processed (for some time). Right now, it appears that the tasks are returned in arbitary order, so that old tasks may have to wait quite a while until they get processed.

Thanks in advance!

@hangy To filter the external tasks using rest api based on createDate/createdTime is currently not possible. You can create a feature request in jira.

1 Like

You can use timestamp as priority, like:
LIFO: ${now().getTime()}
FIFO: ${-now().getTime()} or ${9223372036854775807 - now().getTime()}

(9223372036854775807 is Long.MAX_VALUE)