# Flowable rest api

**URL:** <https://forum.flowable.org/t/flowable-rest-api/9289>\
**Category:** Flowable Engine\
**Created:** [May 4, 2022, 7:05pm UTC](https://forum.flowable.org/t/flowable-rest-api/9289 "2022-05-04T19:05:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![annnna](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@annnna](https://forum.flowable.org/u/annnna)\
**Post date:** [May 4, 2022, 7:05pm UTC](https://forum.flowable.org/t/flowable-rest-api/9289/1 "2022-05-04T19:05:14Z")

</div>

Hello,

I have several questions about the flowable rest api.  
Currently, I am using flowable rest-api in python.

The app is for file uploading from the client. After the uploading is done from the client, the information will be sent to the microservice to save it.

![flowable-node](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/d/dfa890eec6234efbfbb1641408310a537329cf1f.jpeg)

The first http request successfully passed the body to the microservice.  
But for receive task, I sent a post request to ‘/service/query/executions’ with this payload.

```
payload = {
    'processInstanceId': process_instance_id (<- execution.getProcessInstance() from the 1st http task),
    'activityId': 'check-file-existed' (<-name of the receive task)
}

```

But the result is {“data”:[],“total”:0,“start”:0,“sort”:“processInstanceId”,“order”:“asc”,“size”:0}.

Questions.

1. I am wondering why the result data is empty, even if the process\_instance\_id is not null.
2. When the processInstanceId is created, how the processinstanceId interact with acitivityIds within the same deployment?
3. when is activityid available to use?
4. What is the ‘completed’ in the result? Even if I’ve got the right result, completed is False.

Best Regards,  
Anna

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [May 16, 2022, 3:36pm UTC](https://forum.flowable.org/t/flowable-rest-api/9289/2 "2022-05-16T15:36:24Z")

</div>

> [@annnna](#):
>
> - I am wondering why the result data is empty, even if the process\_instance\_id is not null.

That’s technically not possible, a process instance always has one id. Are you sure the instance is still being executed?

> [@annnna](#):
>
> - When the processInstanceId is created, how the processinstanceId interact with acitivityIds within the same deployment?

An instance will visit all activities, according to the sequence flow.

> [@annnna](#):
>
> - when is activityid available to use?

Not sure what you mean with this?

> [@annnna](#):
>
> - What is the ‘completed’ in the result? Even if I’ve got the right result, completed is False.

I don’t see any ‘completed’ in the response - where do you see this?

---

<div class="post-metadata">

**Author:** ![annnna](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@annnna](https://forum.flowable.org/u/annnna)\
**Post date:** [May 17, 2022, 12:57am UTC](https://forum.flowable.org/t/flowable-rest-api/9289/4 "2022-05-17T00:57:50Z")

</div>

Hello Joram,  
Thanks for your kind answers.

According to your answer, the process instance will visit all activities.

![Flowable rest api - Flowable Engine - Flowable and 11 more pages - Work - Microsoft Edge](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/8/85edcf54778f1b4df831b5f5d691c239310dbabc.jpeg)

Please find out the process that I’ve tried…

1. post request to /service/runtime/process-instances

2. The process instance id is executed by ${execution.getProcessInstance()} in the first node (Request Insert Data).

3. post request to /service/query/executions with processInstanceId and activityId(wait-finish-flag).  
But, the result of the /service/query/executions is  
{“data”:[],“total”:0,“start”:0,“sort”:“processInstanceId”,“order”:“asc”,“size”:0}  
So, I couldn’t send put request to /service/query/executions because there is no execution ID from #2.

4. So, I’ve tried to send post request to /service/query/executions after getting result from the post request (/service/runtime/process-instances) is done.  
– post request to /service/query/executions with processDefinitionKey and activityId.

And the result is below…  
{‘data’: [{‘id’: ‘91d32bb5-d578-11ec-ad74-0242ac110004’, ‘url’: ‘[http://localhost/flowable-rest/service/runtime/executions/91d32bb5-d578-11ec-ad74-0242ac110004’](http://localhost/flowable-rest/service/runtime/executions/91d32bb5-d578-11ec-ad74-0242ac110004%E2%80%99), ‘parentId’: ‘91d32bb3-d578-11ec-ad74-0242ac110004’, ‘parentUrl’: ‘[http://localhost/flowable-rest/service/runtime/executions/91d32bb3-d578-11ec-ad74-0242ac110004’](http://localhost/flowable-rest/service/runtime/executions/91d32bb3-d578-11ec-ad74-0242ac110004%E2%80%99), ‘superExecutionId’: None, ‘superExecutionUrl’: None, ‘processInstanceId’: ‘91d32bb3-d578-11ec-ad74-0242ac110004’, ‘processInstanceUrl’: ‘[http://localhost/flowable-rest/service/runtime/process-instances/91d32bb3-d578-11ec-ad74-0242ac110004’](http://localhost/flowable-rest/service/runtime/process-instances/91d32bb3-d578-11ec-ad74-0242ac110004%E2%80%99), ‘suspended’: False, ‘activityId’: ‘receiveTest’, ‘tenantId’: ‘’}], ‘total’: 1, ‘start’: 0, ‘sort’: ‘processInstanceId’, ‘order’: ‘asc’, ‘size’: 1}

1. put request to /service/query/executions after #3

2. wait-finish-flag was available and Notification Node was successfully run.

I am using REST API from the postman. Flowable engine is deployed by docker image.  
And I don’t think the process from #3 to #5 is correct.

Would you please let me know how I can access the each activities while the process is running?

Best Regards,  
Anna

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [May 23, 2022, 1:36pm UTC](https://forum.flowable.org/t/flowable-rest-api/9289/5 "2022-05-23T13:36:59Z")

</div>

Ok - and in step 3:

- What happens when you only use the process instance id?
- Could it be that you’re calling it too quickly - i.e. the http task is still being done?

I don’t see anything that would explain what you’re seeing, the process you’re using is simple and straight-forwards. There should be an execution coming back that’s waiting in the receive task.
