Latenode

Sync and optimize Spotify playlists with AI-powered sorting

This template starts from a webhook, loads your Spotify playlists through the Spotify Web API, removes duplicate tracks, sorts by popularity, and adds the ordered tracks to your playback queue. Put the Spotify access token in the JavaScript node. Connect Supabase and store the cleaned snapshot. Return the queue result to the caller with a webhook response.

Updated Sep 16, 2026Est. run: 15sEst. cost: $0.0009
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how CPU seconds work →

Workflow preview

What this template does

  • Rebuilds a popularity-sorted queue from your playlists
  • Calls the Spotify Web API from JavaScript
  • Stores the cleaned snapshot in Supabase
  • Keeps the Spotify token in that JavaScript node

How it works

1
Trigger

Start a curation pass

A webhook starts the scenario when you ask it to refresh playlists and the queue.

2
Logic

Clean and sort tracks

JavaScript loads playlists through the Spotify Web API, drops duplicates, and sorts by popularity. Put the Spotify access token in that JavaScript node.

3
Action

Queue and store

The same JavaScript node adds tracks to the Spotify queue. Supabase upserts the cleaned snapshot. The webhook response returns the result.

Setup guide

1

Add the webhook

Add a webhook trigger and a webhook response. Call this URL when you want a fresh queue.

2

Put the Spotify token in JavaScript

Use a JavaScript node to call the Spotify Web API. Put the Spotify access token in that JavaScript node. That node lists playlists, removes duplicates, sorts by popularity, and adds tracks to the queue.

3

Connect Supabase

Add a Supabase connection. Put the project URL and key on that connection. Upsert a row with the cleaned playlist snapshot after the queue is filled. Send a test request and confirm the queue updates in Spotify.

Requirements

A Spotify account and Web API token stored in the JavaScript node
A Supabase table Latenode can upsert
A webhook caller that starts the curation pass

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.