Enhanced recursion protection and increased rate limits
Published: October 16, 2025
Sanity Functions now includes improved safeguards and higher throughput limits. Recursion protection limits function chains to 16 invocations when mutating documents, reducing the risk of exceeding usage limits. Rate limits have increased significantly to support higher-volume workloads.
✨ Highlights
Improved recursion protection
Functions now limits recursive invocations to 16 when you mutate documents from within a function. This protection reduces the risk of exceeding your usage limits when a function triggers another function or itself through document mutations. You should still use caution when mutating documents from within functions.
This feature requires @sanity/client v7.12.0 or later.
Increased rate limits
Rate limits for Functions have increased to support higher-volume applications:
- Individual function limit: 200 invocations per 30 seconds (previously 10 invocations per 30 seconds).
- Project-wide limit: 4,000 invocations per 30 seconds (previously 200 invocations per 30 seconds).
When you exceed these limits, Functions stops additional invocations until the rate drops below the threshold.
Related documentation
Functions
Learn how to take advantage of Functions in your Sanity projects.
Create a Document Function
Start building with Functions by deploying a new function to Sanity's infrastructure.
Configure @sanity/client in Functions
Learn to use the JavaScript client in a Sanity Function.
Functions cheat sheet
Common patterns and techniques for creating Functions.