RUn flows with Service account
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi community
is there a way to run flows as a service account that I create in the user table.
I can only see options to run as system user or as user who initiates flow.
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @AnthonyMull ,
No, not to my knowledge. But at the same time I could ask - what is the reason for trying to do this? Either you have a system user with right privilege to run the flows or you are running the flow as the user. What should the reason be for a 3rd option?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Not supported.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @AnthonyMull ,
Yes, you can run parts of a flow as a specific service account, but it's not done in the main flow properties. You're correct that the primary "Run As" setting for a flow is limited to the System User or the User who initiates the session.
The way to accomplish this is by setting the "Run As" property on an individual Action or Subflow within the main flow.
How to Run Actions as a Specific User
The most common and secure practice is to set the main flow to Run as System User. This gives the flow the necessary permissions to execute. Then, for any specific tasks that must be performed by your service account (perhaps due to specific roles, permissions, or for auditing purposes), you can impersonate that user for that single step.
Here’s how you do it:
In your flow, add the Action you need (e.g., "Create Record," "Update Record").
Click the three-dot "more actions" menu icon on the top right of that Action's box and select Show advanced options.
A Run As field will appear. By default, it's set to "Flow's Run As setting".
Change this to Specific User.
A new field will appear where you can search for and select the service account you created in the User [sys_user] table.
Now, only this specific action will execute as your service account, while the rest of the flow continues to run as the System User.
Best Practice: Using a Subflow or Custom Action ✅
While you can set the "Run As" property on every individual action, it can become difficult to manage if you have many steps. A cleaner and more reusable approach is to group all the steps that need to be run by the service account into a dedicated Subflow or a custom Action.
Create a New Subflow: Build a new subflow that contains all the logic (e.g., creating a record, updating a CI, etc.) that your service account needs to perform.
Call the Subflow: In your main flow, use the "Run Subflow" action to call the subflow you just created.
Set "Run As" on the Subflow Action: Just as described above, show the advanced options for the "Run Subflow" action and set its Run As value to your Specific User (the service account).
This method is much easier to maintain because all the impersonated logic is encapsulated in one place. If you ever need to change the service account, you only have to update it in one spot in your main flow.