Control Playback
spotify.control_playback
ActionBusiness appsconnection required
Calls the Spotify API with the connection's credentials.
Play, pause or skip on the account's active Spotify Connect device.
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
5 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
action What to do: resume or start playback, pause it, or skip to the next or previous item. | string | No | play | one of "play", "pause", "next", "previous" | — |
device_id Id of the device to command, from spotify.get_playback_state. Left blank, the connection's default device is used, and failing that whichever device is currently active. | string | No | — | — | — |
context_uri Album, artist or playlist URI to start playing. Only used by the 'play' action, and not together with 'uris'. | string | No | — | — | spotify:album:1Je1IMUlBXcx1Fz0WE7oPT |
uris Track URIs to play instead of a context. Only used by the 'play' action, and not together with 'context_uri'. | array | No | — | array of string | ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh"] |
position_ms How far into the first item to start, in milliseconds. Only used by the 'play' action. | number | No | — | ≥ 0 | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"action": "play",
"context_uri": "spotify:album:1Je1IMUlBXcx1Fz0WE7oPT",
"uris": [
"spotify:track:4iV5W9uYEdYUVa79Axb7Rh"
]
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
ok True when Spotify accepted the command; it answers 204 with no body. | boolean | — |
action The action that was sent, echoed back. | string | — |
device_id The device the command targeted, or null for the active one. | string | — |
{
"action": "",
"device_id": "",
"ok": false
}See Control Playback 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.