Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Fetching Current flow's Execution Link

DionysusOP
Tera Contributor

Hi,

Can anyone help me with the process to attach the flow execution link in the currently running flow. I need this to update worknotes on an incident if flow got any error.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@DionysusOP 

so if a record on table has any flow running on it; you need to see the flow context for that?

information about flow context is stored in table "sys_flow_context"

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

Mark Manders
Mega Patron

Robert Fedoruk created a you tube video for this: https://www.youtube.com/watch?v=Br5p7inqbXw

Although creates a subflow to create a record when an error occurs, you can use the information as well to create your worknote, including a clickable link (if your instance allows that).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
In 15 minutes you can deploy a single subflow to all your ServiceNow Flows that require error handling. SPECIAL THANKS TO JONATHAN CROSBY https://www.linkedin.com/in/jonathancrosbyfl/ 🔎 Looking for #ServiceNow talent or opportunity? 🤝 Need coaching or mentorship? http://theduke.digital/contact/ 👑

Hi All,

 

Just a slight enhancement on the video which I implemented.

 

On your Main Process:

  1. Set Flow Variable - [variable name : main_flow_id]
  2. Initialise this variable
    1. var main_flow_id = FlowScriptAPI.getContextID();
       
      Then pass main_flow_id into the subProcess 
      No need then for the lookups in the subProcess