Developer & DevOps

Spotify automation

26 nodes 204 117 Automatic trigger
Download

Workflow Description

Advanced automation template connecting Spotify with MQTT protocol to trigger music tasks based on external events. Processes incoming data and applies conditional logic to execute specific actions on your Spotify account in real-time.

How it works

  1. 1.Receive MQTT signal that triggers the workflow
  2. 2.Process and split incoming data according to defined criteria
  3. 3.Apply conditional logic to verify events and filter data
  4. 4.Execute Spotify actions such as play, pause, or change playlists
  5. 5.Send HTTP requests to external services if needed
  6. 6.Log results and errors for review and troubleshooting

Use cases

  • Automatically play specific playlists when IoT devices trigger events
  • Switch music based on real-time sensor data and smart home conditions
  • Sync Spotify status with smart home systems via MQTT messaging
  • Record listening activity and send data to external databases

Requirements

  • Active Spotify account with valid API credentials configured
  • Running MQTT broker that is reachable from n8n infrastructure
  • Documented MQTT topic identifier for message subscription
  • Basic knowledge of JSON format for exchanging data payloads
  • Firewall rules allowing outbound connections to external services

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

If Mqtt Trigger

Details

Trigger Automatic trigger
Nodes 26
Apps 2
Views 204
Downloads 117

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (26)

/

Spotify Next

If

#1

Spotify Resume

If

#2

Spotify Pause

If

#3

Sticky Note

Sticky Note

#4

Spotify API - Volume up 5pct

HTTP Request

#5

Spotify API - Volume down 5pct

HTTP Request

#6

Sticky Note8

Sticky Note

#7

Spotify API - Get Available Devices

HTTP Request

#8

Extract Individual Devices

Split Out

#9

Select Device by Name to get device_id

Filter

#10

Custom Function 1 - P1

HTTP Request

#11

Custom Function 2 - P2

If

#12

Custom Function 1 - P3

If

#13

Spotify API - Activate Target Playback Device

HTTP Request

#14

Route to Requested Function

Switch

#15

Custom Function 2 - P1

If

#16

Filter

Filter

#17

Globals

Set

#18

Custom Function 2 - P3

If

#19

Oops. How was this reached?

No Op

#20

Spotify API - Get Device Status

HTTP Request

#21

Already playing on Target Device?

If

#22

Is Playing?

If

#23

Spotify Prev

If

#24

MQTT Trigger - Remote Switch

Mqtt Trigger

#25

Remote Action -> Function Router

Switch

#26