Sanity · Arazzo Workflow
Sanity Query Then Patch Document
Version 1.0.0
Find a document with GROQ, then patch it when a match is found.
View Spec
View on GitHub
Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformArazzoWorkflows
Provider
Workflows
query-then-patch-document
Locate a document by a GROQ filter and patch it if it exists.
Issues a GROQ query that returns the first document matching the filter, then conditionally applies a set patch to that document's id when a match is present.
1
findDocument
Run a GROQ query that returns the id of the first document matching the supplied filter expression.
2
patchDocument
Apply a patch mutation that sets the supplied fields on the matched document id.
Source API Descriptions
openapi
Arazzo Workflow Specification
Work with this as data
Every workflow here is available over the APIs.io API and to AI agents over MCP.