Skip to content

The moment it happens

Announce published Sanity documents in Slack

When a post is published, your channel gets its title and document type within moments.

Runs
The moment it happens
Apps
Sanity
AI
Not needed
Access
Viewer token (webhook created by admin)

Send this to your assistant

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.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

In a team using Sanity, editors publish and sometimes delete documents all day: product pages, blog posts, landing pages, legal notices. The people who need to know are often elsewhere. A marketer wants to share a new article, a developer needs to check that a deleted page does not break links, and a compliance reviewer wants to see every change to terms of service. Without a notification, they find out when a customer or a broken link reports it.

When a document is published or deleted in Sanity, a webhook delivers a projected payload with the fields you chose. The automation reads it and posts the title and document type to Slack. It reacts as soon as the event arrives. Content teams, developers and anyone responsible for what appears on a live site can follow publishing activity in one channel.

What you get out of it

  • Accidental deletions caught fast

    A deleted document is announced with its title and type. If it was removed by mistake, an editor can restore it from history within minutes, before search engines or customers hit a missing page.

  • Marketing can promote new content

    A new article appearing in a channel is an immediate prompt to share it on social media or in a newsletter. Launch timing stays tight because nobody has to ask 'is it live yet?'

  • Developers learn about structural changes

    A new document type being published, or a page removed, can affect routes, sitemaps and builds. Developers who see the notice can check that front-end code and redirects still match the content.

  • An audit trail for sensitive pages

    For terms, pricing and policy documents, the channel keeps a time-stamped record of publication. A compliance lead can scroll back to confirm when a change went live without asking an editor to remember.

  • Fewer status questions to editors

    Colleagues stop messaging editors to ask whether a page is published. The channel answers that question, which leaves editors with more uninterrupted time to write and review. A producer who stops fielding 'is the pricing page live?' questions can finish a draft in one sitting.

How it works

What happens, step by step

  1. When a document is published in Sanity, Sanity tells ClickRuntime straight away.

  2. A message goes to your Slack channel with the document's title and type.

  3. Each publish is posted once, so your team sees what went live as it happens.

Before it runs live

  • Connect Sanity
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Announce published Sanity documents in Slackjust nowSucceeded
Slack · #web-contentPublished in Sanity: How Northwind cut onboarding time in half (post)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Sanity steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
content_published_alert.pyexample
from clickruntime import on_event, notify

@on_event
def handle(event):
    doc = event.json or {}
    if doc.get("_type") != "post":
        return {"posted": False}
    notify.slack(f"Published in Sanity: {doc.get('title', doc.get('_id'))} ({doc['_type']})", channel="#web-content")
    return {"posted": True, "id": doc.get("_id")}

FAQ

Common questions

Does it trigger on drafts being saved or only on publish?
Only on the events the Sanity webhook is configured to send. A webhook set to create, update and delete with a published filter reports publication and deletion, but not each draft autosave, which would be far too noisy.
What does the Slack message contain?
The title and document type from the projected payload, such as post or product. You can choose to include more fields, like slug or author, by adjusting the webhook projection so the payload carries them.
Do I need a particular Sanity plan to send webhooks?
Webhooks are managed in your Sanity project settings under the API section, and availability depends on your Sanity plan. If you can see the webhook settings for your project, you can point one at the link ClickRuntime gives you.
What permissions does it need?
Viewer token (webhook created by admin). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Announce published Sanity documents in Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.