Unable to pass JSON data from Contact Agent to Google Sheets in n8n

I have set up a Contact Agent in n8n, which processes contact data (name, email, etc.), but I cannot get the data to be added correctly into Google Sheets. The Contact Agent responds with a success message, but no data is inserted into the Google Sheet. I have checked the workflow, and the input data is being processed, but there seems to be an issue when it tries to send data to Google Sheets. The output from the Contact Agent is correct, but nothing is passed on to the next node (Google Sheets). Can someone help me figure out what is missing in the workflow?
@Support_Team

I’ve been trying to set up a Contact Agent in n8n to manage contact data (such as name, email, etc.) and add it to a Google Sheet. ChatGPT suggested using the Edit Fields tool to format the output correctly and pass it to the Google Sheets node, but I can’t figure out how to integrate this step between the Contact Agent and the Google Sheets tool. I followed the instructions, but despite the agent showing a success message, no data gets added to the sheet. I’ve tried multiple configurations and am still stuck. Could anyone guide me on how to properly set this up?"

What happened:

"I’ve tried using the Edit Fields tool as suggested by ChatGPT, but when I connect it to the Contact Agent and Google Sheets tool, it just doesn’t pass any data. I keep getting an empty request in the Google Sheets tool, and the data never appears in the table.

There is no error message, but the data is not being passed from the Contact Agent to the Google Sheets node. The Contact Agent successfully processes the input and outputs a success message, but nothing is inserted into the Google Sheet

{
“nodes”: [
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.query }}”,
“options”: {
“systemMessage”: “=# Overview\nYou are a contact management assistant. Your responsibilities include looking up contacts, adding new contacts, or updating a contact’s information.\n\nContact Management \n - Use "Get Contacts" to retrieve contact information. \n - Use "Add or Update Contact" to store new contact information or modify existing entries. \n\n# Notes:\nAlways return the contact data as a valid JSON object. For example:\n{\n "name": "TOM",\n "email": "[email protected]",\n "telegram": "telegram_username",\n "wechat": "wechat_id",\n "phone number": "+861234567890"\n}\n”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.7,
“position”: [
-520,
80
],
“id”: “45df3d2a-a664-454a-a186-a2007a58991e”,
“name”: “Contact agent”,
“onError”: “continueErrorOutput”
}
],
“connections”: {
“Contact agent”: {
“main”: [
,

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “142e900cf33775431f094e0fecb17892a801bf0ce6a2b96611a1b4ce91e6a1e3”
}
}

I am using a ‘Contact Agent’ node to process user input like adding a contact (name and email). The data is supposed to be inserted into Google Sheets using the ‘Google Sheets’ node. However, the output is not passed from the agent to the sheet node, even though the Contact Agent confirms success

{
“output”: “The contact for TOM with the email [email protected] has been successfully added.”
}

Information on your n8n setup

  • **n8n version:**Version 1.85.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: win 11 pro

I’m not a programmer, I was just trying to create an assistant through telegram at the behest of a blogger who would add contacts. here’s the whole bot

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