AI-Powered Lyrics Analysis Assistant for Telegram - n8n Workflow

Automate lyrics analysis using this powerful n8n workflow. Integrate Telegram and OpenAI to get translations, interpretations, vocabulary lists, and poetic analysis instantly using tailored n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Language learners who use music to study vocabulary and idioms.
Music analysts or enthusiasts seeking deep, AI-driven interpretations.
Educators looking for automated poetic and linguistic analysis tools.
Automation specialists deploying sophisticated n8n workflow templates.


  • Users looking for advanced use cases of the Telegram n8n node and OpenAI n8n node.

Overview

This solution transforms your Telegram bot into a sophisticated AI assistant. It solves the problem of manual lyrics research by providing instant, detailed linguistic and poetic analysis powered by OpenAI, all triggered via a simple Telegram command. This specific n8n workflow leverages web scraping (using the HTTP Request n8n node) to fetch lyrics from any URL, cleans the raw HTML using a Code n8n node, and then routes the text through various specialized OpenAI prompts based on the user's command (e.g., /studylyrics, /summarizelyrics). Deploying this n8n template allows users to rapidly access translations, vocabulary breakdowns, and deep emotional interpretations for any song, significantly enhancing language study or music appreciation. This is a robust example of a command-driven n8n automation flow.

How it Works

The n8n workflow begins when the Webhook que recebe as mensagens n8n trigger receives a message from Telegram. First, the MessageFilter validates the input. The Settings n8n node captures the user's chatid and sets configuration parameters like AI temperature (0.8).

If the message is "/start", the flow uses an OpenAI n8n node to return a detailed usage guide. For analysis commands (e.g., /getlyrics ), the ExtractURL Code n8n node parses the URL. An If n8n node checks if the URL is valid; otherwise, it sends an IncompleteCommand error.

If the URL is valid, the DownloadURL HTTP Request n8n node fetches the lyric page. The CleanUp Code n8n node then meticulously strips away all HTML, scripts, and non-content data, leaving behind only the clean text.

Next, the Switch n8n node determines which specific analysis the user requested (Translation, Summary, Poetic Analysis, etc.). The flow branches to one of six dedicated OpenAI n8n nodes, each equipped with a unique prompt designed for the chosen analysis type. For example, the /study_lyrics n8n node uses a prompt specifically focused on identifying idioms and slang. Finally, the output from the chosen OpenAI n8n node flows into the Text reply Telegram n8n node, which securely returns the detailed analysis back to the user's chat. If an unrecognized command is sent, the flow hits the Switch's fallback and sends a generic error message, ensuring robust n8n workflow handling.

Installation Guide

To install and run this powerful n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and paste it into your self-hosted or cloud n8n instance using the "Import Workflow" function.

  2. Configure Credentials:

Telegram: Create a Telegram Bot token via @BotFather. Configure a Telegram API n8n Credential in n8n using this token.
OpenAI: Obtain an API key from OpenAI and configure an OpenAI n8n Credential within your n8n setup.

  1. Set Up the n8n Trigger (Webhook): The Webhook que recebe as mensagens n8n node is the entry point. Activate the n8n workflow and copy the resulting n8n Webhook URL.

  2. Connect Telegram to n8n: You must register the copied n8n Webhook URL with Telegram using the setWebhook API call. You can use curl or navigate a browser to https://api.telegram.org/botBOTTOKEN>/setWebhook?url=N8NWEBHOOK_URL>.

  3. Test the n8n Workflow: Send the "/start" command to your Telegram bot to confirm connectivity and verify that the n8n workflow executes correctly.

Node Details

This n8n workflow relies on a complex integration of specialized nodes:

Webhook que recebe as mensagens (n8n Webhook n8n trigger): The starting point. It listens for incoming POST requests from the Telegram API when a user sends a message to the bot.
Settings (Set n8n node): A crucial configuration point. It dynamically captures the chatid from the incoming Telegram data and defines global parameters like modeltemperature (0.8) and maximum tokenlength (4096) for all subsequent OpenAI n8n node calls.
ExtractURL and CleanUp (Code n8n node): These custom scripting nodes are essential for data preparation. ExtractURL uses JavaScript to parse the URL argument from the user's message, while CleanUp uses regex and string manipulation to perform light web scraping cleanup, removing all non-lyric elements (scripts, styles, HTML tags) from the HTTP response.
Download
URL (HTTP Request n8n node): Fetches the raw HTML content of the provided lyrics URL, bridging the gap between the Telegram command and the data source.
If / Switch (Flow Control n8n node): These nodes manage routing. The If node handles the simple "/start" command, while the main Switch n8n node routes the flow based on the specific analysis command (e.g., /getlyrics, /vocabularylyrics).
OpenAI (n8n node): Six distinct OpenAI n8n nodes are used, each with tailored system and user prompts to execute specific AI tasks: generating translations, interpretations, vocabulary lists, summaries, and poetic analyses. They rely on the modeltemperature set earlier by the Settings n8n node.


  • Text reply (Telegram n8n node): The final action node. It transmits the AI-generated analysis back to the user in their Telegram chat, dynamically referencing the chatid stored by the Settings n8n node.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Senior Information Security Architect transitioning into AI/RPA and productized workflows. I love to innovate and test ideas—prototyping with n8n, lovable, ChatGPT, and CrewAI to turn repetitive tasks into reusable, documented templates.

Featured*