I’m building a viewer that draws process definitions from the BPMN XML.
Everything works, except when I hit a Call Activity.
The BPMN XML for the Call Activity gives me the calledElement (which looks like the processId). But when I try to fetch the called process via the REST API, it expects the processDefinitionKey, not the id.
What I’m trying to do is that when a user clicks a Call Activity, navigate them to the process it calls (by drawing that process definition).
so my problem is that I can’t figure out how to go from the calledElement in the XML → the processDefinitionKey that the REST API requires.
Hello! I can help you solve this mapping problem between calledElement and processDefinitionKey.
The Solution
The key insight is that the calledElement in your BPMN XML contains the BPMN Process ID (also called bpmnProcessId), which you need to map to the process definition key that the REST API expects.
Here’s the two-step approach:
Step 1: Search for Process Definition by BPMN Process ID
Use the Operate API to search for process definitions by the bpmnProcessId:
This will return matching process definitions including the key field, which is the processDefinitionKey you need.
Step 2: Fetch the BPMN XML using the Process Definition Key
Once you have the key from step 1, use it to fetch the BPMN XML:
GET /v1/process-definitions/{key}/xml
Complete Workflow
Parse your BPMN XML and extract the calledElement value from the Call Activity
Call POST /v1/process-definitions/search with bpmnProcessId filter using the calledElement value
Extract the key from the response (this is your processDefinitionKey)
Call GET /v1/process-definitions/{key}/xml to get the called process BPMN XML
Render the new process definition in your viewer
Important Notes
The calledElement corresponds to the BPMN Process ID, not the process definition key
Multiple versions of the same process can exist, so you might get multiple results. You’ll need to decide which version to display (latest, specific version, etc.)
Make sure you’re using the Operate API endpoints for this functionality
The problem was successfully resolved! Here’s what we determined:
The Issue: You needed to map a Call Activity’s calledElement (from BPMN XML) to a processDefinitionKey (for REST API calls).
The Solution:
The calledElement contains the BPMN Process ID (bpmnProcessId)
Use POST /v1/process-definitions/search with a filter on bpmnProcessId to find the process definition
Extract the key from the response (this is your processDefinitionKey)
Use GET /v1/process-definitions/{key}/xml to fetch the called process BPMN XML
This two-step API approach using Camunda’s Operate API allows you to successfully navigate from Call Activities to their referenced process definitions in your BPMN viewer.
The key insight was understanding that calledElement = bpmnProcessId ≠ processDefinitionKey, and using the search API to bridge this gap.