Skip to content
MORNINGMETHOD
Postgres Chat Mem…OpenAI Chat ModelSet fieldsWebhook - ChatInp…Respond to WebhookCall Search Conso…Tool callingSwitchSet fields - Cons…Set fields - Crea…Set fields - Crea…Search Console - …Search Console - …Array aggregation…Array aggregation…AI Agent
The workflow you get16 nodes
  • n8n
  • OpenAI
  • HTTP Request
  • AI Agent

AI Agent to Chat with Google Search Console Data

Ask the AI questions about your Search Console data in plain words.

Best for: Site owners improving SEO

$19.00Regular price $49.0061% off
  • Card or PayPal
  • Instant download
  • Setup guide included
Delivery
Download after payment
Format
n8n workflow + guide (ZIP)
Access
Re-download any time

Setup

What you need, and how to set it up

It starts when another app sends it a message at its web address. No code needed. Follow the steps in order.

What you need

Setup in 6 easy steps

  1. Step 1: Get n8n

    n8n is the app that runs your automation. Make a free account at n8n.io. That is the easy way. You can also put it on your own computer for free.

  2. Step 2: Download your file

    After you pay, open My downloads and download the ZIP. Double-click it to open it. Inside is a file called workflow.json.

  3. Step 3: Put it in n8n

    In n8n, click Create workflow. Click the three dots (⋯) at the top, then Import from file, and pick workflow.json. Now you see the same boxes as in the picture above.

  4. Step 4: Connect your accounts

    Some boxes show a little red triangle. That means they need a key. Click the box, click Create new credential, and paste the key from your list. Do this for each red box.

  5. Step 5: Try it once

    Click Test workflow, then send one test message to the web address n8n shows on the first box. Green ticks on the boxes mean it worked.

  6. Step 6: Turn it on

    Click Save. Then flip the switch at the top from Inactive to Active. Now it works by itself, even while you sleep.

Stuck? Email support@morningmethod.co and we will help you.

Category: Automations › SEO, Analytics & Reporting · Best for: Site owners improving SEO · Platform: n8n · Steps: 16

What it does

Ask the AI questions about your Search Console data in plain words.

This webhook serves as the endpoint for receiving ChatInput data. Ensure that you include:

Works with: OpenAI, Memory Postgres Chat, Tool Workflow, Agent

What you get

  • The n8n workflow file (workflow.json), ready to import
  • This setup guide
  • The list of fields to change for your own accounts (see Install below)
  • Email support if you get stuck

Before you start

  1. An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker: docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678.

  2. Accounts and API keys for these services:

    • PostgreSQL database: how to connect (used by Postgres Chat Memory)
    • OpenAI API key: how to connect (used by OpenAI Chat Model)
    • httpBasicAuth: how to connect (used by Webhook - ChatInput)
    • oAuth2Api: how to connect (used by Search Console - Get Custom Insights, ## Search Console - Get List of Properties)

Install

  1. In n8n, click Create workflow (top right).
  2. Click the ⋯ menu → Import from file and choose workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V.
  3. Open each node with a red warning triangle and pick or create the matching credential from the list above.
  4. Click Save.

Test it

  1. Click Test workflow (or Execute workflow). Webhook - ChatInput starts it. Trigger it once with real sample data.
  2. Click each node to check its output. A green tick means the step worked.
  3. Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.

Go live

Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.

How it works, step by step

  1. Webhook - ChatInput starts the workflow (Webhook).
  2. Tool calling starts the workflow (Execute Workflow).
  3. OpenAI Chat Model uses AI (OpenAI).
  4. Postgres Chat Memory uses AI (Memory Postgres Chat).
  5. Call Search Console Tool uses AI (Tool Workflow).
  6. Set fields reshapes the data for the next step.
  7. Set fields - Consruct API CALL reshapes the data for the next step.
  8. AI Agent uses AI (Agent).
  9. Switch checks a condition and routes items accordingly.
  10. Respond to Webhook uses Respond To Webhook.
  11. Search Console - Get Custom Insights calls an external API (=https://www.googleapis.com/webmasters/v3/sites/{{ $json.pro).
  12. ## Search Console - Get List of Properties calls an external API (=https://www.googleapis.com/webmasters/v3/sites).
  13. Set fields - Create searchConsoleDataArray reshapes the data for the next step.
  14. Set fields - Create searchConsoleDataArray 2 reshapes the data for the next step.
  15. Array aggregation - response to AI Agent uses Aggregate.
  16. Array aggregation - response to AI Agent1 uses Aggregate.

Extra setup notes

These notes are also on the canvas as yellow sticky notes:

Webhook - ChatInput

This webhook serves as the endpoint for receiving ChatInput data. Ensure that you include:

  • chatInput – the content you wish to send ()
  • sessionId – a unique identifier for the session

If you're using an interface such as Open WebUI, the sessionId will be generated automatically.

Set fields

This node sets three fields:

  • chatInput: retrieved from the previous webhook node
  • sessionId: retrieved from the previous webhook node
  • date_message: formatted within this node. This will be used later to help the AI agent determine the date range for retrieving Search Console data.

AI Agent - Tools Agent

This AI Agent is configured with a system prompt that instructs it to:

  • On the first user message, retrieve available Search Console properties and offer the user the option to fetch data from these properties
  • Based on the user’s natural language input, construct an API call to the selected Search Console property and retrieve the requested data
  • Present the data in a markdown-formatted table

The AI Agent has a friendly tone and is designed to confirm the user’s data requirements accurately before executing any API requests.

AI Agent Sub-node - OpenAI Chat Model

This sub-node utilizes the selected OpenAI Chat Model. You can replace it with any LLM that supports tool calling.

Choose Your Model

In this template, the default model is gpt-4o, a costly option. If you'd like a more affordable alternative, select gpt4-o-mini, though note that responses may occasionally be of slightly lower quality compared to gpt-4o.

AI Agent Sub-node - Postgres Chat Memory

Connect your Postgres credentials and specify a table name to store the chat history. In this template, the default table name is insights_chat_histories, and the context window length is set to 5.

** Tip:** If you don’t have a Postgres database, you can quickly set one up with Supabase.

AI Agent Sub-node - Call Search Console Tool

This tool is used by the AI Agent to:

  • Retrieve the list of accessible properties in Search Console
  • Fetch Search Console data based on the user’s natural language request

Respond to Webhook

This node is used to send a response back to the user.

** Tip:** intermediateSteps are configured, allowing you to use raw data fetched from Search Console to create charts or other visualizations if desired.

Tool Call Trigger

This node is triggered when the AI Agent needs to retrieve the website_list (accessible Search Console properties) or custom_insights based on user data.

Set Fields - Construct API Call

This node configures fields based on the JSON sent by the AI agent:

  • The request_type field determines the route: website_list (to retrieve the list of websites) or custom_insights (to get insights from Search Console)
  • Additional fields are set to construct the API call, following the Search Console API Documentation

Search Console - Get Custom Insights

This node performs the API call to retrieve data from Search Console.

Search Console - Get List of Properties

This node performs the API call to retrieve the list of accessible properties from Search Console.

Set Fields - Create searchConsoleDataArray

These nodes create an array based on the response from the Search Console API.

Array Aggregation - Response to AI Agent

These nodes aggregate the array from the previous step and send it back to the AI Agent through the field named output as response.

AI Agent to Chat with Your Search Console Data

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: Search Console API oAuth2 config 1 Search Console API oAuth2 config 2

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

Example of chat with this AI Agent

Troubleshooting

  • "Credentials not found": open the node and select your credential again.
  • Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
  • Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
  • AI node errors: check your API key has billing enabled and the model name exists on your plan.
  • Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.

Need help?

Reply to your Morning Method order email and we'll help you get it running.


© Morning Method

$19.00Regular price $49.0061% off
AI Agent to Chat with Google Search Console Data | n8n Automation | Morning Method