Is there a way to get the flow engine context record information of a running flow within a flow?

bonsai
Mega Sage

I would like to attach flow engine context record information when informing the user that an abnormality occurred during flow execution.

Or I would like to attach the URL of a flow report.

Is there a way to do either of these?

I think the flow engine context record information is stored in a flow variable.

1 ACCEPTED SOLUTION

bonsai
Mega Sage

Thank you for your answer.
I solved it myself.
"FlowScriptAPI.getContextID()" was the answer I was looking for.
https://developer.servicenow.com/dev.do#!/reference/api/yokohama/server/no-namespace/FlowScriptAPI?n...

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@bonsai 

I don't think within flow it's directly available.

You can always query sys_flow_context table with the flow sysId and then grab the status etc

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

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @bonsai 

I doubt what you're trying to achieve is feasible, as a Flow is not something tied directly to a form. Also, when you say "assign it to a user" — which user are you referring to? To access a Flow, the user must have the appropriate role.

This is more of an educational/training aspect and should be handled by the admin or platform team. If something goes wrong in the Flow, the operations team can inform the ServiceNow admin team to fix it accordingly

*************************************************************************************************************
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]

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

bonsai
Mega Sage

Thank you for your answer.
I solved it myself.
"FlowScriptAPI.getContextID()" was the answer I was looking for.
https://developer.servicenow.com/dev.do#!/reference/api/yokohama/server/no-namespace/FlowScriptAPI?n...