FaunaDB Eventhooks: filtering alert conditions without duplicate notifications
0 reputation · 14 Apr 2022, 17:41 UTC
Goal
I want to use FaunaDB Eventhooks to push alerts to an external endpoint only when a document change meets specific criteria, so routine writes do not trigger notification noise. The filtering logic would live inside the Eventhook function itself.
Constraints and uncertainty
Because Eventhooks execute within the transaction, a failed or slow external call can roll back the write or push the transaction toward its time limit. That makes me hesitant to put a real notification service directly in the hook path. I am also unsure how retries behave: if the endpoint times out but actually received the call, a retried transaction could emit the same alert twice unless I build idempotency into the receiving side.
I can gate the external call behind a conditional check on the changed document, but I have not found clear guidance on whether the hook should return success silently when criteria are unmet, or whether there is a cleaner suppression mechanism.
Questions
- Is conditional logic inside the Eventhook function the intended way to suppress low-value alerts, or is there a supported filtering option at the hook configuration level?
- What is the practical time budget for the external call before transaction timeouts become a risk?
- Is application-level idempotency on the receiver the only safeguard against duplicate alerts from retries?