Editorial Workflows
Model, run, and observe content workflows on the Content Lake: definitions, stages, activities, and effects, from editorial review to full automation.


At a glance
The small set of concepts behind Editorial Workflows, and how they fit together.
Getting started
Define your first workflow in TypeScript, deploy it, and move a Sanity document through its stages.
Engine
The library that evaluates and commits Editorial Workflow instances.
Definitions and instances
A definition describes a process. An instance is one run of that process.
Stages and transitions
Stages mark where an instance is. Transitions define where it can move.
Activities and actions
Activities represent work in a stage. Actions let callers and triggers update workflow state, queue effects, and resolve that work.
Fields
Fields carry the typed data belonging to a workflow instance.
Conditions
How workflow rules decide: GROQ conditions evaluated against the instance’s rendered scope, and named conditions that keep repeated rules in sync.
Operations
The write vocabulary: a small set of ops that mutate an instance’s fields and statuses, carried by actions and by effect completions.
Effects and runtimes
Why the engine queues side effects instead of running them, and where the runtime lives: the verbs your processes call to move workflows forward.
Guards and enforcement
Define Content Lake enforcement contracts that protect referenced content while an instance occupies a stage.
Subworkflows
How a large process composes out of smaller ones: an action spawns a child workflow per row of a query, and a trigger resolves the parent’s activity once they all settle.
Global document references
Why every document pointer in a workflow carries its location, and how resource aliases keep deployed definitions portable across environments.
History and audit trail
Understand the durable event history stored on every Editorial Workflows instance, what it records, and where its provenance boundary ends.
The reactive session
Use a reactive session to keep a custom Editorial Workflows interface synchronized, preview field edits, and commit actions safely.
Set up the Studio plugin
Install the Editorial Workflows plugin for Sanity Studio and use document controls and cross-document workflow tasks.
App SDK
Build an App SDK interface that lists workflow instances, renders live state, explains blocked work, and commits actions and field edits.
Custom reactive adapters
Connect Editorial Workflows to an unsupported host or data layer by implementing the store-agnostic reactive observer contract.
Reusable UI components
Add assignment, date, member, and workflow-diagram controls to a custom Editorial Workflows interface.
Set up the workflow CLI
Install and configure the command-line tool that deploys and manages workflow definitions and the instances they run.
Set up the MCP server
Connect an AI agent to your workflows over MCP: an org token authenticates the server, and each tool call addresses the environment it acts on.
Test your workflows
Run the real workflow engine in memory: drive every path of a workflow, control the clock, simulate guard enforcement, and assert on exactly what happens.
Reference
Find the authoritative API and type reference for each Editorial Workflows domain. Exact contracts live at the bottom of the corresponding concept page.
Limits
The engine’s operational caps and defaults: what each protects, and where to tune the ones you can.
Editorial Workflows release notes
Curated overviews of recent Editorial Workflows prerelease package waves.
How the prerelease works
Prerelease status for Editorial Workflows: versioning under 0.x, where workflow data lives, what guards enforce today, and who runs the effect runtime.
Cookbook
Worked, runnable workflow examples for Sanity: editorial review, AI content pipelines, coordinated releases, and more, each a complete definition.
Cookbook: Editorial review
A four-stage editorial review workflow for Sanity: assignment, drafting, review, and published, driven by human actions in the Studio.
Cookbook: AI content pipeline
An AI content pipeline built on Editorial Workflows: effect handlers call generation APIs while editors approve results through workflow actions.
Cookbook: Coordinated release
A release workflow that coordinates approvals across many documents and hands the atomic go-live to a Content Release.
Cookbook: Handle a deleted subject document
Apply an application-owned lifecycle policy when content watched by an Editorial Workflow is deleted.