Finding Hardcode user approvals for workflow/Flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi
How can we identify all requests workflows/flows in ServiceNow where the approval user activity has a single hardcoded approver (either a username or sys_id), instead of a dynamic reference?
Any script for these? or we should go one by one flow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
finding it in workflow is relatively simple, check below
Finding references / sys_ids in Workflows
For Flow it's somewhat challenging
I used this in past and it helped me to some extent
Flow Designer - Search through flows efficiently with scripts
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Thank you for marking my response as helpful.
please close the thread by marking appropriate response as correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @rajesh54
You can query workflows in (wf_activity table and sys_variable_value) and flows (sys_hub_flow and sys_hub_action_instance tables).
1: Querying Workflows (wf_activity table)
- Navigate to System Definition > Scripts - Background (or use a background script in Studio).
- Run a script to query the wf_activity table looking for activities of type Approval - User or Approval - Group where the variables field contains a hardcoded user's Sys ID or string.
2. For Flow : check on table sys_variable_value and sys_hub_action_instance tables)
When Action type is Ask for Approval, It reference value from sys_variable_value // check the table record value in xml and validate
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You don’t have to go one by one...! you can script this by querying sys_hub_flow + sys_hub_action_instance (for Flow Designer) and wf_activity (for legacy workflows) looking for approval steps where approver is a static value.
For flows, check action inputs like approvers or user for hardcoded sys_ids; for workflows, query wf_activity where type = approval and inspect the approver field for static values.
Are you mainly using Flow Designer or classic workflows, or a mix of both?