Skip to content

Pipeline File Format

Pipelines can be defined in YAML or JSON format. This page documents the structure and available options.

name: My Pipeline
tasks:
- type: taskType
# task-specific options
- type: anotherTask
# task-specific options
FieldTypeRequiredDescription
namestringYesName of the pipeline
tasksarrayYesList of tasks to execute in order

Fetch tracks from a Spotify playlist.

- type: getPlaylistTracks
playlistId: "37i9dQZF1DXcBWIGoYBM5M"
OptionTypeRequiredDescription
playlistIdstringYesSpotify playlist ID or URI

Fetch the user’s liked/saved tracks.

- type: getSavedTracks

No options required.

Fetch tracks from an album.

- type: getAlbumTracks
albumId: "4aawyAB9vmqN3uQ7FjRGTy"
OptionTypeRequiredDescription
albumIdstringYesSpotify album ID or URI

Fetch an artist’s top tracks.

- type: getArtistTopTracks
artistId: "0OdUWJ0sBjDrqHygGUXeCF"
OptionTypeRequiredDescription
artistIdstringYesSpotify artist ID or URI

Filter tracks by criteria.

- type: filterTracks
field: releaseDate
operator: after
value: "2024-01-01"
OptionTypeRequiredDescription
fieldstringYesField to filter on
operatorstringYesComparison operator
valuestringYesValue to compare against

Fields: name, artist, album, releaseDate, popularity, duration, explicit

Operators: equals, contains, startsWith, endsWith, after, before, greaterThan, lessThan

Sort tracks by a field.

- type: sortTracks
field: popularity
order: descending
OptionTypeRequiredDescription
fieldstringYesField to sort by
orderstringNoascending (default) or descending

Randomize track order.

- type: shuffleTracks

No options required.

Reverse the track order.

- type: reverseTracks

No options required.

Remove duplicate tracks.

- type: deduplicateTracks
strategy: byTrackId
OptionTypeRequiredDescription
strategystringNobyTrackId (default) or byNameAndArtist

Keep only the first N tracks.

- type: limitTracks
limit: 50
OptionTypeRequiredDescription
limitnumberYesMaximum number of tracks to keep

Skip the first N tracks.

- type: skipTracks
count: 10
OptionTypeRequiredDescription
countnumberYesNumber of tracks to skip

Combine tracks from multiple sources. Place this after multiple source tasks.

- type: mergeTracks

No options required.

Save tracks to a Spotify playlist.

- type: saveToPlaylist
playlistId: "your-playlist-id"
mode: replace

Or create a new playlist:

- type: saveToPlaylist
name: "My New Playlist"
mode: replace
OptionTypeRequiredDescription
playlistIdstringNo*Existing playlist ID
namestringNo*Name for new playlist
modestringNoreplace (default) or append

*Either playlistId or name is required.

name: Weekly Top 50
tasks:
# Get tracks from multiple sources
- type: getPlaylistTracks
playlistId: "37i9dQZEVXcQ9COmYvdajy"
- type: getSavedTracks
# Combine and process
- type: mergeTracks
- type: deduplicateTracks
strategy: byNameAndArtist
- type: filterTracks
field: releaseDate
operator: after
value: "2024-01-01"
- type: sortTracks
field: popularity
order: descending
- type: limitTracks
limit: 50
# Save result
- type: saveToPlaylist
name: "My Weekly Top 50"
mode: replace

The same pipeline in JSON:

{
"name": "Weekly Top 50",
"tasks": [
{ "type": "getPlaylistTracks", "playlistId": "37i9dQZEVXcQ9COmYvdajy" },
{ "type": "getSavedTracks" },
{ "type": "mergeTracks" },
{ "type": "deduplicateTracks", "strategy": "byNameAndArtist" },
{ "type": "filterTracks", "field": "releaseDate", "operator": "after", "value": "2024-01-01" },
{ "type": "sortTracks", "field": "popularity", "order": "descending" },
{ "type": "limitTracks", "limit": 50 },
{ "type": "saveToPlaylist", "name": "My Weekly Top 50", "mode": "replace" }
]
}