Subflow running as user but set to Run As System User

Community Alums
Not applicable

I've noticed that some subflows that one of our partners created is configured to run as System User and it is being executed from a script include, but it is running as the user that initiated it.

 

Is this normal behavior for a subflow?

 

6 REPLIES 6

JenniferRah
Mega Sage

How are they triggering it? If they are using executeFlowQuick or executeSubflowQuick, those run it as the user who executed it. 

 

If they are using startFlowQuick or startSubflowQuick, those run it as the System User, according to this documentation: https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server/sn_fd-namespace/Scriptab...w

JenniferRah
Mega Sage

How are they triggering it? If they are using executeFlowQuick or executeSubflowQuick, those run it as the user who executed it. 

 

If they are using startFlowQuick or startSubflowQuick, those run it as the System User, according to this documentation: https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server/sn_fd-namespace/Scriptab...w

Community Alums
Not applicable

Hi JenniferRah,

 

Here is the code they are using; looks like they used the Code Snippet from Flow Designer

var result = sn_fd.FlowAPI.getRunner().subflow('global.os__reactivate_okta_user_prod').inForeground().withInputs(inputs).run();

Does it need to run in the Foreground? That might be why it's doing that. I might try changing that to inBackground to see if that resolves the issue.