Multiple concurrent run same thread Id

Hi community!
I am considering implementing an assistant that functions as an orchestrator, which I call ‘Director,’ along with other assistants referred to as ‘actors.’

The following is the sequential behavior I had in mind, but it won’t work since OpenAI does not allow having multiple concurrent runs for the same thread. Is there a solution? Possible solutions I was thinking of include:

•	Cancel run1 (but this can’t be done because only in-progress runs can be canceled)
•	Modify the run (and change the assistant_id), but this doesn’t seem to be possible.

Here is the intended workflow:

1.	(D) receives a message
2.	(D) adds the message to the thread
3.	(D) creates run 1 (with thread_id and assistant_id)
4.	(D) Run status is REQUIRES ACTION
5.	(D) calls the function of ACTOR A
6.	(A) creates run 2 (with thread_id and assistant_id)
7.	(A) Run status is REQUIRES ACTION
8.	(A) calls function CALL 1 and obtains CALL 1 result
9.	(A) submits tool outputs (CALL 1 result) to run 2
10.	(A) changes run 2 status to completed
11.	(D) submits tool outputs (ACTOR A result) to run 1
12.	(D) changes run 1 status to completed

Is there an approach that allows maintaining this sequential behavior without violating the single concurrent run constraint? Any insights or alternative solutions would be greatly appreciated.

thank you!

Hey @gerard.morera

I’ve also tried yours possible solutions and couldn’t achieve what I wanted.

I ended up doing what this article describes: Optimizing AI: Building Advanced Multi-Agent Frameworks with Azure OpenAI Assistant API

If you want more details on my original post (same problem): Assistants API Multi Assistant Agentic Workflow

Note: Remember to define the ‘actors’ function the best you can, this helps passing the context between threads.

Hi @andres_santos! Thank you very much for your reply.

If I understand correctly, this solution duplicates the threads: one thread for user-director communication and another for director-actor communication. While this might be a possible solution, it doesn’t fully fit my use case. This is because I need several undetermined messages to select the right agent. What do you think?

Given the current limitation of a single concurrent thread, I believe the simplest and most cost-effective solution for this scenario is to use the Chat API with tools (as explained for agents).

thanks :slight_smile: