Skip to main content

N8n Workflow to Identify Canonical Tags

Published on
Jul 11, 2025
Views
--
Comments
--
N8n Workflow to Identify Canonical Tags

What have we created?

I have developed an automated workflow in n8n that allows users to interact via Telegram with a technical SEO expert agent. This agent can automatically detect whether a website has a canonical tag configured and provide detailed information about it.

Technologies used

  • N8n: Workflow automation platform
  • Telegram: Conversational user interface
  • Gemini: AI model for natural language processing
  • JavaScript: Logic for HTML analysis
  • HTTP requests: Web content extraction

First phase: Intelligent conversational agent

The core of the system is a specialized conversational agent that:
Acts as a technical SEO expert: Configured with a specific prompt to behave like a professional in technical SEO
Requests URLs from the user: Naturally asks for the website URL to analyze
Integration with Gemini: Connected to the Gemini AI model for natural language processing
Persistent memory: Maintains conversation context, remembering provided URLs and past interactions
Specialized tool: Implements a tool that activates automatically when a user provides a URL, storing it for later processing

Telegram bot
Telegram bot

Second phase: Processing and analysis

The workflow includes an intelligent decision system:

Evaluation condition

Determines whether the user has provided a valid URL in the conversation
If no URL: The conversation continues with the agent requesting the necessary information
If there is a URL: The process proceeds to the technical analysis phase

Content extraction

An HTTP request module retrieves all the HTML code from the provided URL
This process is fully automated and handles different types of server responses

Conditional workflow
Conditional workflow

Code analysis:

A specialized JavaScript code node examines the HTML for the canonical tag
The analysis is thorough and considers different formats and tag locations

Javascript code
Javascript code

Third phase: Response to the user

The system ends with a clear and helpful response:

If it finds the canonical tag

Confirms its presence
Provides the exact canonical URL
Offers relevant additional information

If it does not find the tag

Clearly states that no canonical tag exists
Can suggest improvements or next steps

User answer
User answer

System benefits

This automated workflow offers multiple advantages:

  • Accessibility: Users can perform SEO audits from Telegram without complex technical tools
  • Speed: Instant analysis of any URL
  • Accuracy: Precise detection of canonical tags in various formats
  • Scalability: Can handle multiple simultaneous queries
  • Contextual memory: Maintains conversation thread for deeper analysis

Practical applications

This system is especially useful for:

  • SEO auditors: Quick verification of multiple websites
  • Web developers: Validation during development
  • Marketing teams: Monitoring the SEO health of their digital properties
  • Consultants: Demo and analysis tool for clients
Last updated: Jul 11, 2025