Skip to content
Back

How to get event payload/source from failed function executions?

  • 0
  • Functions
_alnes_
1 Sep, 2025, 14:53

Hi everyone,

I'm currently working with Appwrite's database triggers, specifically for document creation events.

I've encountered a potential issue and was hoping to get some clarification or advice.

It seems that if a database trigger event fails (for example timeout), I don't receive a reference to the original document that triggered the event, nor do I get the document data itself.

This makes it impossible to implement a retry mechanism or to manually handle the failed event, as I have no way of knowing which document failed.

This is a critical feature for my use case, as I need to ensure that the actions in my triggers are reliably executed.

Am I missing something, or is there a recommended workaround for this scenario?

Any help or insights would be greatly appreciated.

Thanks in advance! Matze

TL;DR
Developers wanted to retrieve event payload/source from failed function executions triggered by database events in Appwrite. The issue stemmed from a function runtime timeout, leading to missing context for handling errors. The solution involved adding the admin team to the row's permissions and introducing a client-side sync function for error handling. The lack of context when errors occur raised questions about the purpose of events.
_alnes_
3 Sep, 2025, 07:18

@Steven I don't really want to write directly and disturb you, but I need a professional opinion here. thank you for your help.

_alnes_
7 Sep, 2025, 05:26

No idea anybody ?

Chirag Aggarwal
7 Sep, 2025, 13:09

@alnes hii, just to clarify your issue you are triggering a function using a database event. but facing issues when event does not get triggered? if somehow event does not get triggered you would like a retry mechanism?

Chirag Aggarwal
7 Sep, 2025, 13:10

for example timeout

not sure what you mean by this 🤔

if a document is not created due to some error, a trigger wont be fired

ideclon
7 Sep, 2025, 14:48

I presume they're talking about a case where the Document was created, and then the triggered Function Execution times out

_alnes_
9 Sep, 2025, 15:25

exatly. this dont happen often , but it happends

_alnes_
10 Sep, 2025, 05:54

It was actually the case that there was a function runtime timeout. The function was triggered by a databases..tables..rows.*.create event. The admin team should be added with this function to the row's permissions, as this isn't possible on the client side. It would be critical if it didn't work securely or if errors couldn't be handled because the context is missing. I've now solved this with a client-side sync function. If problems arise, I can react. But it's not the most attractive option, in my opinion. I also don't understand the true purpose of events if they don't provide context when errors occur.

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