Run Scheduled Import via API call
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 08:56 AM
Is this possible to do? We have a lot of data movement and automated processes that run local on a server to do various things outside of ServiceNow. One of the things I'd like to add to this is the ability to run a scheduled job via the ServiceNow Rest API.
Is that possible to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 09:12 AM
Check if you have the ability to invoke scheduled jobs via API. For example, refer below article
https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page
If answer is yes, you can use ServiceNow REST API to invoke the task scheduler API to trigger the scheduled jobs.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 09:19 AM
Hey @bigbacon ,
Absolutely, this can be done using flow designer, easy to understand, clean and maintainable.
Steps to achieve this:
- First create REST message with GET HTTP method to call the rest API, meaning get the endpoint from where you want to get the data.
- Test if getting the data
- Copy the code from 'preview script usable' button shown on GET method screen.
- Ensure you have the integration hub installed. Create a custom action, if you want to have any parameter/input, add the script step in action. (You may create the data stream to handle the data iteration)
- In script step paste the copied script usage and iterate over the data.
- Create one staging table extending the 'sys_import' table and specify the target table as well.
- Create the right transform map.
- Now in script step iterate over the data and insert that data with all required field in staging table.
- Once it is inserted in staging table, as it is extended from 'sys_import' it will automatically run the transform map. No need to run explicitly.
- Now create a one new flow designer with appropriate trigger condition and add the created custom action in action.
- Once it is created successfully, test and activate the flow designer.
This way you can schedule the data import using REST API.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 06:53 AM
The question is it possible to make a call to the SN API to say "Hey, run this scheduled import."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 07:07 AM
Hi @bigbacon ,
Yes, by using the flow designer's trigger condition. So every flow designer has trigger condition, so that you can schedule to run at specified time like every day at 9 AM, when record is inserted in particular table or a field is update or application scope.
Then in action, you will have to create a custom action with the help of integration hub, as you are going call the REST API.
See the attached screenshot.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!