The CreatorCon Call for Content is officially open! Get started here.

Ending in Flow Designer

martinkruml
Tera Guru

Hi all!

 

Once again I am asking a question about Flow Designer.. 

I am going to refer to this question, which I had last week - https://www.servicenow.com/community/developer-forum/multilevel-approval-for-different-managers-coun...

 

I managed to setup whole flow in FD, but now, interestingly enough, I am struggling with "ending" of the flow, where if I set up conditions "If", "else if" for "Closed Complete" and "Closed Incomplete" based on approved/rejected SCTASK, my RITM is still remaining open. According to logs or evaluation of how flow run, it seems that it doesn't wait for the result and just runs it. I tried to do it via "do the following until" logic, but this just resulted in searching of 1000 examples and still not updating properly.

 

Any advice/hint on this? I read something about separating this into 2 flows, 1 for creating/updating task and 2nd for asking the approval, but that seems unnecessary.

 

Thanks in advance!

1 ACCEPTED SOLUTION

esther598
Mega Expert

Hello,

Use Wait for Condition: Instead of using “If” and “Else If” conditions, try using the “Wait for Condition” action. This action pauses the flow until the specified condition is met. You can set it to wait until the SCTASK is either “Closed Complete” or “Closed Incomplete”.
Check Flow Logic: Ensure that your flow logic is correctly set up to handle the approval results. Sometimes, the flow might not be properly configured to wait for the approval response.
Separate Flows: While it might seem unnecessary, separating the flow into two parts can sometimes simplify the logic. One flow can handle the creation and updating of the task, and the second flow can handle the approval process. This separation can make it easier to manage and debug.
Review Logs: Check the flow execution logs to see where it might be skipping the wait. The logs can provide insights into why the flow is not waiting for the approval result.   Official Site

Best Regards

esther598

View solution in original post

2 REPLIES 2

esther598
Mega Expert

Hello,

Use Wait for Condition: Instead of using “If” and “Else If” conditions, try using the “Wait for Condition” action. This action pauses the flow until the specified condition is met. You can set it to wait until the SCTASK is either “Closed Complete” or “Closed Incomplete”.
Check Flow Logic: Ensure that your flow logic is correctly set up to handle the approval results. Sometimes, the flow might not be properly configured to wait for the approval response.
Separate Flows: While it might seem unnecessary, separating the flow into two parts can sometimes simplify the logic. One flow can handle the creation and updating of the task, and the second flow can handle the approval process. This separation can make it easier to manage and debug.
Review Logs: Check the flow execution logs to see where it might be skipping the wait. The logs can provide insights into why the flow is not waiting for the approval result.   Official Site

Best Regards

esther598

Thanks a lot for your thoughts! Didn't know there's an ACTION for "Wait for Condition", i was always looking at If / If else! Much appreciated!