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

How to build a Subflow which will be attached once we enable Error handling.

Kishor O
Tera Sage

I want to pass flow name , Error code, and Error message as input to the sub-flow 

*In sub flow there should be a logic to send notification 

Example email subject : There is error occurred while running flow <*flow name*>(should be dynamic)

1 ACCEPTED SOLUTION

SunilKumar_P
Giga Sage

Hi @Kishor O, You can create a subflow with the inputs and add action 'Send Email' to the workflow.

SunilKumar_P_0-1707907571295.pngSunilKumar_P_1-1707907588456.png

 

2. Configure the mainflow with the 'Error Handler' subflow.

Look up record in the 'Flow Engine Context' table with the source record as the Trigger Record.

SunilKumar_P_2-1707907694400.png

Dot walk to the look up record 'Name' to configure it to the subflow.

SunilKumar_P_3-1707907738565.png

 

Regards,

Sunil

 

 

View solution in original post

7 REPLIES 7

Martin iTSM
Tera Guru

Hey there,

1. Create a subflow with appropriate subflow inputs (e.g. Flow name, Error code, Error message likely type String)
2. Add an action "send email" into your subflow and either drop the data pills from your input variables into the subject (or any other field you need it) or do it via script if required.
3. Have your flow trigger the subflow and pass the values you need via the subflow inputs

Should look somehow like this in your subflow roughly:

User655509_0-1707838881361.png


Due to the very vague explanation i`m not sure if that`s what you need - but from what i understood this should be it. So from each individual flow you can trigger the subflow with individual subflow inputs and hence get a dynamic email subflow.

Cheers!

Martin

How to get the flow name from the flow designer? 

Any idea?

Hi @Kishor O 

 

@Martin iTSM provided a way to see the flow name in screen shot. Give a try.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Martin iTSM
Tera Guru

Hmm, no. I have not seen anything which allows to access the current flow`s data/context easily.
But why do you need that?

You will need to pass the flow name from each flow to the subflow anyway - so you can just manually populate it per flow which should be a one time job per flow.

Maybe there`s some way to script it and populate it into a flow variable - but i`m not sure if it`s worth the effort and if it would really make any sense since you then need to create the input variable per flow and add the script into it which sounds more complicated than just setting the flow name manually.

Martin