Automated SEO Reports with n8n and Search Console

A daily email compares two seven-day windows from Search Console and shows clicks, opportunity keywords and quiet traffic drops. No AI at all.

· 8 min

When did you last open Google Search Console? For most people, the honest answer is: once traffic had already dropped. That's the worst possible moment, because by then Google has been judging your site for weeks, and all you're reading is the receipt.

I built a small n8n workflow that flips this around. Every morning at seven I get an email with the numbers that matter, already compared against the previous week, and all it takes is six nodes, with no AI at all.

There's no AI agent behind it deciding anything on its own, just a fixed chain of rules that does exactly the same thing every morning. If you're just getting started with n8n, my five beginner workflows for marketing are easier ways in. And if you're still torn between n8n and Make.com, my comparison of the two should help.

What ends up in the email

The report is a single dark-themed HTML email, with no attachment and no login.

It opens with the overview: clicks, impressions, click-through rate and average position for the last seven days, each with a percentage delta against the seven days before. For position, the colors are flipped, because a smaller number is the good direction there. If you only look at absolute numbers, it's easy to miss that a jump from position 8 to position 5 is a win, even though the number got smaller.

Below that come the keyword tables. The top keywords are sorted by impressions, not clicks, because on a small site the click counts are far too thin to rank anything sensibly.

The opportunities table shows everything between position 4 and 20, so from the bottom of page one through page two. That's exactly where a rewritten title or a few internal links actually move something.

The hidden gems are queries with impressions but zero clicks: Google shows you, and nobody clicks. In that case the problem is usually the title or the description, not the ranking. That's exactly why I built myself a meta tag checker that shows the preview in pixels instead of characters.

Then comes cannibalization, meaning the same query ranks with two or more of your own URLs, but only when the second URL actually gets a meaningful share of the impressions. At the end there's a topic cluster block that groups queries by shared word pairs. It's rough, but it gives you a usable picture of what Google thinks your site is about.

Setting up Google Cloud

This is the annoying part. Google doesn't make it easy, but it's twenty minutes, once. The thing people most often trip over is the OAuth consent screen, because Google distinguishes between an internal and an external user type there, and the labels aren't exactly self-explanatory.

  1. Open the Google Cloud Console and log in with the account that has access to your Search Console property.
  2. Create a new project.
  3. Under APIs & Services > Library, enable the Google Search Console API. If you want the email sent through Gmail, enable the Gmail API as well.
  4. Configure the OAuth consent screen. External user type is enough. Add your own Google account as a test user, otherwise you'll get stuck in the verification loop.
  5. Under Credentials, create an OAuth client ID of type Web application and add n8n's OAuth redirect URL to the authorized redirect URIs.

After that, create the matching credentials in n8n: a Google OAuth2 API credential for the Search Console calls and a Gmail OAuth2 credential for sending. Both nodes later reference them by name, so you only set them up once. Without having Google officially verify the app, access stays limited to the test users you added, but for the one and only user in your own workflow, that's no problem.

The workflow, node by node

1. Schedule Trigger

A simple daily trigger at 07:00. You don't need to set anything beyond the time.

2. Calculate the two time windows

Calculating the two time windows is the job of a Code node, the first place in the workflow where the details really matter:

const LAG_DAYS = 3;
const WINDOW_DAYS = 7;

const DAY_MS = 86400000;
const iso = (d) => d.toISOString().slice(0, 10);

const base = new Date(Date.now() - LAG_DAYS * DAY_MS);
const curEnd = new Date(Date.UTC(base.getUTCFullYear(), base.getUTCMonth(), base.getUTCDate()));
const curStart = new Date(curEnd.getTime() - (WINDOW_DAYS - 1) * DAY_MS);
const prevEnd = new Date(curStart.getTime() - DAY_MS);
const prevStart = new Date(prevEnd.getTime() - (WINDOW_DAYS - 1) * DAY_MS);

LAG_DAYS = 3 is the line that matters. Search Console data arrives with a delay, the last two to three days are practically always incomplete, and if you include them, the report shows a decline every morning that isn't really there. I'd rather have a number that's three days old but correct than a current one that isn't. Google itself marks the most recent data points in the Performance report as preliminary, and according to the Search Console help they can still change over the following hours.

Normalizing to UTC midnight matters too, otherwise the windows shift depending on where your n8n instance runs.

3. Fetch the current period

An HTTP Request node sends a POST to:

https://searchconsole.googleapis.com/webmasters/v3/sites/sc-domain:YOUR-DOMAIN/searchAnalytics/query

Authentication runs through a predefined credential type, Google OAuth2 API, and the body goes in as JSON:

{
  "startDate": "{{ $json.startDate }}",
  "endDate": "{{ $json.endDate }}",
  "dimensions": ["query", "page"],
  "type": "web",
  "aggregationType": "auto",
  "rowLimit": 5000,
  "startRow": 0
}

The request uses two dimensions, query and page. You need the page dimension for the cannibalization check, because that's exactly what it's about: one query ranking with several URLs at the same time. Turn on retry on fail with three attempts, because the API throws the occasional 429.

4. Fetch the previous period

Same node, same body, different dates. It reads them back from the first Code node, referenced by whatever name you gave it (mine is called Date window):

{{ $('Date window').first().json.prevStartDate }}

That's two separate calls instead of one clever one, because the API can't do period comparisons. So you fetch both periods separately and do the math yourself.

5. Build the report

The second Code node does the actual work. Three things in it are worth copying.

Aggregate at query level first. The API returns query-page pairs, so a single keyword shows up several times if it ranks with several URLs. These get merged into one entry per query before anything is compared. Clicks and impressions simply add up. Position, on the other hand, has to be weighted by impressions, exactly the way the Search Console interface calculates it itself:

entry.position = entry.impressions > 0 ? entry.posWeighted / entry.impressions : 0;

Make the thresholds relative. My first version had fixed cutoffs, something like "at least 50 impressions and no clicks" for the hidden gems card. On a site my size, that card was empty every single day. Now it takes the 80th percentile of my own impression counts:

const gemThreshold = Math.max(2, percentile(curQueries.map((q) => q.impressions), 0.8));

The same principle applies to cannibalization: the second URL has to reach at least 20 percent of the top URL's impressions before it counts at all. Relative thresholds scale with the site instead of assuming a particular size. A site with 50,000 impressions a week and one with 500 both get sensible cutoffs that way, without anything in the code having to change.

Deduplicate the topic clusters. Grouping queries by word pairs is cheap and works surprisingly well, but the word pairs of one keyword overlap heavily. "lightroom export" and "export einstellungen" (German for "export settings") produce almost the same cluster. So every candidate cluster is compared against the ones already picked using Jaccard similarity, and anything above 50 percent overlap gets thrown out:

const jaccard = (a, b) => {
  const overlap = [...a].filter((x) => b.has(x)).length;
  return overlap / new Set([...a, ...b]).size;
};

Three clusters make it into the email. Any more, and the email turns into a wall of text.

At the end, the node returns the finished HTML plus a subject line with the key numbers, so the inbox preview already tells you whether anything has moved at all.

6. Send it

A Gmail node sends the email with email type HTML, with subject and body coming from the previous node. Turn off "Append attribution", unless you want n8n's footer in your own report.

What it actually found

This is how I noticed that my own site had gone quiet. Impressions fell from around 150 a week to 8, and the report put that right in front of me with the comparison already done. The cause was a hosting migration that had silently killed every redirect on the site. That's not something you notice by looking at your homepage.

That's the real argument for a daily check rather than a monthly one. Most mornings you don't do anything with it. But in the one week where it really counts, you're already looking at the right screen.

Where it falls short

The word-pair clusters are a blunt instrument. They group by surface form, so two queries with the same meaning but different words end up in different clusters. "seo report automatisieren" and "automatischer seo bericht" (German for "automate SEO report" and "automatic SEO report") mean roughly the same thing, but show up separately in the cluster block. An embedding model would handle that better, but I deliberately didn't use one, because that would trade a free workflow for an API bill on something I read for ten seconds a day.

It doesn't tell you why something changed, only that it changed, and it gives you the URL. You have to figure out the rest yourself, which in my case cost a morning of old URLs and curl.

FAQ

Why does the report leave out the last three days?
Search Console data arrives with a delay. The last two to three days are incomplete, and if you include them, the comparison shows a decline every morning that isn't really there. The workflow sets LAG_DAYS to 3 and ends the current window there.
Do you need an AI model for this?
No. Everything runs as plain JavaScript in two Code nodes. The topic clusters come from word pairs and a set-overlap check, not from embeddings. That keeps the workflow free and makes every number traceable.
Does this also work for a site with hardly any traffic?
Yes, that's exactly what the relative thresholds are for. The hidden gems card takes the 80th percentile of your own impression counts instead of a fixed minimum, so it still shows something even when your best keyword has only twelve impressions.
Portrait of Eric Hinzpeter

Eric Hinzpeter

Eric Hinzpeter, Senior B2B Content Strategist. He builds AI agents and marketing automation for production use and writes up what comes out of it here.

About meLinkedIn (new tab)