AI Agent to chat with you Search Console Data, using OpenAI and Postgres

Go to Workflow
8,199 views
Built by Dataki Dataki
Created on June 05, 2026

Description

Edit 19/11/2024: As explained on the workflow, the AI Agent with the original system prompt was not effective when using gpt4-o-mini.

To address this, I optimized the prompt to work better with this model. You can find the prompts I’ve tested on this Notion Page. And yes, there is one that works well with gpt4-o-mini.

AI Agent to chat with you Search Console Data, using OpenAI and Postgres



This AI Agent enables you to interact with your Search Console data through a chat interface. Each node is documented within the template, providing sufficient information for setup and usage. You will also need to configure Search Console OAuth credentials.

Follow this n8n documentation to set up the OAuth credentials.

Important Notes

Correctly Configure Scopes for Search Console API Calls
It’s essential to configure the scopes correctly in your Google Search Console API OAuth2 credentials. Incorrect configuration can cause issues with the refresh token, requiring frequent reconnections. Below is the configuration I use to avoid constant re-authentication:



Of course, you'll need to add your client_id and client_secret from the Google Cloud Platform app you created to access your Search Console data.

Configure Authentication for the Webhook

Since the webhook will be publicly accessible, don’t forget to set up authentication. I’ve used Basic Auth, but feel free to choose the method that best meets your security requirements.

🤩💖 Example of awesome things you can do with this AI Agent

Nodes Used (5)

AI Agent
@n8n/n8n-nodes-langchain.agent
Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat