Subflow running as user but set to Run As System User
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 11:34 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 12:04 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 12:05 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 12:07 PM
Hi JenniferRah,
Here is the code they are using; looks like they used the Code Snippet from Flow Designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 12:18 PM
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.