Building applications in source code

  • Release version: Yokohama
  • Updated June 2, 2026
  • 4 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Building applications in source code

    ServiceNow enables customers to create and develop custom scoped applications directly in source code using familiar tools like the ServiceNow IDE on the ServiceNow AI Platform or Visual Studio Code Desktop with the ServiceNow SDK. Development leverages ServiceNow Fluent, a domain-specific language for defining application metadata, alongside JavaScript modules and third-party libraries to enhance code reuse and scripting capabilities within scoped applications.

    Show full answer Show less

    This approach allows developers to work in their preferred environments, manage source control efficiently, and catch errors during build time, improving application quality and collaboration. Note that the Global scope or global applications are not supported in the Yokohama release.

    Development Environments and Features

    • ServiceNow IDE: An online IDE based on Visual Studio Code for the Web, integrated with the ServiceNow AI Platform, supporting real-time collaboration, Git-based source control with one concurrent branch per instance or sandbox, and built-in Build Agent access.
    • ServiceNow SDK: A local development environment using Visual Studio Code Desktop, supporting offline work, full Git functionality, collaboration through source control, Build Agent skills (from version 4.6.0), and command-line interface for syncing changes with instances.

    Both environments fully support ServiceNow Fluent and JavaScript modules, allowing flexible and efficient application development.

    Application Structure

    Applications developed in source code follow a structure similar to Node.js/npm packages, defined by package.json and now.config.json files. Key directories include:

    • .vscode: Recommended extensions for Visual Studio Code.
    • dist: Build artifacts for packaging, including metadata XML and static assets.
    • metadata: Application metadata files (XML) representing tables, business rules, etc.; editing should be done in source code or the ServiceNow AI Platform, not directly in XML.
    • nodemodules: Third-party Node.js dependencies.
    • src: Source code including client-side UI files, ServiceNow Fluent code, and server-side JavaScript modules.
    • target: Installable package (.zip) ready for instance upload.

    Additional configuration and tooling files such as .eslintrc (for code linting), .gitignore (to exclude files from source control), and dependency manifests (package-lock.json, now.prebuild.mjs) support development and packaging processes.

    Practical Benefits for ServiceNow Customers

    • Develop complex custom applications in familiar coding environments with robust tooling and collaboration capabilities.
    • Leverage ServiceNow Fluent for clear, structured metadata definition alongside JavaScript for advanced functionality.
    • Maintain consistent application structure and configuration, facilitating packaging and deployment.
    • Integrate with Git-based source control to manage code versions and collaborate effectively.
    • Use Build Agent and code autocomplete features to improve development productivity and code quality.

    Next Steps

    To maximize the benefits of source code development, customers should familiarize themselves with ServiceNow Fluent, the application directory structure, and configuration files like now.config.json. Understanding the differences between the IDE and SDK environments will help choose the best tool for their development workflow.

    Create and develop custom applications in source code using familiar development tools and processes.

    Overview of development in source code

    You can create scoped applications in code using the ServiceNow IDE on the ServiceNow AI Platform or locally in Visual Studio Code Desktop with the ServiceNow SDK.

    In either development environment, you use ServiceNow Fluent, a domain-specific programming language, to define the metadata that makes up applications. ServiceNow Fluent includes APIs for defining the different types of metadata.

    With the ServiceNow IDE or ServiceNow SDK, you can also create JavaScript modules and use third-party libraries in your application to optimize code reuse in scripts within a scoped application.

    Developing and maintaining applications in source code enables you to work in familiar development environments, create and modify complex applications, manage code in source control more easily, and catch errors at build time.

    Note:
    The ServiceNow IDE and ServiceNow SDK don't support the Global scope or global applications in the Yokohama release.

    Comparison of the ServiceNow IDE and the ServiceNow SDK

    Feature ServiceNow IDE ServiceNow SDK
    Development environment Online ServiceNow instance Local development and the ability to work offline
    User interface IDE based on Visual Studio Code for the Web Visual Studio Code Desktop
    Collaboration View any user's changes in real time in code or embedded ServiceNow AI Platform user interfaces from the Metadata Explorer.

    Collaborate with other developers on applications in source control.

    Download changes from an instance and install local changes to an instance using the ServiceNow SDK CLI to collaborate with other users.

    Collaborate with other developers on applications in source control.

    Source control Supports the most common Git functionality and integrating with a Git provider of your choice.

    One concurrent branch per repository per instance (or developer sandbox).

    Full support
    Application conversion Support for converting existing scoped applications not created with the ServiceNow IDE or ServiceNow SDK. Support for converting existing scoped applications not created with the ServiceNow IDE or ServiceNow SDK.
    ServiceNow Fluent Full support

    The ServiceNow Fluent Language server is included with the ServiceNow IDE.

    Full support

    The ServiceNow Fluent Language server can be installed from the Visual Studio Code Extension Marketplace.

    JavaScript modules and third-party libraries Full support Full support
    ServiceNow Otto for Code Code auto-complete support for scripts.

    For information about activation, see Now Assist for code generation.

    Not supported
    Build Agent Full support. Build Agent is accessed from a chat panel in the ServiceNow IDE.

    For information about activation, see Build Agent.

    Build Agent skills are available beginning with ServiceNow SDK version 4.6.0.

    Application structure

    Custom scoped applications created with the ServiceNow IDE or ServiceNow SDK include source code files and metadata XML files. The package.json and now.config.json files define the application structure, which is similar to that of Node.js applications or Node Package Manager (npm) packages.

    Figure 1. Default structure of an application created in the ServiceNow IDE
    Structure of an application created in the ServiceNow IDE

    By default, applications include the following directories and files. You can modify certain aspects of the application structure to suit your needs in the now.config.json file.

    Table 1. Application structure in source code
    Directory or file Description
    .vscode Directory containing recommended Visual Studio Code extensions.
    dist Directory containing the build artifacts for packaging. This directory includes the following subdirectories:
    • app: Directory containing the built metadata XML files.
    • static: Directory containing the built static asset files.
    metadata

    Directory containing the application metadata (XML) of the application, such as table schemas and business rules, organized in the same directory structure as existing ServiceNow applications.

    Note:
    Application metadata shouldn't be edited from the XML files. Edit application metadata in the source code or on the ServiceNow AI Platform.
    node_modules Directory containing the third-party Node.js modules on which your application depends.
    src Directory containing the source code of your application. This directory includes the following subdirectories:
    • client: Directory containing the client-side files for developing user interfaces.
    • fluent: Directory containing ServiceNow Fluent code in .now.ts files. The generated subdirectory contains the application files converted to ServiceNow Fluent.
    • server: Directory containing JavaScript module code in .js or .ts files.
    target Directory containing an installable package (.zip file) to upload to an instance.
    .eslintrc File containing the ESLint configuration. ESLint helps identify and fix issues in the application code.
    .gitignore File containing a list of directories or files for Git to ignore. These files aren't tracked in source control.
    now.config.json File containing the ServiceNow application configuration. The now.config.json file must be in the base directory for an application. You can configure aspects of an application by adding support parameters. For more information, see Custom application configuration in source code.
    now.prebuild.mjs Auto-updated file containing complete information about dependencies and their versions. This file is only available with the ServiceNow SDK.
    package-lock.json Auto-updated file containing complete information about dependencies and their versions. This file is only available with the ServiceNow SDK.
    package.json File containing information about your application and custom or third-party module dependencies. The package.json file must be in the base directory for an application. On an instance, the package.json path is specified in the Package JSON field of the custom application record [sys_app] in the format <scope>/<package-name>/<version>/package.json.

    Related applications and features

    JavaScript APIs
    Use JavaScript APIs in scripts that you write to change the functionality of applications or when you create applications.