Error Handling in Flow and Subflow

raviteja1600
Tera Contributor

Hi Everyone,

 

I am having an doubt about the Error Handling in the Flow Designer. Below is scenario,

 

"In my flow, which includes a subflow, both the main flow and the subflow have error handlers enabled. If an error occurs in the main flow, an incident is created through its error handler. If the error occurs within the subflow, will the incident be created by the subflow’s error handler, the main flow’s error handler, or both?"

 

Thank you in advance! @Ankur Bawiskar 

 

Regards,

Raviteja

2 ACCEPTED SOLUTIONS

Deepika18
Tera Guru

Hi @raviteja1600 ,

 

If the subflow's error is not handled within the subflow, and the subflow does not have its error handler configured to prevent the error from cascading, the error will propagate to the parent flow and trigger its error handler if one is enabled. 

 

Please mark as solution, if this resolves your issue.

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@raviteja1600 

here is the link for explanation

Flows Best Practices Error Handling - Workflow Automation CoE 

AnkurBawiskar_0-1751457769186.png

 

My thoughts

1) if subflow has error handler then it will create INC. the main flow's error handler won't create another INC

2) if subflow has no error handler then the error will propagate to main flow and flow's error handler will execute and create INC

3) If both error handlers are designed to create incidents and the error is re-thrown:
Both could create incidents, but this only happens if the subflow’s error handler explicitly re-throws or fails to handle the error, which is not the default behavior

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

View solution in original post

3 REPLIES 3

Deepika18
Tera Guru

Hi @raviteja1600 ,

 

If the subflow's error is not handled within the subflow, and the subflow does not have its error handler configured to prevent the error from cascading, the error will propagate to the parent flow and trigger its error handler if one is enabled. 

 

Please mark as solution, if this resolves your issue.

Ankur Bawiskar
Tera Patron
Tera Patron

@raviteja1600 

here is the link for explanation

Flows Best Practices Error Handling - Workflow Automation CoE 

AnkurBawiskar_0-1751457769186.png

 

My thoughts

1) if subflow has error handler then it will create INC. the main flow's error handler won't create another INC

2) if subflow has no error handler then the error will propagate to main flow and flow's error handler will execute and create INC

3) If both error handlers are designed to create incidents and the error is re-thrown:
Both could create incidents, but this only happens if the subflow’s error handler explicitly re-throws or fails to handle the error, which is not the default behavior

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

@raviteja1600 

Thank you for marking my response as helpful.

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