github ServiceNow/sdk v4.7.0
SDK 4.7.0

5 hours ago

@servicenow/sdk — Release Notes

Version: 4.7.0
Availability: npm — https://www.npmjs.com/package/@servicenow/sdk


🚀 Overview

Version 4.7.0 adds a universal field override escape hatch, new DataPolicy and protectionPolicy expanded to most APIs, expanded Flow capabilities, and plenty of fixes!


New Fluent APIs

Universal Field Override

Fluent APIs now support an $override property, giving developers an escape hatch to set any field not otherwise exposed by the API surface. This is useful for setting custom properties on APIs from other applications.

import { BusinessRule } from '@servicenow/sdk/core'

BusinessRule({
  $id: Now.ID['some-id'],
  $override: {
    x_myscope_customfield: 'value',
    u_globalfield: 'value1'
  }
})

Data Policy

The new DataPolicy API enables declarative creation of sys_data_policy2 records, including rule-level conditions and field-level enforcement configuration.

import { DataPolicy } from '@servicenow/sdk/core'

DataPolicy({
    $id: Now.ID['import_soap_policy'],
    table: 'incident',
    shortDescription: 'Data Policy for Import and SOAP',
    description: 'Enforce data validation for records created via import sets or SOAP',
    applyToImportSets: true,
    applyToSOAP: true,
    useAsUiPolicyOnClient: false,
    rules: {
        short_description: {
            mandatory: true,
        },
        caller_id: {
            mandatory: true,
        },
        category: {
            mandatory: true,
        },
    },
})

New Features and Enhancements

Flow

This release significantly expands flow authoring capabilities:

  • Flow Stages — Flows now support stage definitions, with diagnostics and the ability to use stages inside tryCatch blocks.
  • TryCatch — Flows can now define try/catch logic blocks for structured error handling.
  • DoInParallel — A new flow logic block enables parallel execution of steps within a flow.
  • AppendToFlowVariables — A new action appends values to existing flow variable collections.
  • Action Outputs and Error Evaluation — Flows can now evaluate action outputs and error states as part of flow logic.

AI Agent Framework (AIAF)

  • roleList made optional, roleMap added — Both DataAccessConfigType (AiAgent) and DataAccessConfigWorkflowType (AiAgenticWorkflow) now accept either roleList (legacy role sys_ids) or the new roleMap (role names stored in M2M sys_agent_access_role_mapping records). At least one must be non-empty at build time. Customers on ZP10 or later should prefer roleMap.
  • agentDescriptor field added to AiAgent — New optional field ('require_caller_id' | 'created_by_ai_agent_advisor' | 'created_by_build_agent' | '') written to sn_aia_agent_config.

Now Assist Skill Kit (NASK)

  • Adds support for configuring role-based access on NowAssist Skills via two fields (at least one field must be defined):
    • roleMap recommended for ZP10 and AP3+
    • roleRestrictions pre ZP10 and AP3 instances

Table

  • Added augment property. Use this when augmenting an existing table that is not part of the application scope. This can be used when you need to add properties.
  • Added createAccessControls for creating default access controls
  • Added userRole to wire the tables auto-generated access controls to a given user role.

Protection Policy support

  • Added protectionPolicy to all APIs that have sys_policy support in metadata.

CLI Enhancements

  • Transform by table — The transform command now supports targeting one or more specific tables at a time. Records are filtered to the metadata directory on transform, and transformed XML files are cleaned up automatically.
  • Performance - The CLI startup time has been substantially reduced, particularly for commands that don't load the project such as explain, help, version, etc.
  • OAuth client_credentials auth for CI install — The install command now supports OAuth client_credentials flow via environment variables for CI/CD pipeline authentication. New env variables are available to configure this [[LINK]]
  • init in current working directory — The init command can now be run directly in the current working directory without requiring a new subdirectory.

Fixes

Flow

  • Fixed datapill becoming empty in script step input for custom action.
  • Fixed an empty annotationType causing a build error after transform.
  • Corrected the lookUpRecord core action property from __snc_dont_fail_on_error to dont_fail_flow_on_error.
  • Fixed a missing action_status element mapping when wfa.errorEvaluation() is present.
  • Fixed internal_name being regenerated from name during Fluent→XML transformation.

Tables

  • Fixed sys_dictionary records not being set to active as part of component output.
  • Fixed calculated and reference field qualifier handling.
  • Fixed callerAccess had incorrect default value
  • Fixed choice on column componentns had incorrect default value

General

  • Fixed the UI Policy plugin dropping sys_ui_policy_action and sys_ui_policy_rl_action records.
  • Fixed Column readOnly and readOnlyOption handling
  • Fluent linting level for server modules is now overridable via new linter property in now.config.json
  • Scope prefix is now validated against the instance vendor code during init command if auth is configured.
  • Improved build times for large projects by reducing garbage collection pressure.
  • Fixed default values for service catalog records.
  • Fixed carriage returns not being escaped, which caused data loss during round-trips on Windows.
  • Fixed transform generating invalid Fluent for ACL, ScriptInclude, and Test records in some situations.
  • Fixed ScheduledScript weekly frequency validation to accept either dayOfWeek or daysOfWeek.

Don't miss a new sdk release

NewReleases is sending notifications on new releases.