how wait for message will work in flow designer ?can you show an example ?

Rajyalakshmi
Giga Guru

how wait for message will work in flow designer ?can you show an example ?

3 REPLIES 3

Aljo2
Tera Expert

The Wait for Message action pauses a flow until it receives a specific message from the sendMessage() Flow API. The flow remains in a waiting state until:

  • A matching message is received, or
  • A timeout occurs (if configured).

Example

Suppose a Change Request approval is rejected and requires additional information.

 

Ask for Approval -> Approval Rejected -> Wait for Message ("Resume Flow") -> Go back to Approval Step
 
sn_fd.FlowAPI.sendMessage(
    contextId,
    "Resume Flow",
    "Resubmitted for approval"
);

 

Because the message text matches "Resume Flow", the flow resumes. The payload (Resubmitted for approval) is available as an output from the Wait for Message action and can be used later in the flow.

Think of it as the Flow Designer equivalent of the classic Workflow Wait for WF Event activity. Instead of polling or waiting for a condition, the flow pauses until sendMessage() sends the expected message.

 

Refer to the ServiceNow documentation for more details: Wait For Message action.

Vishal Jaswal
Tera Sage

Hello @Rajyalakshmi 

ServiceNow official docs have explained it with example of Change Request approval process: https://www.servicenow.com/docs/r/build-workflows/workflow-studio/wait-for-message-action.html 


Hope that helps!



Thank you for details.

As per the document.

Convert workflow event waiting activities using this action Convert classic workflows that use the Wait for WF Event activity to flows that use the Wait For Message action. You can use the event name as the message text that resumes the flow.

I have used same ,my event name as message text .It is almost 2 days my flow still waiting.

Could you please help me do i need to check anything ?