Hi all! I have a question about workflow concurrency limits and whether workflows are the right fit for client-initiated AI processing use cases like mine.
My use case:
- User selects image(s)
- In parallel: Send base64 image for AI processing + upload image to CDN
- Validate AI response based on rules
- Write to database
- Send notification
- (Future step) Additional AI enrichment processing
Why I chose workflows initially:
I implemented this using workflows because I wanted:
- User status updates for each step
- Durable retries
- Clean abstraction
My concern
I'm now questioning this approach due to workflow parallelism limitations. Here's my current implementation for reference.
My question
Should I be chaining actions together instead and only use workflows for batching? Or are workflows actually intended for use cases like mine?
I noticed the docs now include this guidance:
You can specify how many workflows can run in parallel by setting the maxParallelism workpool option. It has a reasonable default. You should not exceed 50 across all your workflows. If you want to do a lot of work in parallel, you should employ batching, where each workflow operates on a batch of work, e.g. scraping a list of links instead of one link per workflow.
Any advice would be appreciated!