Skip to content

A Custom Event fires immediately after a record is created (in the same transaction) and needs to act on that just-created record, but the event's own logic can't seem to see or find the record it was just triggered by.

Answer

This is expected: the event runs inside the same, still-uncommitted transaction as the record's own creation, so anything the event does that needs to "see" the just-created row (like a SELECT against it) won't find it yet, since it hasn't actually been committed to the database from that transaction's point of view. Run the logic that needs to act on the newly-created record as a background job instead, deferred to execute after the creating transaction has actually committed, rather than trying to have the event itself read or act on the record synchronously within its own creation transaction.

← Browse Workflows and automation questions