Need help sequencing API requests to retrive information

I was exploring API documentation of Camunda’s REST API but couldn’t figure out how to get the following done

  • List down all the tasks for a particular process ( not just user tasks ) and when a specific task was started, when did it end and who performed the task ( if it is a user task )
  • How many pending user tasks are there for a particular process and who has it been assigned to

Hello @Anand_Prabhakar ,

both queries cannot be achieved with a single request, that is true.
Anyway, you could either implement a custom endpoint in your backend or create a client containing the logic to aggregate data.

A question for the first query: Do you mean user tasks as well as external tasks here? And if you want to know lifecycle data, you refer to the history api?

The second one sounds more like a runtime query:

  1. Fetch user tasks
  2. Map them by process instance id (and maybe process definition key/id) and assignee

I hope this helps

Jonathan

Thanks for Responding @jonathan.lukas
I am aware that my requirement will need more than one api calls and I am planning to handle that on the client side
I explored the history api for a process instance but that just gives me info on who started the process and at what time but there are some user tasks where agents perform some action and they do it in their own time. The way I want to visualise data is the audit logs that we see for a particular instance run

Is there an endpoint for that because it shows when did each of the tasks start and end

Hello @Anand_Prabhakar ,

this endpoint returns to you historical user tasks:

For a audit log, there is also this endpoint:

Does this help you?

Jonathan

Hey @jonathan.lukas so if I understand it right
GET /task ( will give me open user tasks )
GET /history/task ( will give me all the completed or deleted task )

does the same rule apply to things as well?

What is the difference between a task and a job?

I also want to monitor system tasks as well…How do I achieve that?

Hello @Anand_Prabhakar ,

this is mostly correct.

history/task will give you ALL tasks as history is written parallel to runtime data.

This does apply to all entities.

A task is for users while a job is handled by the process engine. An external task is work that needs to be done by an external worker.

If a system should monitor all kind of tasks, these 3 entities should be monitored.

Jonathan

Hmm makes sense @jonathan.lukas
So when it comes to a user task there is a field called assignee which denotes which user performed or is supposed to perform a particular task, then there are things like due date and other task related fields that can be set or assigned.

Are there endpoints for that?
Or could you share any way of achieving that?

Hello @Anand_Prabhakar ,

as you can see here, the historic task instance delivers all the information you would need.

One important note: History is read-only which means that you cannot set a due date or assign someone.

This needs to happen in the runtime api (claim, set assignee, update for example).

I hope this helps

Jonathan