Telegram to Spotify with OpenAI
Search music and play to Spotify from Telegram This workflow is a simple demonstration on accessing a message model from Telegram and it makes searching for ...
🔌 Nodes & Integrations Used (4)
📖 Implementation & Setup Guide
**Search music and play to Spotify from Telegram**
This workflow is a simple demonstration on accessing a message model from Telegram and it makes searching for songs an easy task even if you can't remember the artist or song name. An OpenAI message model tries to figure out the song and sends it to an active Spotify device**.
**Use case** Imagine an office where you play music in the background and the employees can control the music without having to login to the playing account.
**How it works** - You describe the song in Telegram. - Telegram bot sends the text to n8n. - An OpenAI message model tries to find the song. - Spotify gets the search query string. - First match is then added to queue. -- If there is no match a message is sent to Telegram and the process ends. - We change to the next track in the list. - We make sure the song starts playing by trying to resume. - We fetch the currently playing track. - We return "now playing" information to Telegram: Song Name - Artist Name - Album Name.
**Error handling** - Every Spotify step has it's on error handler under settings where we output the error. - Message parser receives the error and sends it to Telegram.
**Requirements** - Active workflow* - OpenAI API key - Telegram bot - Spotify account and Oauth2 API - Spotify active on a device**
.* The Telegram trigger is activated only if this workflow is active. You can however TEST the workflow in the editor by clicking "Test step" and then it waits for the Telegram event. When event is received, just step through all steps or just clicking "Test step" on the "Fetch Now Playing" node.
.** You must have a Spotify device active when trying to communicate with a device. Open Spotify and play something - not it is active.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Telegram to Spotify with OpenAI.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related Messaging & Chat Workflows
View All in Messaging & Chat →Add a bug to Linear via Slack command
Use Case When building a product it's important to discover and eliminate bugs as quickly as possible. Since we're using our product at n8n a lot, we wanted ...
AI Children s Storytelling on Telegram
Production-ready n8n automation template for AI Children s Storytelling on Telegram built by AhiXLight. Seamlessly connects Lm Chat Open Ai, Chain Summarization, Text Splitter Recursive Character Text Splitter with 14 configured nodes.
AI Event Banner Generator with BannerBear
Production-ready n8n automation template for AI Event Banner Generator with BannerBear built by AhiXLight. Seamlessly connects Form Trigger, HTTP Request, Bannerbear with 16 configured nodes.
AI Event Banner Generator with n8n
Production-ready n8n automation template for AI Event Banner Generator with n8n built by AhiXLight. Seamlessly connects Form Trigger, HTTP Request, Bannerbear with 16 configured nodes.