---
related_nodes: ["spotify_get_playback_state", "spotify_get_queue", "spotify_add_to_queue", "spotify_search"]
---

# Spotify Playback Control

## Overview

Control Spotify playback from a workflow: play, pause, resume, skip next, or skip previous.
For `play`, you can optionally pass a Spotify URI (`spotify:track:...`, `spotify:album:...`, `spotify:playlist:...`).

This node uses the connected Spotify account and returns:
- `success`: `true`/`false`
- `error`: error text when the action fails

> Playback control requires a Spotify Premium account.
> Playback actions also require an active Spotify device.

## When to Use

- Start a playlist at a scheduled time
- Pause music during meetings
- Resume or skip tracks based on automation logic
- Build assistant-driven music control workflows

## Configuration

**connection** (required)
- Spotify connection from workspace Settings → Connections

**action** (required, default: `play`)
- `play`
- `pause`
- `resume`
- `skip_next`
- `skip_previous`

**context_uri** (optional)
- Used by `play` action
- If omitted, `play`/`resume` resumes current playback context

**retry** (optional, default: Off)
- Sends a request again after a failure that passes; see [Retries](http_get.md#retries). `play`, `pause` and `resume` repeat safely and are sent again freely. `skip_next` and `skip_previous` are writes, sent again only when Spotify refused them before acting: the connection never opened, or Spotify answered 425 or 429.

## Inputs

**input** (required)
- Any value; used to keep workflow control flow connected

**context_uri** (optional)
- Overrides configured `context_uri`
- If both input and config are empty, `play` resumes current playback

## Outputs

**success**
```json
true
```

**error**
```json
"Failed to start playback: No active Spotify device found. Please start playback on a device first."
```

Common failures:
- Premium required (`403`)
- No active device (`404`)
- Rate limit (`429`)

### Route to error output

With the failure mode set to **Route to error output** (`base_config.failure_mode: "route_to_error"`), a failed action fails the node instead of returning `success: false`. `success` is skipped, and `error` carries the node error value (`node_id`, `node_type`, `message`, `causes`) in place of the text, with the text above in `message`. The run records the node as failed with its error routed and completes with warnings. On success `error` is skipped. In every other mode `error` is the text above.

## Example

```json
{
  "connection": "spotify-main",
  "action": "play",
  "context_uri": "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M"
}
```

## Tips

- Use **Spotify Get Playback State** before control actions to check whether a device is active.
- Use `context_uri` input to switch playlists dynamically per workflow run.
- Handle `success = false` with an error branch so workflows can recover gracefully.
