github ServiceNow/sdk v4.13.0
SDK 4.13.0

4 hours ago

@servicenow/sdk — Release Notes

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


🚀 Overview

Version 4.13.0 adds a new Fluent API — DatabaseView for sys_db_view records — along with MFA support for basic-auth login, a fix for a OAuth cookie-replay bug that could cause app installs to silently fail. Playbook Fluent gains variant overrides, a new Go Back activity, decision-branch ideal-path support, and public playbook support via the bundled @servicenow/sdk-playbook-plugin bump.


New Fluent APIs

DatabaseView API
A new Fluent API for defining database views (sys_db_view). Comes with a full SDK guide covering common use cases, IDE autocomplete on table field references, and app-prefix diagnostics (customer apps use their scope prefix, global apps use u_).

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

DatabaseView({
    $id: Now.ID['incident_by_caller'],
    name: 'u_incident_by_caller',
    label: 'Incidents by Caller',
    tables: [
        { name: 'incident', variablePrefix: 'inc' },
        { name: 'sys_user', variablePrefix: 'usr', where: 'inc.caller_id=usr.sys_id' },
    ],
    fields: [
        { name: 'number', table: 'incident' },
        { name: 'caller_name', table: 'sys_user', field: 'name' },
    ],
})

Authentication

MFA challenge support during basic auth
now-sdk commands using basic auth now handle the mfa_code_required challenge from the instance. On a challenge, the CLI now prompts for a 6-digit TOTP code if requested.

Fix: OAuth session cookie replay causing silent install failures
OAuth was accumulating session cookies for each request, that could cause install failures with instances that enforced restrictions on API session reuse.

CLI

--timeout flag on long-running commands
now-sdk download, transform can hit default 300-second per-response idle timeout on large apps, even when the server connection is healthy. These commands now use a long-running dispatcher by default and expose a --timeout flag to override it explicitly.

Transform / Build Pipeline

Backing script files for Now.include() on transform
When transform emits a Now.include('./path.js') reference, the backing script file is now created on disk alongside it, so the transformed project builds and edits cleanly with no missing files.

Table augmentation improvements

  • Table augmentation now supports adding an index to an existing table.
  • Augmenting an existing table no longer overwrites platform-set columns like access flags.

Column documentation serialization
Fixed hint, help, and plural serialization for sys_documentation records emitted by Column().

Flow

  • Hoisting support extended to Try/Catch and Data-in-Process (DIP) blocks, with docs for the hoisting use case.
  • endFlow is now supported inside a Catch block.
  • Fix: inline script scriptActive field is now updated correctly.
  • Fix: resolved a label cache bug that could produce stale labels.

Playbook

  • Variant overrides and variant-specific activities — a playbook can now express variants with their own activities and per-variant overrides on shared activities.
  • New Go Back activity for navigating back to a prior step in a playbook, with a build-time diagnostic for the variant evaluation point.
  • isIdealPath on decision branches — mark the intended happy-path branch on a decision.
  • Automation plan pills — support for automation plan pill references in playbook fields.
  • Image attachment support on playbook activities.
  • Public playbooks — support authoring playbooks that expose a public API.
  • Activity action-overrides for customizing activity actions per playbook.
  • Fixes: empty args in a variant-override startRule After() on transform; validation for mandatory activity inputs and experience properties; corrected JSDoc @since versions.

Docs

Better now-sdk explain ranking
now-sdk explain results are now ranked by the position of the matching tag in each doc's tag array, so searches like explain table or explain playbook surface the most relevant guide first. Also fixes a non-deterministic tie-break that could return different top results on different machines.

Don't miss a new sdk release

NewReleases is sending notifications on new releases.