Get Playback State

spotify.get_playback_state
ActionBusiness appsconnection required

Calls the Spotify API with the connection's credentials.

Read what the authorised account is playing right now, and where.

Connection

Required
Yes — the node will not save without one
Auth type
OAuth 2.0
Providers
Spotify
Secret shape
{"client_id": "…", "client_secret": "…", "refresh_token": "…"}
Config it needs
market, device_id
Resolved by
config.connection_id, else node.connection_id

Configuration

2 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
market
ISO 3166-1 alpha-2 country code deciding which catalogue is visible, such as 'US'. Left blank, the connection's default market is used, and the market on the authorised account takes priority over both.
stringNo——US
additional_types
Item types this workflow handles besides tracks. Set it to 'episode' to see podcast playback instead of an empty item.
stringNo——episode

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "additional_types": "episode",
  "market": "US"
}

Output

One shape.

result

FieldTypeExample
active
False when Spotify answered 204: nothing is playing on any device.
boolean—
is_playing
True while the current item is actually playing.
boolean—
progress_ms
How far into the current item playback is.
number—
shuffle_state
Whether shuffle is on.
boolean—
repeat_state
One of off, track or context.
string—
device.id
Id of the device playing, for playback commands.
string—
device.name
Human-readable name of that device.
string—
device.volume_percent
That device's volume, 0 to 100.
number—
item.id
Spotify id of the track or episode playing.
string—
item.name
Its title.
string—
item.uri
Its Spotify URI.
string—
context.uri
URI of the album or playlist being played from.
string—
{
  "active": false,
  "context": {
    "uri": ""
  },
  "device": {
    "id": "",
    "name": "",
    "volume_percent": 0
  },
  "is_playing": false,
  "item": {
    "id": "",
    "name": "",
    "uri": ""
  },
  "progress_ms": 0,
  "repeat_state": "",
  "shuffle_state": false
}

See Get Playback State run in a workflow.

In a technical demo we add the Spotify connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.