
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is actually intended behavior, and it's a common point of confusion with delta::changedAny(). The function doesn't trigger on document creation because technically, during creation, the field isn't "changing" – it's being set for the first time.
The delta::changedAny() function compares the before and after states of a field. On creation, there is no "before" state to compare against, so the function evaluates to false. This is why your webhook doesn't fire when documents are created.
To handle all three scenarios (create, update, delete), you need to adjust your filter to explicitly account for creation. Here are two approaches:
Option 1: Check if the operation is create OR the field changed
_type == "someType" && (delta::operation() == "create" || delta::changedAny(someField))This uses delta::operation() to explicitly check if it's a creation event, OR if the field changed (which handles updates).
Option 2: Use before() to detect new values
_type == "someType" && (!defined(before().someField) || delta::changedAny(someField))This checks if the field didn't exist before (creation) OR if it changed (update).
Note that for deletions, your field won't exist in the after() state, so you might want to just filter by type for delete events, or check that the field existed before deletion:
_type == "someType" && (
delta::operation() == "create" ||
delta::changedAny(someField) ||
(delta::operation() == "delete" && defined(before().someField))
)Since you're building automation that reacts to content changes, you might want to consider using Sanity Functions instead of webhooks. Functions are the modern, recommended approach for this type of use case because they:
sanity.blueprint.ts fileWebhooks are still great when you need to integrate with external systems that specifically require HTTP callbacks, but for general automation triggered by content changes, Functions are typically the better choice.
You can read more about webhook filters and delta functions in the Sanity documentation.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store