The schema command fetches field definitions for any ServiceNow table and caches them locally with a 14-day TTL. Cached schemas are used by execute to validate manifest inputs before sending requests to your instance.
schema
Query and cache table field schemas from your ServiceNow instance.
sn schema [--refresh] <table-name> Query and cache table field schemas.
Arguments
| Name | Required | Description |
|---|---|---|
| table-name | Yes | The ServiceNow table to query (e.g., incident, sys_script_include). |
Flags
| Flag | Default | Description |
|---|---|---|
| --refresh | — | Force re-fetch from instance, bypassing the 14-day cache. |
Examples
sn schema incidentincident (87 fields, cached 2026-04-01)
active boolean
assigned_to reference → sys_user
category string (choice)
...
sn schema --refresh sys_script_includeRefreshing schema for sys_script_include...
sys_script_include (24 fields, cached 2026-04-05)
Schemas include inherited fields from parent tables. The cache is scoped per instance — switching SN_INSTANCE in .env fetches fresh schemas automatically.