@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
tryCatchblocks. - 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):
roleMaprecommended for ZP10 and AP3+roleRestrictionspre ZP10 and AP3 instances
Table
- Added
augmentproperty. 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
createAccessControlsfor creating default access controls - Added
userRoleto wire the tables auto-generated access controls to a given user role.
Protection Policy support
- Added
protectionPolicyto all APIs that havesys_policysupport in metadata.
CLI Enhancements
- Transform by table — The
transformcommand 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_credentialsauth for CI install — Theinstallcommand now supports OAuthclient_credentialsflow via environment variables for CI/CD pipeline authentication. New env variables are available to configure this [[LINK]] initin current working directory — Theinitcommand 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
annotationTypecausing a build error after transform. - Corrected the
lookUpRecordcore action property from__snc_dont_fail_on_errortodont_fail_flow_on_error. - Fixed a missing
action_statuselement mapping whenwfa.errorEvaluation()is present. - Fixed
internal_namebeing regenerated fromnameduring Fluent→XML transformation.
Tables
- Fixed
sys_dictionaryrecords not being set to active as part of component output. - Fixed calculated and reference field qualifier handling.
- Fixed
callerAccesshad incorrect default value - Fixed
choiceon column componentns had incorrect default value
General
- Fixed the UI Policy plugin dropping
sys_ui_policy_actionandsys_ui_policy_rl_actionrecords. - Fixed Column
readOnlyandreadOnlyOptionhandling - Fluent linting level for server modules is now overridable via new
linterproperty in now.config.json - Scope prefix is now validated against the instance vendor code during
initcommand 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, andTestrecords in some situations. - Fixed
ScheduledScriptweekly frequency validation to accept eitherdayOfWeekordaysOfWeek.