Trigger after_insert event from remote

I have a code to create a document into my site using requests.

A POST requests is sent to my site to create new document. After the doc is created I want an after_insert event to run.
The document is created correctly. But the after_insert is not running.
I also have validate and before_insert which both are triggered and run.

My question:
Is the after_insert intentionally can’t be used in this scenario?
Or is it a bug?
Or do I have to do something else to trigger the after_insert event?

Thank you for any help.

1 Like

after_insert should run regardless of how you inserted it.

reference: frappe/ at 4d38093f6c2b602abdeeb974f9a92d0b493efa09 · frappe/frappe · GitHub

If you can provide a good enough steps to reproduce, please open a bug report in frappe/frappe.

I am having the exact same scenario: when a document is inserted from an event in, after_insert is not triggered while before_insert works. Everything works well when I insert manually

after insert doc events is added in version 13.26 now we can run Server script after insert from version 13.26 onwards.

1 Like

In other word, after_insert doesn’t exist prior to 13.26?
How about (in 13.26 forward) using after_insert directly in code (not using Server script on desk)?