Sanity · Arazzo Workflow
Sanity Upsert Document
Version 1.0.0
Find a document by a GROQ key match and patch it, otherwise create it.
View Spec
View on GitHub
Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformArazzoWorkflows
Provider
Workflows
upsert-document
Upsert a document keyed on a GROQ field match within a dataset.
Looks for an existing document where the key field matches the supplied value and either patches the matched document or creates a new one carrying the key and fields.
1
findDocument
Search the dataset for a document of the given type whose key field equals the supplied value, returning the first match's id.
2
patchExisting
Patch the matched document with the supplied fields, leaving other fields untouched.
3
createNew
Create a new document of the given type carrying the key value and the supplied fields when no existing document matched.
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.