I have a workflow that has a chat trigger calling an AI Agent. The agent has access to several tools. It can take a minute+ to get a response. I’d like to provide status updates in the chat during the processing like:
Now running tool XYZ
Now looking up ABC
Some ideas I’m hoping for:
Given the sessionId, can I trigger something to return data back to the chat client
Secondary “status update” workflows that can post to the same chat session
So I would attempt to get the session of the ID of the chat session, send that to the second scenario where you can use an http request to post the updates.
If this solves your problem, feel free to mark as the solution!
Thank you Daniel. In the secondary “status update” workflow, given the sessionId, how do I send the HTTP Post back to the n8n chat client. It looks like the n8n chat client is sending a synchronous (meaning sending and waiting for a single response) web request to the n8n server, and waiting for a single response. There’s no way to address (i.e. communicate) with the n8n chat client directly to send it information, which is what I’m trying to do.
The traditional approach (outside of n8n), would be a chat client that the server could talk to. Either the chat client “polling” the server for updates based on the sessionId, or setting up a socket connection between the two. If n8n has already built this into their chat client, that would be awesome.
@liquidsnakeblue My point is that the Chat client by n8n should support streaming updates. You can see this working in every standard chat client (ChatGPT, Claude, etc).
Most AI APIs support a streaming option. For example, I’ve built many custom chat clients with Open AI where we are streaming updates.
In addition, it’s critical to support streaming updates when function calling. Open AI provides this already when calling function tools. So you can do something like this:
User: “When was my last interaction with [email protected]”.
Open AI: “Ok, let me check your email”
Open AI: “I’m also going to check your Google Calendar”
I 100% agree with you and I hope they will add this to the AI Agent node.
I was more talking about a workaround in the meantime…
I managed to get status updates using the call n8n workflow AI node and having the agent send a status of what its up to in a custom field on that node. The new workflow gets the status which I saved into memory and then added a webhook to get the status.