Why REST engine returns empty result when process is on external task?

Can you explain me why camunda REST engine returns empty response on this request:
localhost:8080/engine-rest/task?processInstanceId=<some_id>
when current task is an external service task? I see marker on it in cockpit (unlike when it’s not external service task) so I thought I should have some information about it but alas: no info about process’s task.


Somehow cockpit knows which task is active in the process at the moment, so there must be a way to find it out for me too, I suppose.

Hi @mykola

I think cockpit is using “GET /history/activity-instance” to retrieve all kinds of activity instances including external tasks

See below link for more information
https://docs.camunda.org/manual/7.8/reference/rest/history/activity-instance/get-activity-instance-query/

Also you can use “GET /external-task” to retrieve external tasks

See below link for more information
https://docs.camunda.org/manual/7.8/reference/rest/external-task/get-query/

1 Like

It’s good to be aware that when the engine’s API talks about a “Task” it’s always a user task.
External tasks, Receive tasks or Call Activities are not considered when querying for a “task”

As @hassang said - you’d need to query specifically for an external task to get it.

1 Like

This is just what I need. Thanks!

I wish it was written in manual

I agree - specifically which docs did you come across and i can try and add this fact more explicitly

@Niall
https://docs.camunda.org/manual/7.8/reference/rest/task/get-query/
(and all other versions of this article: 7.7, 7.6, etc)

1 Like