Message → Publish
AI-generatedOverview
This node allows you to publish messages to Camunda Cloud (now known as Zeebe) using the "Message" resource and the "Publish" operation. It is useful for triggering BPMN process instances or correlating running processes with external events by sending messages from n8n workflows.
Common scenarios:
- Triggering a process in Camunda Cloud when an event occurs in another system.
- Correlating a message with an existing process instance using a correlation key.
- Passing variables to Camunda Cloud processes at runtime.
Practical example:
You can use this node to send a message to Camunda Cloud when a new order is placed in your e-commerce system, starting or continuing a business process in your BPMN workflow.
Properties
| Name | Type | Meaning |
|---|---|---|
| Correlation Key | String | Value used to correlate the message with a specific process variable. If provided, the message will be correlated with an existing process instance; if omitted, it may start a new process depending on the BPMN model. |
| Message Name | String | The name of the message as defined in your BPMN process. Required. |
| Variables (JSON) | JSON | A set of key-value pairs to pass as process variables to Camunda Cloud. |
| Time To Live | Number | Duration (in seconds) the message should remain active for correlation. Required. |
Output
The output is a JSON object containing the result of the message publication. Typical fields include:
{
"messageKey": "<unique-message-key>",
"messageId": "<uuid>",
"name": "<message-name>",
"correlationKey": "<correlation-key-if-provided>",
"variables": { /* variables sent */ },
"timeToLive": <seconds>
}
- If a correlation key is provided, the response includes details about the published message.
- If no correlation key is provided, the response reflects the result of publishing a "start message" (to start a new process).
No binary data is produced by this operation.
Dependencies
- External Service: Requires access to Camunda Cloud (Zeebe).
- API Credentials: Needs
clientId,clientSecret,clusterId, andclusterRegionfor authentication (provided via n8n credentials namedcamundaCloudApi). - Node.js Packages: Uses
zeebe-nodeanduuidpackages (bundled with the node).
Troubleshooting
Common issues:
- Invalid Credentials: If the API credentials are incorrect or missing, the node will throw an authentication error. Ensure all credential fields are correctly filled.
- Malformed Variables: If the "Variables (JSON)" property contains invalid JSON, the node will throw a parsing error. Always provide valid JSON.
- Missing Required Fields: If "Message Name" or "Time To Live" are not provided, the node will fail. Make sure all required properties are set.
- Correlation Key Not Found: If a correlation key is provided but does not match any running process, the message may not be correlated as expected.
Error handling:
- If "Continue On Fail" is enabled, errors are returned in the output as
{ "error": "<error message>" }. - Otherwise, the workflow execution stops on error.