How do I get running workflow name in a run script

bibeesh
Tera Contributor

I need my current running workflow name to a variable. I have a Run Script   inside my workflow where I need current workflow name in to a variable. tried using some of the current.   method but giving undefined values. Sys Id would be help full for me here.

5 REPLIES 5

bibeesh
Tera Contributor

Sys Id wont be help full for me here .. There is a typo in above quote


Inactive_Use167
Mega Expert

I too have the same question. need to get the workflow associated with the current request   item in the script and process it. Did you find the solution for it


Please use this script in the run script activity of the workflow.



var str = 'id=' + current.sys_id.toString();  


    var wf = new GlideRecord('wf_context');  


      wf.addEncodedQuery(str);  


      wf.query();  


      if(wf.next()){  


  gs.log(wf.workflow_version.getDisplayValue()); //This is the name of the workflow


  gs.log(wf.sys_id);   // This is the sys_id of the workflow context


  }


MM16
Giga Contributor

I would like to know the name of the subflow I am in, when I am in a run script or task activity.