Jobs: Cron, Queues, webhooks & pg_net
DevLog's weekly digest has to run at 9am Monday whether or not anyone has a browser tab open. The tempting shortcut is a trigger: "on insert, just call the email API right there." That single line is one of the most common ways a Supabase project goes down — because a synchronous HTTP call inside a trigger holds the transaction, and every lock it took, open for as long as the remote endpoint takes to answer. This concept is about the four correct tools, and the one fact that explains why three of them exist.
try to break it
you drive.
A new comment is inserted. An AFTER INSERT trigger fires — still inside session A's open transaction.
Same trigger, same insert. The only difference is whether the network call happens inside the transaction (synchronous — locks wait on the internet) or outside it (pg_net — the transaction never knows the call is still in flight).