The execute command processes every step in a manifest sequentially: resolving $ref values from prior step results, validating inputs against the table schema, and calling the skill operation. In TTY mode it runs preflight + preview as default-on gates before any instance write; in CI / --ci mode the gates are off unless opted in. Results are saved to .sn-results/ with the resolved target instance key for use by validate, test, and drift.
execute
Run a manifest against your ServiceNow instance.
sn execute <manifest.ts> [--target <name>] [--profile <name>]
[--warm-refs] [--depth N] [--no-required-only]
[--preflight] [--no-preflight] [--skip-instance-checks] [--offline]
[--preview] [--no-preview] [--yes] [--ci] [--open]
[--threshold <n>] [--preview-out <dir>]
[--only <id[,id]>] [--from <id>] [--to <id>] [--skip <id[,id]>]
[--resume] [--check-drift] [--accept-mismatch] Run all manifest steps against the connected instance.
Arguments
| Name | Required | Description |
|---|---|---|
| manifest.ts | Yes | Path to the manifest TypeScript file. |
Flags
| Flag | Default | Description |
|---|---|---|
| --target <name> | — | Instance registry key. Falls back to `SN_TARGET`, `sn.config.ts` targetInstance, then registry default. |
| --profile <name> | — | Credential profile from the resolved target instance. Steps can also set `profile` individually. |
| --warm-refs | — | Pre-cache schemas for tables referenced in manifest inputs. |
| --depth N | 1 | Depth of reference-following for schema warming. |
| --no-required-only | — | Include optional fields when warming schema cache. |
| --preflight / --no-preflight | — | Force the preflight gate on or off. Default: on for TTY, off for `--ci`/non-TTY. |
| --skip-instance-checks | — | Run preflight statically only — skip the instance-aware validators. |
| --offline | — | Answer instance checks from the `.sn-pulls/` cache instead of hitting the network. |
| --preview / --no-preview | — | Force the preview/complexity gate on or off. Default: on for TTY, off for `--ci`. |
| --yes | — | Required to proceed past a tripped complexity gate in non-interactive mode. |
| --ci | — | Marks the run as non-interactive. Disables default gates. |
| --open | — | Open the generated preview README after writing. |
| --threshold <n> | — | Override the complexity threshold used by the preview gate. |
| --preview-out <dir> | <manifest-dir>/.sn-preview/<basename> | Output directory for preview artifacts. |
| --only <id[,id]> | — | Run only the listed step IDs. Requires a prior successful execute (uses `.sn-results/` for skipped steps). |
| --from <id> | — | Run from this step to the end (inclusive). Requires prior execute. |
| --to <id> | — | Run from the start through this step (inclusive). Requires prior execute. |
| --skip <id[,id]> | — | Exclude listed step IDs. Combinable with `--from` / `--to`. Requires prior execute. |
| --resume | — | Re-run from the first failed step in the last execute. Synthesizes prior results for all preceding steps. |
| --accept-mismatch | — | Suppress the warning when prior `.sn-results/` target metadata differs from the current resolved target. |
| --check-drift | — | After execute, run a drift check and surface any divergence before exiting. |
Examples
sn execute manifests/business-rule/manifest.ts▸ Preflight: ✓ 3 step(s) validated
▸ Preview: ✓ Complexity 4 / 20 — ARTIFACT (auto-approved)
Executing manifest: 3 steps
✓ my_rule business-rule create 0.8s
✓ my_test atf create_test 1.2s
✓ my_suite atf create_suite 0.6s
3/3 steps passed (2.6s)
sn execute manifests/payroll/manifest.ts --ci --yes| Mode | Preflight default | Preview default | Complexity gate |
|---|---|---|---|
| TTY | on | on | blocks unless below threshold or `--yes` |
| --ci / non-TTY | off | off | off unless `--preview` / `--preflight` opted in |
Execute creates or updates real records on your instance. Always use a sub-production instance for development. All operations are idempotent — re-running the same manifest updates existing records rather than creating duplicates.