Skip to main content

AI agent to chat with you Search Console data, using OpenAI and Postgres

Workflow preview

Workflow preview
100%
AI agent to chat with you Search Console data, using OpenAI and Postgres preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Edit 19/11/2024 : As explained on the workflow, the AI Agent with the original system prompt was not effective when using . To address this, I optimized the prompt to work better with this model. Y...

Best for

  • Internal Wiki automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.memorypostgreschat, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.set, n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.toolworkflow, n8n-nodes-base.executeworkflowtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Dataki.

Original n8n.io source

1.1 Workflow description

Title
AI agent to chat with you Search Console data, using OpenAI and Postgres
Workflow name
AI agent to chat with you Search Console data, using OpenAI and Postgres

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

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.1

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1

Block 3 - Set fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Webhook - ChatInput

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 6 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Call Search Console Tool

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 1.2

Block 10 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Tool calling

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Block 16 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 17 - Set fields - Consruct API CALL

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Set fields - Create searchConsoleDataArray

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Set fields - Create searchConsoleDataArray 2

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Search Console - Get Custom Insights

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 22 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - ## Search Console - Get List of Properties

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Showing the first 24 of 30 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI agent to chat with you Search Console data, using OpenAI and Postgres
Complexity advanced
Nodes 30
Categories Internal Wiki, AI Chatbot
Author Dataki
Published 13 Nov 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2541/2541.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI agent to chat with you Search Console data, using OpenAI and Postgres do?

Edit 19/11/2024 : As explained on the workflow, the AI Agent with the original system prompt was not effective when using . To address this, I optimized the prompt to work better with this model. Y...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI Chatbot use case.