Workflow vs Workpool Use Case
I'm building a demo that syncs users' calendars with my database. Each time a user sets up their account, they can sync all their events from Google Calendar. I can achieve this using workflows. First, I would obtain their credentials, then fetch their accounts, and finally retrieve their events. If a user has, for example, 1,000 calendar events, I want to process these in batches of 100 per loop. For each loop, I would call workflow.start to initiate the flow.
However, I am confused about a few things: First, how does maximum parallelism apply in this scenario? Second, is a workflow or workpool more suitable here? Third, if a workpool is preferable, how do you implement batching? Lastly, if you are batching in a workpool, how would you apply maximum parallelism?
1 Reply
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!