Chat response store to Google Sheets

Hi team,

I’m using n8n self-hosted (v1.89.2) to build an AI chatbot workflow. The flow is working perfectly until I add the Google Sheets node to log the conversation. Here’s the setup and the issue:


Working Setup (no Google Sheets):

  1. Webhook node (receives user message from HTML chat UI)
  2. LangChain Q&A node (calls Ollama, returns response)
  3. Respond to Webhook node — sends AI response back to chat UI

When I run this, everything works. The chat UI receives the AI response without issue.

Failing Setup (with Google Sheets):

Same as above, but after Q&A node I added:

  1. Code node (formats User Question, AI Response, Timestamp)
  2. Google Sheets node (logs the values to a sheet)
  3. Respond to Webhook node

Now the frontend chat UI shows:

"I apologize, but I'm having trouble connecting to the server. Please try again in a few moments."

However, I verified that the Google Sheet does get updated, and the workflow succeeds without any error in the n8n UI.

Observations:

  1. Disabling the Google Sheets node makes the chat UI response work again.
  2. So it seems like the webhook is not responding fast enough when Sheets is in the path.
  3. Tried using Respond to Webhook with “First incoming item” and correct field — no difference.

I want to:

  1. Return the AI response quickly to the chat UI
  2. Log the full conversation (User question, AI response, Timestamp) in Google Sheets
  3. Avoid timeouts/errors on the chat UI

My Question:

  1. What is the best practice for this setup in n8n?
  2. Should I split the workflow into two — one for fast webhook response, another for async logging to Google Sheets? Or is there a way to ensure the webhook responds quickly even with Sheets in the same flow?

If possible, please guide with a proper structure or share example JSON workflows.

Thanks in advance!

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.89.2 Self Hosted
  • **Database (default: SQLite):Qdrant Vector Store
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • **Operating system:Ubuntu 24.04
2 Likes

@aryanbt

Instead of an image, can you post the actual workflow in a code block?

pasteworkflow

you can probably use an ai agent, to perform the same, and have storage linked is best way, it saves session history for chats,

But I think you could also, put sheet update after webhook, if fast response is what u need, test it out see if any issues, also u could use the above ai agent, with tools attached to call webhook and google sheet, when u describe in the ai agent, system message, tell it to always process webhook first.

Btw, if you put the webhook above the sheet node, it may execute first also.

Here is my final setup. It works perfect. No issues. Conversation going very smooth. Response is getting only from FAQs.

1 Like

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