Hello!
You’re correct that Camunda 8 doesn’t have a direct equivalent to the annotation feature that was available in Camunda 7 for incidents. Camunda 8 does not natively support adding custom metadata, annotations, or external references directly to incident objects.
Recommended Workaround: Process Variables
The recommended approach in Camunda 8 is to use process variables to store custom metadata or external references that you want to associate with incidents. Here’s how this works:
When a job worker fails a job and raises an incident, you can include additional details as variables. These variables are then available for analysis when the incident is reviewed in Operate or accessed via the API.
For example, when failing a job, you can include business object references:
// When failing a job, include custom metadata as variables
client.newFailCommand(job.getKey())
.retries(job.getRetries() - 1)
.errorMessage("Processing failed")
.variables(Map.of(
"businessObjectId", "12345",
"externalSystemRef", "https://yoursystem.com/object/12345",
"errorContext", "Additional context about the failure"
))
.send();
As mentioned in the Job workers documentation:
“There are several advantages when failing a job with variables… it would be useful to provide some additional details through a variable when the incident is analyzed.”
Accessing the Data
You can then access this metadata through:
- Operate UI: View and modify variables when resolving incidents
- REST API: Query process instances and their variables
- External integrations: Use the variables to link back to your business objects
Alternative Approaches
If you need more sophisticated incident management with rich metadata, you might consider:
- Building a custom incident management layer that correlates Camunda incidents with your business data
- Using process variables combined with external storage systems
- Implementing custom monitoring and alerting that captures the additional context you need
While this approach requires storing the metadata as process data rather than directly on the incident object, it provides the functionality you need to link incidents to your business objects through external applications.
Would you like me to elaborate on any of these approaches or help you design a specific solution for your use case?