punnP
Convex Community3y ago
2 replies
punn

Run Mutation based on successful jobs

We have an import flow for our Airbnb App that imports multiple pieces of data, namely:
- Listings
- Reservations for each listing
- Conversations for each reservation
- Messages for each conversation

When a user imports a listing, we run action to fetch listings, reservations, conversations, and messages.

After fetching listings and reservations (not using the scheduler), we use the reservationIds to schedule actions to fetch conversations and messages. We update the user's subscription details after the function calls to schedule these actions. So if these scheduled actions fail, we still update the subscription anyways.

How should we go about updating the subscription only after the actions are successful and not when they fail?
Was this page helpful?