Automate Sanity
In Sanity, documents of every schema type live in a dataset that developers query with GROQ. ClickRuntime runs those queries for you, counts what was published, keeps an eye on the dataset and reacts to webhooks when a document changes. Ask your AI assistant for the alert or report, confirm the steps it lays out, and it keeps running.
Try asking
Create a ClickRuntime automation: when a document of type post is published in my Sanity production dataset, post its title and type to #web-content in Slack.
Paste it into your assistant. It tells you what it will send or change before it runs live.
Ideas
What you can automate in Sanity
Announce published Sanity documents in Slack
When a post is published, your channel gets its title and document type within moments.
See how it worksGet a weekly count of published documents
Every Monday you see how many documents went out last week, broken down by type.
See how it worksExport your Sanity dataset every week
Each Sunday an export of your dataset is taken and you get an email confirming what it covers.
See how it works Your own logicAny other automation you can describe in words
Your own rules, schedule and AI steps with Sanity, plus any other app. Describe it and your assistant builds it.
See how to build your ownBuild your own
Build any Sanity automation you can describe
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
For example, ask your assistant
Every morning, find Sanity documents of type post that are missing a main image or have an empty excerpt, and send me the list.
When a document is published in Sanity, post its title and type to our #content Slack channel with a link to the studio.
Every week, export Sanity product documents to Google Sheets, have AI write missing descriptions, and create a Notion review page listing them for editors.
Beyond chat
Have Sanity work when you're not in the chat
Instant
Announce published Sanity documents in SlackThe moment it happens
On a schedule
Get a weekly count of published documentsWeekly
On a schedule
Export your Sanity dataset every weekWeekly
Setup
Connect Sanity
Sanity connects with a robot token you add to your project, with a role you choose. You also need the project ID and the dataset name.
Sanity
Headless CMS
- Go to sanity.io/manage, pick your project and open the API settings.
- Under Tokens, choose Add new token, name it, and pick a role. Viewer is enough for reports and backups.
- Copy the token, which Sanity shows only once, and note your project ID and dataset name, such as
production. - In the ClickRuntime dashboard, save the token as a secret on Connections & secrets and include the project ID and dataset.
Good to know
Sanity limits that affect automations
- Every request needs the project ID and dataset name as well as the token.
- Robot tokens act with the role you assign. A Viewer token can read and export but not change documents.
- Webhooks are created by a project admin. By default they ignore drafts, so alerts fire on published documents only.
- Built-in emails are plain text, so a large dataset export needs another place to land than an attachment.
- Give each tool its own token so you can revoke one without breaking the others. Organization robot tokens exist if you need access across projects.
FAQ
Questions about automating Sanity
What can ClickRuntime see in my Sanity project?
How do publish alerts reach ClickRuntime?
Will editors' drafts trigger alerts?
Can I back up my dataset by email?
Is AI part of these automations?
Is this a Sanity connector for ChatGPT or Claude?
Related pages
Keep exploring