@acteevent I think it can technically be called in either place, but would make more sense to call in the same backend file. If you’re using the code in our examples and haven’t done a ton of complex workarounds, then the Stories_beforeInsert function should only be called just before the .insert() function is called. Because they’re nested in your case, the Stories_beforeInsert is not being called.
Hope this helps!
Rob