Cancel a subflow

Servicenow Use4
Kilo Guru

Hello experts,

 

I have a flow which calls multiple subflows based on conditions. Essentially, there are nested subflows, each creating HR Tasks, triggering notifications etc. 

 

Here is what is problem is: If I mark the HR Case as Cancelled, the OOTB functionality sets the HR Task as Closed Incomplete. Now, that particular subflow state (from where this HR Task is created) is still showing as 'Complete' and subsequent part of the main flow or the subflow from where this was called gets executed and other tasks get created. I do not want this to happen. If the HR Case itself is Cancelled, nothing else should get created.

How do I prevent the remaining flow from execution?

 

Any leads are appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

Any action that is done, should be checking on the case state. So if somewhere in the flow you are calling a next subflow (or within a subflow actions are performed), you need a check on the state of the Case.

I don't know how complicated the flow is, but it could be as easy as just put a look up record to check on the case state and an 'end flow' if it is canceled.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Servicenow Use4 

why not check the previous subflow output before proceeding further?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar There are many many subflows. It will be difficult to set flow outputs and check that in the previous flows every time... I am looking for a more generic solution to this kind of issue that is not really customised for this case.

@Servicenow Use4 

you cannot have generic solution.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Manders
Mega Patron

Any action that is done, should be checking on the case state. So if somewhere in the flow you are calling a next subflow (or within a subflow actions are performed), you need a check on the state of the Case.

I don't know how complicated the flow is, but it could be as easy as just put a look up record to check on the case state and an 'end flow' if it is canceled.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark