# Sequential workflow executions

**URL:** <https://community.temporal.io/t/sequential-workflow-executions/12610>\
**Category:** Community Support\
**Tags:** java-sdk, workflow-options\
**Created:** [June 21, 2024, 4:52pm UTC](https://community.temporal.io/t/sequential-workflow-executions/12610 "2024-06-21T16:52:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![awwx](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/awwx/32/8185_2.png) [@awwx](https://community.temporal.io/u/awwx)\
**Post date:** [June 24, 2024, 1:48am UTC](https://community.temporal.io/t/sequential-workflow-executions/12610/4 "2024-06-24T01:48:36Z")

</div>

Oh, you want to run a _single_ workflow for each request, but ensure that requests for a particular user are executed one at a time?

There isn’t actually a cost to having a workflow waiting for a signal for a long time. The workflow execution history is simply stored in the database and replayed if needed when a new signal comes in. It doesn’t consume worker resources long term.

I think we would want to use continueAsNew to avoid having the workflow execution history grow too large.

@maxim is this what you’d recommend? As I understand it, the requirements are:

- each incoming request should be processed in a workflow
- for a particular user ID, processing of requests need to occur one at a time
- requests for different user IDs can be processed in parallel

One solution might be to use signal-with-start with the workflow ID based on the user ID. This ensures that all requests for a particular user ID are routed to the same workflow. The workflow would receive the requests as signals and execute them one at a time. It would need to call continueAsNew periodically to avoid growing the workflow history too much.

To avoid having the workflow running indefinitely (to avoid cluttering the UI if nothing else), as @ilya1 suggests the workflow could set a timer and stop executing if no requests have been received within a timeout. If a new request does come in the workflow would be started with signal-with-start as usual.

What do you think?

---

_[View the full topic](https://community.temporal.io/t/sequential-workflow-executions/12610)._
