Automate Monthly Spotify Track Archiving & Playlist Classification with n8n

This detailed n8n workflow automates archiving monthly Spotify liked tracks into Google Sheets and categorizes them into personalized playlists using AI. It solves the challenge of manual music collection management and playlist organization.
spotify
lmChatAnthropic
googleSheets
+10
Workflow Identifier: 1113
NODES in Use: scheduleTrigger, spotify, filter, set, googleSheets, code, httpRequest, splitOut, merge, lmChatAnthropic, chainLlm, outputParserStructured, noOp
Automate Spotify track archiving with n8n and Google Sheets

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow helps you save time by automating the monthly saving and sorting of your Spotify tracks into playlists.

It stops you from doing manual, slow work like copying track details or misplacing songs in wrong playlists.

The result is an updated, well-organized music collection with fresh tracks added and classified every month.


Tools and Services Used

  • Spotify API: Gets playlists, tracks, and audio features, and updates playlists.
  • Google Sheets: Stores archived track and playlist data safely.
  • n8n: Builds and runs the whole automation workflow.
  • Anthropic Claude 3.5 AI model: Classifies music tracks based on playlist descriptions.

Who Should Use This Workflow

This is for Spotify users who want to stop spending hours tracking and sorting their new favorite tracks.

If you want to keep your playlists neat while saving time, this workflow is for you.


Inputs, Processing Steps, and Output

Inputs

  • Your Spotify playlists and liked tracks retrieved via Spotify OAuth2.
  • Your Google Sheets spreadsheets where archives are logged.
  • Playlist and track descriptions used by the AI model for classification.

Processing Steps

  • Trigger the workflow monthly automatically.
  • Fetch all your Spotify playlists and filter only those you own.
  • Log any new playlists in Google Sheets to avoid duplicates.
  • Retrieve all liked or saved tracks from your Spotify library.
  • Extract useful info from each track like title, artist, album, and IDs.
  • Batch track IDs to get detailed audio features from Spotify API efficiently.
  • Merge the audio features back with track details for full metadata.
  • Add the current date to each track for log accuracy.
  • Check against Google Sheets to remove tracks already archived.
  • Log new tracks to Google Sheets to keep an updated monthly archive.
  • Group new tracks into smaller chunks to not exceed AI token limits.
  • Send these chunks to Anthropic Claude 3.5 AI to classify tracks into playlists based on descriptions.
  • Parse AI output from JSON to usable format.
  • Split classified playlists and filter out empty ones.
  • Batch track URIs for adding them to Spotify playlists in groups of 100 (API limit).
  • Update Spotify playlists by adding tracks classified by AI, with retries if some calls fail.

Output

  • New tracks archived in Google Sheets with full metadata.
  • Spotify playlists updated with correctly classified new tracks.
  • Reduced manual work and fewer mistakes in track management.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import Workflow

  1. Download the workflow file from this page.
  2. In your n8n editor, click “Import from File” to bring in this workflow.

Step 2: Configure Credentials and IDs

  1. Add your Spotify OAuth2 credentials with correct permissions (playlist read and modify).
  2. Add your Google Sheets OAuth2 credentials and check spreadsheet IDs and sheet names match your files.
  3. Add your Anthropic API key for the Claude 3.5 model.
  4. Review any Code or Prompt nodes and update playlist descriptions or other text if you want custom classification.

Step 3: Test the Workflow

  1. Run the workflow once manually to check for any errors.
  2. Check your Google Sheets to confirm new entries are being logged correctly.
  3. Watch for any API errors or AI output formatting issues.

Step 4: Activate for Production

  1. Enable the monthly trigger node to let the workflow run automatically every month.
  2. Monitor workflow runs inside n8n editor to catch any problems early.
  3. Make adjustments by updating prompts or batch sizes if needed.

For full server control, consider self-host n8n.


Customization Ideas

  • Change AI prompt in the Chain LLM node to adjust how tracks get placed in playlists.
  • Add more Spotify audio features by calling additional Spotify APIs for richer data.
  • Modify Google Sheets columns to add or remove stored track details.
  • Adjust the Schedule Trigger node to run weekly or on-demand instead of monthly.
  • Add Webhook nodes for manual approvals before playlist updates.

Common Problems and Fixes

  • Spotify API returns 401 Unauthorized: OAuth Access token expired or missing playlist scopes. Reauthorize Spotify credentials granting needed scopes.
  • Google Sheets append node does not add rows: Check sheet ID, sheet name, and OAuth permissions carefully. Test reading data first to verify connection.
  • AI returns bad or empty JSON output: Too many tracks exceeding AI token limits. Lower batch sizes in code node or adjust Anthropic node token limits.

Summary of What You Get

✓ Tracks saved every month automatically to Google Sheets with full data.

✓ Playlists updated with new tracks sorted by AI classification.

✓ Time saved by avoiding manual copying and sorting.

✓ Reduced mistakes in playlist management.

→ A neat, always up-to-date Spotify music library organized by AI analysis.


Automate Spotify track archiving with n8n and Google Sheets

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

Reauthorize the Spotify OAuth2 credentials and ensure correct scopes like playlist-read-private and playlist-modify are granted.
Verify the spreadsheet ID, sheet name matches exactly, and OAuth permissions are valid. Test the Google Sheets read node first.
Too many tracks sent exceed Anthropic Claude 3.5 token limits. Reduce batch sizes or increase token limits in the AI node.
Yes, AI models like OpenAI GPT can replace the Anthropic Chat Model node by updating prompts accordingly.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.