Skip to main content

Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT

Workflow preview

Workflow preview
100%
Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

AI Spotify Playlist Generator (Telegram → Spotify) instantly create a curated Spotify playlist based on a single song recommendation sent via Telegram. This workflow uses an AI Agent to generate...

Best for

  • Content Creation automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.splitout, n8n-nodes-base.splitinbatches, n8n-nodes-base.spotify, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by raas.

Original n8n.io source

1.1 Workflow description

Title
Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT
Workflow name
Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT

🎵 AI Spotify Playlist Generator (Telegram → Spotify)

instantly create a curated Spotify playlist based on a single song recommendation sent via Telegram. This workflow uses an AI Agent to generate similar tracks, creates a new playlist, sends you the link immediately, and then populates the playlist in the background. ✨ Features

Instant Feedback: Creates the Spotify playlist and sends the URL back to your Telegram chat immediately, before the AI finishes processing.

AI Curation: Uses an AI Agent (via OpenRouter) to act as a "Greatest DJ," generating 25 songs similar to your input.

Smart Searching: Automatically searches Spotify for the generated tracks.

Error Handling: Includes logic to skip tracks that cannot be found on Spotify.

Rate Limiting: Includes a wait loop to ensure Spotify API rate limits are respected during population.

🛠️ Prerequisites

To use this workflow, you need:

n8n: An active instance of n8n.

Spotify Developer Account: You need a Client ID and Client Secret to authenticate the Spotify node.

Telegram Bot: A bot token created via @BotFather.

OpenRouter Account: An API key for OpenRouter to access the LLM (Language Model).

    Note: You can easily swap the OpenRouter node for an OpenAI or Anthropic node if preferred.

🔄 How it Works

Trigger: You send a message to your Telegram Bot (e.g., "Daft Punk - One More Time").

Create Playlist: The workflow immediately creates a new empty playlist on your Spotify account named with your username and the prompt.

Reply: The bot replies to you with the link to the new playlist.

AI Generation: The prompt is sent to an AI Agent which generates a JSON list of ~25 similar tracks and artists.

Processing:

    The workflow splits the list into individual items.

    It loops through every item.

    It searches Spotify for the specific Track + Artist.

    If found, it adds the track to the playlist.

    It waits 1 second between adds to prevent API errors.

⚙️ Setup Instructions

Credentials:

    Set up your Telegram API credentials in the Trigger and Send Message nodes.

    Set up your Spotify OAuth2 credentials in the Create, Search, and Add Item nodes.

    Set up your OpenRouter API credentials in the Chat Model node.

Model Selection:

    The template is configured to use openai/gpt-5-nano via OpenRouter. If this model is unavailable to you, simply open the OpenRouter Chat Model node and change the model to openai/gpt-4o or meta-llama/llama-3-70b-instruct.

Activate:

    Save the workflow and click Activate.

    Open your Telegram bot and send it a song name!

📦 Dependencies

n8n-nodes-base.telegramTrigger

@n8n/n8n-nodes-langchain.agent

n8n-nodes-base.spotify

n8n-nodes-base.splitOut

n8n-nodes-base.splitInBatches

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 3 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 4 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 5 - Split Out Array

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 6 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 7 - Search tracks by keyword

Type / Role
n8n-nodes-base.spotify - spotify
Config choices
Version 1

Block 8 - Create a playlist

Type / Role
n8n-nodes-base.spotify - spotify
Config choices
Version 1

Block 9 - Add an Item to a playlist

Type / Role
n8n-nodes-base.spotify - spotify
Config choices
Version 1

Block 10 - Send a text message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Wait 1 Sec

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT
Complexity advanced
Nodes 17
Categories Content Creation, AI Chatbot
Author raas
Published 20 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11030/11030.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate AI-curated Spotify playlists from Telegram using OpenRouter GPT do?

AI Spotify Playlist Generator (Telegram → Spotify) instantly create a curated Spotify playlist based on a single song recommendation sent via Telegram. This workflow uses an AI Agent to generate...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI Chatbot use case.