Why connect Sanity to Slate?
Slate generates content through AI-powered workflows. Sanity stores your structured content. Connecting the two moves content from generation into your Sanity dataset in a single automated flow.Prerequisites
- The Admin role in your Slate workspace. Members can view integrations but can’t connect them.
- A Sanity project ID and dataset name
- A Sanity API token that can read and write documents in that dataset
Setup
Step 1: Gather your Sanity details
Have these values ready before you connect:
Each connection covers one project and one dataset. To work with another dataset, add another connection.
Step 2: Connect Sanity in Slate
- Open Slate and go to Workspace settings → Integrations.
- Under More integrations, find Sanity and click Connect.
- Optionally, enter a Connection name (e.g., “Marketing Site” or “Blog”).
- Enter your project ID in ProjectId.
- Enter your dataset name in Dataset.
- Paste your API token into Access token.
- Click Connect.
Step 3: Use the connection in a workflow
- Open or create a workflow.
- Add the Sanity block from the Apps section.
- Select your connection in Sanity connection.
- Choose an Action and enter a Document type.
- Map your workflow data to document fields.
What you can do
Once connected, the Sanity integration enables the following through the Sanity workflow block:Use cases
AI-assisted blog drafts
Generate articles with the LLM block, then save them as Sanity drafts for your editors to review in Sanity Studio. Example flow: Input keywords → LLM generates article → Sanity block creates a draftpost document
SEO landing pages at scale
Create one draft document per keyword. Map aslug field so each document gets a stable ID.
Example flow: Keyword list → Loop block iterates keywords → LLM writes page copy → Sanity block creates a draft for each keyword
Publishing with approval
Use the Human Review block to get sign-off before content goes live. Example flow: LLM drafts case study → Human Review for approval → Sanity block creates the document with Save as draft turned offManaging connections
View connections
Go to Workspace settings → Integrations to see your Sanity connections. Each connection shows Connected or Needs attention.Fix a connection that needs attention
A connection shows Needs attention when Slate marks it invalid. For example, Slate marks a connection invalid when Sanity rejects its token. To fix it:- Create a new API token in Sanity with read and write access to the dataset.
- Open the ⋮ menu on the Sanity row and choose Add another connection.
- Enter the project ID and dataset, paste the new token, and click Connect.
- In each Sanity block that used the old connection, select the new connection.
- Remove the old connection.
Selecting a different connection in a Sanity block clears the block’s document type, selected document, and field mappings. Set them again after you switch.
Remove a connection
Open the ⋮ menu on the Sanity row and choose Disconnect. If you have more than one connection, expand the row and click Remove next to the connection. Workflows that use the removed connection need a new one.Troubleshooting
What’s next
- Sanity Block — detailed guide on configuring the Sanity workflow block
- Building Workflows — learn how to create workflows from scratch
- Loop Block — process multiple items in a workflow
- Human Review Block — add approval steps before publishing