sndev.io / docs

execute

Run a manifest against your ServiceNow instance.

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.

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

NameRequiredDescription
manifest.tsYesPath to the manifest TypeScript file.

Flags

FlagDefaultDescription
--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-refsPre-cache schemas for tables referenced in manifest inputs.
--depth N1Depth of reference-following for schema warming.
--no-required-onlyInclude optional fields when warming schema cache.
--preflight / --no-preflightForce the preflight gate on or off. Default: on for TTY, off for `--ci`/non-TTY.
--skip-instance-checksRun preflight statically only — skip the instance-aware validators.
--offlineAnswer instance checks from the `.sn-pulls/` cache instead of hitting the network.
--preview / --no-previewForce the preview/complexity gate on or off. Default: on for TTY, off for `--ci`.
--yesRequired to proceed past a tripped complexity gate in non-interactive mode.
--ciMarks the run as non-interactive. Disables default gates.
--openOpen 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.
--resumeRe-run from the first failed step in the last execute. Synthesizes prior results for all preceding steps.
--accept-mismatchSuppress the warning when prior `.sn-results/` target metadata differs from the current resolved target.
--check-driftAfter 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
ModePreflight defaultPreview defaultComplexity gate
TTYononblocks unless below threshold or `--yes`
--ci / non-TTYoffoffoff 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.