In Camunda 8, especially when using Zeebe (the workflow engine behind Camunda 8), execution listeners like those in Camunda 7 do not work the same way. If you’re using user tasks, you’re likely working with task listeners or custom workers, and here’s the clarification:
Key Points:
1. Zeebe does not support BPMN execution listeners in the way Camunda 7 does.
2. Custom headers (defined in the BPMN model) are only accessible by external task workers, not by listeners.
3. For user tasks, you’re likely using task forms and task lifecycle events, and any business logic should be handled outside of Zeebe, like in your tasklist listener or task workers.
If you’re trying to access custom headers in a worker:
Make sure you’re using a Job Worker (Java, Node.js, etc.) for a service task, not a user task. Example (Java Zeebe client):
job.getCustomHeaders().get("your-header-key");
This works only in job workers, not listeners.
If you’re trying to react to a user task (e.g., task created):
You need to subscribe to Tasklist APIs or use Operate’s or Tasklist’s event streams to respond to lifecycle events (like task created, completed). But you won’t have access to custom headers because those apply only to job workers.
Alternatives / Workaround:
If you want to pass metadata with user tasks:
• Use input/output mappings to pass variables instead of custom headers.
• Use task form metadata or form fields.