# Process instance diagram format

**URL:** <https://forum.flowable.org/t/process-instance-diagram-format/4879>\
**Category:** Flowable Engine\
**Created:** [November 14, 2019, 9:07pm UTC](https://forum.flowable.org/t/process-instance-diagram-format/4879 "2019-11-14T21:07:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Catalyst344](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@Catalyst344](https://forum.flowable.org/u/Catalyst344)\
**Post date:** [November 14, 2019, 9:07pm UTC](https://forum.flowable.org/t/process-instance-diagram-format/4879/1 "2019-11-14T21:07:05Z")

</div>

Hi all,

I have a component that accepts BPMN and spits out an SVG of the diagram.

For example, it works great with the following call where I want to get the BPMN of a **process definition** :  
/flowable-task/process-api/repository/process-definitions/{processDefinitionId}/resourcedata

My objective now is to be able to provide the same functionality, but for a **process instance**.

I found a call that returns something very similar to what I need, but it returns it in a binary PNG format:  
flowable-task/process-api/runtime/process-instances/{processInstanceId}/diagram

What I like from that PNG is that it illustrates which task the process instance is currently on.

Is there an API call I can use that would return the same kind of data, but in BPMN format? I’m new to Flowable / BPM, so any help would be greatly appreciated.

Thank you in advance!

---

<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:** [November 20, 2019, 9:22am UTC](https://forum.flowable.org/t/process-instance-diagram-format/4879/2 "2019-11-20T09:22:22Z")

</div>

> [@Catalyst344](#):
>
> Is there an API call I can use that would return the same kind of data, but in BPMN format? I’m new to Flowable / BPM, so any help would be greatly appreciated.

Not sure i’m following, what do you mean with BPMN format? The diagram is BPMN after all.

---

<div class="post-metadata">

**Author:** ![Catalyst344](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@Catalyst344](https://forum.flowable.org/u/Catalyst344)\
**Post date:** [November 20, 2019, 3:31pm UTC](https://forum.flowable.org/t/process-instance-diagram-format/4879/3 "2019-11-20T15:31:17Z")

</div>

![09%20AM](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/e/e1fe8c8017c707e13524a28b62cbeea49357f930.png)

Hi Joram,

Thank you for the reply. Running the following endpoint ([https://www.flowable.org/docs/userguide/index.html#\_get\_diagram\_for\_a\_process\_instance](https://www.flowable.org/docs/userguide/index.html#_get_diagram_for_a_process_instance)  
)  
[http://localhost:8080/flowable-task/process-api/runtime/process-instances/{processInstanceId}/diagram](http://localhost:8080/flowable-task/process-api/runtime/process-instances/%7BprocessInstanceId%7D/diagram)

I get PNG binary data as a response. What’s interesting is I don’t get JSON back in the success response body like the documentation lists.

Am I using the correct endpoint? Could this possibly be a version issue?

---

<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:** [December 4, 2019, 5:03pm UTC](https://forum.flowable.org/t/process-instance-diagram-format/4879/4 "2019-12-04T17:03:00Z")

</div>

That seems to be a mistake in the documentation. The class responsible for handling that call only returns the png, see [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java#L77](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java#L77)

The body shown in the docs there, seem to be for /process-instances/{id}. I’ve removed the wrong body from the docs: [https://github.com/flowable/flowable-engine/commit/2d20598edb24a2e6494927187494a001fa690839](https://github.com/flowable/flowable-engine/commit/2d20598edb24a2e6494927187494a001fa690839)

The call you’re looking for is this one: [https://flowable.org/docs/userguide/index.html#\_get\_active\_activities\_in\_an\_execution](https://flowable.org/docs/userguide/index.html#_get_active_activities_in_an_execution)
