Building apps in source code in ServiceNow Studio

  • Release version: Australia
  • Updated July 15, 2026
  • 2 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 apps in source code in ServiceNow Studio

    Developing applications in source code within ServiceNow Studio allows you to create and manage complex applications efficiently. Using ServiceNow Fluent, a domain-specific programming language, you define application metadata programmatically, enabling better source control management and early error detection during build time.

    Show full answer Show less

    Applications built or converted in ServiceNow Studio follow a structured source code format similar to Node.js/npm packages, facilitating modular development and integration.

    Application Structure

    The source code app structure includes key directories and configuration files that support development, building, packaging, and deployment:

    • .vscode: Recommended Visual Studio Code extensions for development.
    • dist: Contains build artifacts, including compiled metadata XML and static assets.
    • metadata: Stores application metadata in XML, reflecting the app’s schema and business rules (note: metadata should be edited via source code or the ServiceNow AI Platform, not directly in XML files).
    • nodemodules: Third-party Node.js modules dependencies.
    • src: Source code files organized into client-side UI files, ServiceNow Fluent code, and server-side JavaScript or TypeScript modules.
    • target: Contains the packaged installable application (.zip) ready to upload to an instance.
    • Configuration files:
      • now.config.json: Defines application configuration and structure customization.
      • package.json: Describes app info and dependencies, essential for app management on instances.
      • Additional files like .eslintrc for code quality and .gitignore for source control management.

    Working with Fluent Apps in ServiceNow Studio

    • Create a workspace: Organize multiple applications you are developing.
    • Create an app in source code: Start new applications directly in source code format using ServiceNow Studio.
    • Convert existing apps to Fluent: Migrate existing ServiceNow apps to source code development using ServiceNow Fluent.
    • Build and install Fluent apps: Compile source code and deploy application changes across your ServiceNow instance efficiently.
    • Synchronize Fluent apps: Download and transform existing application metadata into Fluent source code, ensuring source code and instance stay aligned.

    This approach empowers ServiceNow customers to leverage modern development workflows, improve collaboration through source control, and maintain higher code quality and consistency when building or evolving their applications.

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

    To create apps in ServiceNow Studio, 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. For more information, see ServiceNow Fluent.

    Application structure

    Fluent applications created or converted in ServiceNow Studio 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.

    Structure of a source code application created in ServiceNow Studio

    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.