Extract Built-in Action Scripts via Custom API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I'm building a custom REST API to extract Flow Designer workflow data for migration purposes. I've successfully accessed most tables (sys_hub_flow, sys_hub_action_instance, sys_hub_action_step, sys_hub_action_instance_v2), but I'm unable to query the sys_hub_action table to get the scripts/logic behind built-in actions. Any advice on how to extract the logic/code behind every actions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Buddy,
What your running into is another as by design part of ServiceNow
For OOTB Flow Designer actions, the actual logic isnt stored in a way that you can extract via REST or table queries. Even though you can see references in tables like sys_hub_flow, sys_hub_action_instance, and the v2 tables, the implementation behind built-in actions lives inside protected application code spokes, script includes, internal definitions. Because of that the sys_hub_action table either isn’t queryable or doesn’t expose the underlying scriptts.
So Basically:
You can extract flow structure, step configuration, inputs/outputs, and which actions are used.
You can extract the full script logic for custom actions you’ve built yourself.
You cannot reliably extract the actual code behind OOTB/built-in actions.
For migration, the usual and supported approach is:
Migrate custom flows, subflows, and custom actions via update sets, app repo, or source control).
For OOTB actions, migrate only the references and make sure the same spokes/plugins and versions are installed in the target instance. The logic comes with the product, not your data.
If your goal is to rebuild or audit custom logic focus on custom actions and script steps. If the goal is environment migration treating OOTB actions as dependencies rather than exportable code is the right approach.
@RahulT538699779 - Please mark Accepted Solution and Thumbs Up if you found Helpful 🙂
