What is Script Include in ServiceNow?
A script include is a reusable library of server-side JavaScript. Instead of copying the same logic into several business rules or flows, you write it once in a script include and call it wherever it’s needed.
How script includes work
Most script includes are written as a class using Class.create(), with methods on its prototype. Other server scripts call it like new IncidentUtils().getOpenCount(userId). Script includes only load when they are called, so they don’t slow down the platform when unused.
Client-callable script includes
When a client script needs server data, it uses GlideAjax to call a script include that extends AbstractAjaxProcessor and has Client callable checked. The client sends parameters with addParam(), the script include reads them with this.getParameter(), and returns only the data the form needs.
A practical example
A script include called ApprovalUtils could contain a method that finds the right approver for a cost center. Business rules, a catalog flow and a scheduled job can all call that one method, so when the approval logic changes, it only changes in one place.
Scope and access
In scoped applications, a script include’s “Accessible from” setting decides whether other scopes can use it. Keep it limited to its own scope unless other apps truly need it.
Best practices
Name script includes and methods clearly by what they do. Keep each one focused on one area, such as incidents or approvals. Protect client-callable script includes with role checks or ACLs, since they can be called from the browser.
Frequently asked questions
When should I use a script include instead of a business rule?
Use a script include for any logic you want to reuse or call from several places. Business rules should call script includes rather than contain long scripts.
Are client-callable script includes secure?
Only if you make them secure. They can be called by any logged-in user, so check permissions inside the method or with ACLs.
Can flows use script includes?
Yes. Custom actions in Flow Designer can call script includes through a script step.
Related ServiceNow terms

Need help with Script Include or anything else in ServiceNow? We’re here with practical solutions that fit your organization and your teams.
Browse all 100 ServiceNow terms
ServiceNow is a trademark of ServiceNow, Inc. This glossary is an independent resource by Sequal Consultancy and is not affiliated with or endorsed by ServiceNow, Inc.