Different states of /api and /v1 Operate APIs

I am a little bit confused about the two api endpoints, the operate service offers. I got a process, which failed with an incident. The first REST API (/api/process-instances/2251799814030697) returns me an state=INCIDENT for this process, as i expected it.

{
  "id" : "2251799814030697",
  "processId" : "2251799814030681",
  "processName" : "p_85094497-259e-40e7-aafe-9a17f08d95af",
  "processVersion" : 8,
  "startDate" : "2023-05-31T10:50:30.845+0000",
  "endDate" : null,
  "state" : "INCIDENT",

The second API i was using so far (/v1/process-instances/2251799814030697) returns me a state=ACTIVE

{
    "key": 2251799814030697,
    "processVersion": 8,
    "bpmnProcessId": "p_85094497-259e-40e7-aafe-9a17f08d95af",
    "startDate": "2023-05-31T10:50:30.845+0000",
    "state": "ACTIVE",
    "processDefinitionKey": 2251799814030681
}

My goal is, to see, if a process is currently running, or completed or failed. But with the v1-API i can not get this with the process-instances-endpoint.
Why are there this two APIs and why did they return different values for the same variable?

Hi @Vanguard ,
you spotted a bug in Operate Public API.
The API URL you’re using is correct - /v1/process-instances/2251799814030697 - but it won’t return you an INCIDENT state unfortunately.
The other API is “internal” and is used by Operate UI.
I created a bug issue for this: INCIDENT state is not returned in Public API · Issue #198 · camunda/issues · GitHub

Best regards,
Svetlana

1 Like

Thank you, so i will wait for an update on this incident.