Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

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

Rajyalakshmi
Mega Guru

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

2 REPLIES 2

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!