AI Chat Agent, process agent reply for future use

AI Chat, process Agent response after Agent reply is sent to user

I have tried a lot of different approaches, but seem unable to process the agent reply AFTER it was returned to the chat.

I want to classify people and locations from the agent reply, for future use but the classification should not be part of the response to the chat window. Though all attempts I tried resulted in the classification being returned to chat window instead of the original agent response.

If I have a classifier to run on the response after the ai agent, it will become the response to the chat, effectively overwriting the original response from the agent.

I tried “respond to webhook” but that doesnt seem to work when using the chat trigger.

I also tried to use the classifier as a tool (via new workflow), but it never gets called, even through I prompt the agent to use that tool every time.

I have searched this forum, and browsed hundreds of examples but not found any examples of post-processesing of the agents answer.

I hope someone can point me in the right direction :crossed_fingers:

Information on your n8n setup

  • n8nVersion: 1.71.3
  • platform: docker (self-hosted)
  • nodeJsVersion: 20.18.0
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Oh, damn I feel silly now. Seems I was a victim of the workflow execution order. I used a lot of n8n before v.1 and that was the cause of my problems it seems.

If I rearranged the workflow so respond to webhook is the lowest part visually, it works as I intended.

Found this document that explained it perfectly Execution order in multi-branch workflows | n8n Docs

This workflow works as I intended:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.