How to Control the Final Response Format of a Chatbot

Hello everyone, I’m a beginner with n8n. I have installed a self-hosted version of n8n using npm on a Windows 10 system.

Additionally, I’ve deployed a text-to-speech service on port 4455 of the same system. The HTTP request format is as follows:
http://127.0.0.1:4455/playTextAsVoice?Text=hello

The HTTP response simply echoes back the text.

When the chatbot runs, everything works fine, but the final output is returned in JSON format, as demonstrated below(Please open the image in a new tab.):

I would like to know how to get the response in plain text format instead of JSON.
E.g:
Current Output: { “data”: “Hello! How can I assist you today?” }
I need Output: Hello! How can I assist you today?

Thanks in advance for any advice and help!
David

My workflow

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:

Hi @ichat006,

Looks like you’re using a chat model I don’t have access to via the custom base URL option so I tried reproducing using the gpt-4o-mini and wasn’t able to reproduce so I’m wondering if it’s an issue related to the model …

Instead of connecting the HTTP Request node after the AI Agent node, have you tried using the HTTP Request Tool instead?

Could you tell me more about what you’re building?

@aya
Thank you for your attention. The issue has been resolved.

Hi @ichat006, glad to hear that you’ve managed to solve the issue, Could you maybe share what worked for you in the end?

Because I need to call this workflow in other workflows, I use $output.data to get the actual value.

2 Likes

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