How to define "Run as" for standalone flow action called via script?

Nisar2
Mega Guru

Hi folks,

 

I'm calling a flow action via a run script as:

 

var result = sn_fd.FlowAPI.executeAction(actionName, inputs);

 

This works fine if the logged in user is admin. But when a non-admin executes the workflow, the action errors out saying that it is prohibited by security rule.

 

Now I'm aware that in flow designer there is a "Run as" option to make it run as system user. But when calling the flow action directly, is there a way to specify this as well?

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Nisar2 

As per my understanding while calling in script you cannot set the Run as unless you have specified in the flow properties itself.

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Nisar2 

As per my understanding while calling in script you cannot set the Run as unless you have specified in the flow properties itself.

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


As per my understanding while calling in script you cannot set the Run as unless you have specified in the flow properties itself.


Its not the flow that I'm calling, rather a flow action. Thus the query to know if Flow Action has a way to set a Run as property.

So it's no possible to do it in a standalone action. Workaround would be to include the action in a flow designer and use the flow properties to define the "Run as"