Create playlists and control your Spotify player with GPT-4
Needs changesWhat this workflow does
This AI workflow has 22 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects OpenAI Chat Model and Spotify.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- Spotify Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 6 tools (Next song, Pause player, Resume player, Play a playlist…); memory: Simple Memory
- Ideate playlist (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Create playlist (Spotify): create (playlist)
- Get tracks array (Edit Fields (Set)): sets 1 field: Tracks
- Split Out: splits a list into separate items
- Search the track (Spotify): search (track)
- Get track IDs (Edit Fields (Set)): sets 1 field: Track ID
- Add track to playlist (Spotify): work with playlist
- Get the final playlist (Spotify): get (playlist)
- Clean data to share with agent (Code): runs custom JavaScript code
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Spotify Agent (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Spotify Agent (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Rarely used nodes in this template: n8n-nodes-base.spotifyTool
Nodes used (13)
- OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Edit Fields (Set)
n8n-nodes-base.set - Spotify
n8n-nodes-base.spotify - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Split Out
n8n-nodes-base.splitOut - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - AI Agent
@n8n/n8n-nodes-langchain.agent - Code
n8n-nodes-base.code - Spotify Tool
n8n-nodes-base.spotifyTool - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow
From the author
This n8n template provides a powerful AI-powered chatbot that acts as your personal Spotify DJ. Simply tell the chatbot what kind of music you're in the mood for, and it will intelligently create a custom playlist, give it a fitting name, and populate it with…