This example assumes review.json exists and holds one workflow definition.
import {readFile} from 'node:fs/promises'
import {validateDefinitionInputs} from '@sanity/workflow-engine'
const definition = JSON.parse(await readFile('review.json', 'utf8'))
const report = validateDefinitionInputs([definition])
if (!report.valid) {
for (const result of report.results) {
if (!result.valid) console.error(result.error)
}
}
Check JSON workflow definitions without contacting the Content Lake: shape, cross-field invariants, and GROQ syntax. Each definition may be in authoring shape or stored form.
Deploy runs further checks this does not: duplicate names, spawn dependencies, resource bindings, project roles, and the reader-model acknowledgement. A valid result does not guarantee a deploy succeeds.