flowable/flowable-engine · error · FlowableIllegalArgumentException

Process instance with id '${processInstanceId}' has no graph

Error message

Process instance with id '${processInstanceId}' has no graphical notation defined.

What it means

A process instance diagram can only be rendered if its process definition has graphical information (BPMN DI/diagram interchange). If the definition resolved from the instance has none, getProcessInstanceDiagram throws FlowableIllegalArgumentException stating the instance has no graphical notation defined.

Source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java:85

        ProcessDefinition pde = repositoryService.getProcessDefinition(processInstance.getProcessDefinitionId());

        if (pde != null && pde.hasGraphicalNotation()) {
            BpmnModel bpmnModel = repositoryService.getBpmnModel(pde.getId());
            ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
            InputStream resource = diagramGenerator.generateDiagram(bpmnModel, "png", runtimeService.getActiveActivityIds(processInstance.getId()), Collections.emptyList(),
                    processEngineConfiguration.getActivityFontName(), processEngineConfiguration.getLabelFontName(),
                    processEngineConfiguration.getAnnotationFontName(), processEngineConfiguration.getClassLoader(), 1.0,processEngineConfiguration.isDrawSequenceFlowNameWithNoLabelDI());

            HttpHeaders responseHeaders = new HttpHeaders();
            responseHeaders.set("Content-Type", "image/png");
            try {
                return new ResponseEntity<>(IOUtils.toByteArray(resource), responseHeaders, HttpStatus.OK);
            } catch (Exception e) {
                throw new FlowableIllegalArgumentException("Error exporting diagram", e);
            }

        } else {
            throw new FlowableIllegalArgumentException("Process instance with id '" + processInstance.getId() + "' has no graphical notation defined.");
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Redeploy the BPMN XML including a valid <bpmndi:BPMNDiagram>/<bpmndi:BPMNPlane> section, or re-export the model from the Flowable modeler with layout saved.
  2. Verify DI presence by fetching the model XML (GET /repository/models or the deployment resource) and checking for bpmndi elements before calling the diagram endpoint.
  3. Handle the error client-side and show a 'no diagram available' state instead of requesting diagrams for such definitions.

Example fix

// before: BPMN without diagram info
<definitions>...<process id="order"/>...</definitions>
// after: include DI
<definitions>...<process id="order"/>
  <bpmndi:BPMNDiagram id="BPMNDiagram_order"><bpmndi:BPMNPlane bpmnElement="order">...</bpmndi:BPMNPlane></bpmndi:BPMNDiagram>
</definitions>
Defensive patterns

Strategy: validation

Validate before calling

String modelXml = restClient.getModelXml(processDefinitionId);
boolean hasDiagram = modelXml.contains("bpmndi:BPMNDiagram");
if (!hasDiagram) {
    // skip diagram request; show 'no diagram available' in UI
}

Try / catch

try {
    byte[] png = restClient.getDiagram(processInstanceId);
} catch (HttpClientErrorException.BadRequest e) {
    if (e.getResponseBodyAsString().contains("no graphical notation")) {
        // render placeholder instead
    }
}

Prevention

When it happens

Trigger: GET /runtime/process-instances/{processInstanceId}/diagram where the underlying BPMN XML was deployed without BPMNDiagram/BPMNPlane DI elements (e.g. built by a tool that omits diagram data, or the DI was stripped). Thrown at ProcessInstanceDiagramResource.java:85.

Common situations: BPMN models generated programmatically or exported without layout information; XML edited by hand removing the bpmndi section; old definitions migrated from tools that don't emit DI; requesting diagrams for instances of such definitions.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/0914a84ca1ae5edf. Report an issue: GitHub.