Link a Received Message to a Process Instance - Link a Received Message to a Process Instance - This operation links a received message to a process instance. Use it when an external message payload should be delivered to a process instance that is waiting for a BPMN message. - Content Innovation Cloud - Hyland Automate Modeler - Current/Hyland-Automate-Modeler/kei9135010735861 - Current - Current

Hyland Automate Modeler

Platform
Content Innovation Cloud
Product
Hyland Automate Modeler
Release
Current
License
ft:lastPublication
2026-11-09T23:07:34.300254
ft:locale
en-US

This operation links a received message to a process instance. Use it when an external message payload should be delivered to a process instance that is waiting for a BPMN message.

The base request is:

receive()

The following example delivers a message to a waiting process instance:

new RuntimeProcessInstanceService().receive({
    name: variables.messageName,
    correlationKey: variables.businessKey
});

You can use the optional ReceiveMessagePayload schema when a script needs to deliver a BPMN message to a waiting process instance.

The following example sends an updateStatus message and passes a status variable to the process instance:

const receiveMessagePayload = {
    name: 'updateStatus',
    correlationKey: variables.businessKey,
    variables: {
        status: 'SHIPPED'
    }
};

new RuntimeProcessInstanceService().receive(receiveMessagePayload);

In this example, name: 'updateStatus' specifies the BPMN message to deliver and correlationKey: variables.businessKey identifies the process instance that should receive the message. variables contains data that is passed to the process instance when the message is received, which in this case is status: 'SHIPPED' that provides a process variable that can be used by subsequent process activities.

When the runtime finds a process instance waiting for the specified message and correlation key, the message is delivered and the process instance continues execution.