Using Google Contacts

Complete Noob

Using google contacts tool either get or get many, using Defined automatically by the model no mater what I get error fields.join is not a function

I can create contacts

n8n version

1.78.1 (Cloud)

Time

2/22/2025, 5:11:05 PM

Error cause

{ "message": "The resource you are requesting could not be found", "timestamp": 1740258665655, "name": "NodeApiError", "description": "Requested entity was not found.", "context": {}, "cause": { "message": "404 - {\"error\":{\"code\":404,\"message\":\"Requested entity was not found.\",\"status\":\"NOT_FOUND\"}}", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 404\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:19:12)\n at Unzip.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:599:11)\n at Unzip.emit (node:events:530:35)\n at endReadableNT (node:internal/streams/readable:1698:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at invokeAxios (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execute-functions.js:582:16)\n at proxyRequestToAxios (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execute-functions.js:611:26)\n at Object.request (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execute-functions.js:1474:50)\n at SupplyDataContext.requestOAuth2 (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execute-functions.js:1041:12)\n at SupplyDataContext.requestOAuth2 (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execute-functions.js:1482:20)\n at SupplyDataContext.googleApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Contacts/GenericFunctions.js:26:16)\n at SupplyDataContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Contacts/GoogleContacts.node.js:208:40)\n at handleToolInvocation (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js:41:44)\n at DynamicStructuredTool.func (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js:78:35)\n at DynamicStructuredTool.call (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/tools/index.cjs:113:22)\n at /usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/executor.cjs:486:27\n at async Promise.all (index 0)\n at AgentExecutor._call (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/executor.cjs:478:30)\n at AgentExecutor.invoke (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/base.cjs:58:28)\n at ExecuteContext.toolsAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js:185:30)\n at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/Agent.node.js:383:20)\n at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:633:19)\n at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:882:51\n at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1216:20", "code": "ERR_BAD_REQUEST", "status": 404 } }

n8n version

1.78.1 (Cloud)

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 @Network_Sherman, try these and see if they work for you:

:one: Check If the Contact Actually Exists

  • Try manually searching for the contact in Google Contacts before using the “Get” or “Get Many” nodes.
  • If the contact was just created, refresh Google Contacts before attempting to fetch it.

:two: Use the Correct Contact ID Format

  • The Google Contacts API requires an ID, not an email or name.
  • If using “Get Many,” ensure you’re filtering by the correct field.
  • If unsure, try retrieving all contacts first, then extract the ID for a specific lookup.

:three: Verify OAuth Scopes & Permissions

  • Ensure your Google OAuth app has these scopes enabled:
    • https://www.googleapis.com/auth/contacts.readonly (For reading contacts)
    • https://www.googleapis.com/auth/contacts (For full access)
  • If necessary, reconnect Google in n8n to refresh permissions.

:four: Debug Using Google API Explorer

  • Try fetching contacts directly from the Google API Explorer (Google People API) to confirm if the issue is with n8n or Google.

I am having the exact same issues as @Network_Sherman I am using n8n version 1.80.3.

I have double checked all your suggestions, and I have spent over 5 hours with chatGPT trying to get it working. I have also tried the Google People API as google states the contact API is no longer supported (I tried both API’s)

Depending what I try I either get the “fields.join is not a function” Error or that the agent needs the persons ID #

Reading your comment it looks like maybe the Google API does NOT allow access to my contacts info by their names. Is this true??

Thanks`

`{
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -560,
        -80
      ],
      "id": "8472810c-d016-41be-a03b-74d644350ccc",
      "name": "When chat message received",
      "webhookId": "1d3eb376-1207-43a4-826e-3de3b4b61c7a"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful assistant call the Google people tool to find people's contact information as requested"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -340,
        -80
      ],
      "id": "acc9e72a-3c7f-46d1-8ed9-a66716a1d609",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -440,
        120
      ],
      "id": "164d60ce-3b07-4b77-9429-b2730f970459",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "58HEJD8WTNOmOCUc",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -260,
        140
      ],
      "id": "cb7c1e46-9ca1-43a4-86b2-c878f959d9f0",
      "name": "Window Buffer Memory"
    },
    {
      "parameters": {
        "operation": "get",
        "contactId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Contact_ID', ``, 'string') }}",
        "fields": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Fields', ``, 'string') }}"
      },
      "type": "n8n-nodes-base.googleContactsTool",
      "typeVersion": 1,
      "position": [
        -80,
        140
      ],
      "id": "a7116bc7-8e7a-479e-9f5e-40cdaab3f2f3",
      "name": "Google people",
      "credentials": {
        "googleContactsOAuth2Api": {
          "id": "kHRK9T38hchH9oH9",
          "name": "Google Contacts account 4"
        }
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google people": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "597b8f974ff6eaba273dfa075c94f0bef14976b3db4a9821508b946069d2b58d"
  }
}
`

Hey @Rick_Ede Look at this workflow it works well with all Google contacts operations

2 Likes

Yes that works well. Thank You

@Rick_Ede Please mark this as a solution if you don’t mind :slight_smile:

I am experiencing the same/similar issue for two days now. I can create contacts but cannot retrieve any.

1 Like

Hey @Ryan_Hinds, welcome to community. Could you please elaborate more? Please share your workflow if possible.

@Ruslan_Yanyshyn - I used the workflow that you provided and all is well now.
Thanks,
Ryan

1 Like

How do I mark it as a solution?

Under each post, you should see the icon for that reason, but only if you create this topic.

OK, I Did NOT create this topic, so I can’t mark it solved, correct??

Yes that’s right!

1 Like

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