Introduction
Running regular SEO audits is critical to catch performance regressions before they impact your rankings. In this tutorial, you’ll build a no-code SEO audit bot in n8n that:
- Triggers on a schedule
- Calls Google’s Pagespeed Insights API (Lighthouse)
- Parses Core Web Vitals metrics
- Sends a summary to a Slack channel
By the end, you’ll have an automated workflow that keeps you informed of site health without lifting a finger.
Prerequisites
Before you begin, ensure you have:
- An n8n instance (cloud or self-hosted)
- A Google Cloud API key with Pagespeed Insights enabled
- A Slack workspace and incoming webhook URL
- Basic familiarity with n8n’s HTTP Request and Slack nodes
Workflow Overview
- Cron Trigger
- Set URL
- HTTP Request to Pagespeed Insights
- Extract Metrics
- Slack Notification
1. Cron Trigger
- Add the Cron node.
- Configure to run at your chosen interval (e.g., every day at 8 AM).
{
"nodes": [
{
"parameters": {
"mode": "everyDay",
"hour": [8],
"minute": [0]
},
"name": "Cron Trigger",
"type": "n8n-nodes-base.cron"
}
]
}
2. Set URL
- Add a Set node to define the target website URL.
{
"nodes": [
{
"parameters": {
"values": {
"string": [
{
"name": "url",
"value": "https://yourdomain.com"
}
]
}
},
"name": "Set URL",
"type": "n8n-nodes-base.set"
}
]
}
3. HTTP Request to Pagespeed Insights
- Use the HTTP Request node to fetch Lighthouse data.
{
"nodes": [
{
"parameters": {
"requestMethod": "GET",
"url": "https://www.googleapis.com/pagespeedonline/v5/runPagespeed",
"queryParametersUi": {
"parameter": [
{ "name": "url", "value": "={{$node[\"Set URL\"].json[\"url\"]}}" },
{ "name": "key", "value": "={{$credentials[\"Pagespeed API\"].apiKey}}" }
]
}
},
"name": "Pagespeed API",
"type": "n8n-nodes-base.httpRequest"
}
]
}
4. Extract Core Web Vitals
- Add a Function node to parse the JSON and extract metrics:
return [
{
json: {
LCP: $node["Pagespeed API"].json["lighthouseResult"].audits["largest-contentful-paint"].displayValue,
FID: $node["Pagespeed API"].json["lighthouseResult"].audits["interactive"].displayValue,
CLS: $node["Pagespeed API"].json["lighthouseResult"].audits["cumulative-layout-shift"].displayValue
}
}
];
5. Slack Notification
- Use the Slack node to send a formatted message:
{
"nodes": [
{
"parameters": {
"webhookUri": "={{$credentials[\"Slack Webhook\"].url}}",
"text": "🏁 SEO Audit Results for https://yourdomain.com\n• LCP: {{$json[\"LCP\"]}}\n• FID: {{$json[\"FID\"]}}\n• CLS: {{$json[\"CLS\"]}}"
},
"name": "Slack Alert",
"type": "n8n-nodes-base.slack"
}
]
}
Conclusion
You’ve built a fully automated, no-code SEO audit bot that runs on your schedule, checks Core Web Vitals via Lighthouse, and pushes results directly to Slack. From here, you can:
Add an Email node for backup notifications:
Use the Email node to send audit results to your inbox as a fallback in case Slack is unavailable.Log results to Google Sheets or Airtable:
Integrate the Google Sheets or Airtable node to store each audit’s results for historical tracking and analysis.Extend metrics to include accessibility or SEO audits:
Modify the Function node to extract additional Lighthouse categories, such as accessibility or SEO scores, and include them in your notifications.
Additional Resources
Which no-code automation tool or SEO metric are you most excited to try? Share your thoughts and experiences in the comments below!
Comments
Comments
Comments are not currently enabled. You can enable them by configuring Disqus in your site settings.