Skip to content
Back

Webhook-Triggered Function Persistently Executing Stale/Cached Code

  • 0
  • Functions
  • Cloud
Rohan Kumar
10 Oct, 2025, 18:39

I'm encountering a persistent issue where one of my functions, acting as a webhook endpoint, is not executing the latest active deployment when triggered by an external service.

Environment:

Appwrite Version: Appwrite Cloud

Function Runtime: Node.js (using ES Modules)

Trigger Type: External HTTP POST request from the Razorpay payment gateway.

Problem Description: I have an Appwrite Function (verifyPayment) that serves as a webhook to confirm payments from Razorpay. The function has been deployed and has public execute access (any).

When I trigger the function manually from the Appwrite Console ("Execute now"), it correctly runs the latest active deployment.

However, when the function is triggered by the Razorpay webhook (an external POST request to the function's domain), it consistently executes an old, cached version of the code.

TL;DR
Developers experiencing issue with webhook-triggered function not executing latest deployment when triggered by Razorpay. Function runs correctly manually in Appwrite Console but executes old cached code when triggered externally. **Solution:** This issue likely arises from the function being cached by Cloudflare CDN. Disable caching for the function domain or leverage query strings for unique API calls to bypass caching.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more