marnecM
Convex Community11mo ago
12 replies
marnec

runafter vs wrapper-action

Hi there, I'm wondering what is the suggested approach for the following scenario: an API endpoint that needs to perform a mutation, (optionally retrieve some data,) and the perform an operation over the network, like an httpcall.
At the moment I have two different cases in which I'm adopting two different strategies:
- I'm sending emails after storing an invitation record in convex using scheduler.runAfer(0, internal.emails.sendemail) from whitin the mutation that stores the invitation record
- I'm sending push notification after storing a message in convex. I have a convex action that wraps (1) the mutation that stores the message; (2) the query to retrieve the push subscriptions; (3) the action to send the notifications.

What would be the suggested approach for this kind of scenarios?
Was this page helpful?