miftikhar20
Kilo Patron

Hi @Lowestoft,

You can achieve this functionality by using the "Wait for Message" action in your Flow, which allows the flow to pause until it receives a specific message via the Flow API. Unfortunately, journal fields like Comments or Additional Comments aren’t directly selectable in the "Wait for Condition" action, so this approach is a reliable alternative.

Here are the steps to implement:

  • Add a "Wait for Message" action in your flow:
    • Set Message to "Resume Flow".

    • Set Enable timeout & Timeout (optional)
      (only if you want to resume the flow if no message is received after a specific amount of time)
      MIftikhar_1-1761224550647.png
  • Create an After Update Business Rule on the Requested Item[sc_req_item] table:

    • Name it something like "Resume Flow - RITM Additional Comment".

    • Set the filter condition to check if Comments have changed.

      MIftikhar_2-1761224622553.png
    • Check Advanced and add the following script in the Script field:

(function executeRule(current, previous /*null when async*/ ) {

    try {
		var lastComment = current.comments.getJournalEntry(1);
        var result = sn_fd.FlowAPI.sendMessage(current.flow_context, "Resume Flow", lastComment);
    } catch (ex) {
        var message = ex.getMessage();
        gs.error(message);
    }

})(current, previous);

 

 

  • Now, when the flow reaches the "Wait for Message" action, it will pause.

    MIftikhar_3-1761224845848.png
  • Once an additional comment is added to the RITM, the business rule will trigger and send the "Resume Flow" message.

    MIftikhar_4-1761224896699.png
  • Refresh the flow execution, and you will see the flow resumes and continues processing.

    MIftikhar_5-1761224956061.png

 

If my response helped, please mark it as the accepted solution so others can benefit as well.

 

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

View solution in original post