{
  "id": "ThUxnc7za8J4uyXG",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Setlist_Manager",
  "tags": [],
  "nodes": [
    {
      "id": "15388ff0-3350-44ba-b254-f4960aa4650f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -360
      ],
      "parameters": {
        "width": 680,
        "height": 340,
        "content": "## Setlist Manager\nThis workflow takes a Google spreadsheet called 'Setlist_Manager' with 'Artist' and 'SongTitle' entries and get's Lyrics for each song and creates a playlist for that set of songs.\n\n1. Create Spotify Playlist (naming it 'Setlist - [date of today]')\n2. Create the Google doc that will store the lyrics found. (naming it 'Setlist - [date of today]')\n3. Get the rows of songs from 'Setlist_Manager'.\n4. Use AI to verify the Artist name and song title.\n5. Get the lyrics to the song.\n6. Append the Google Doc with the lyrics.\n7. Search for the song in Spotify.\n8. Add that song to the Spotify Playlist.\n9. Go to band practice and be prepared! =)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "18133032-9a20-4478-b9f4-c7f9ef801cdb",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -360,
        40
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0e891760-d994-4ccf-8f1d-2f74282c624e",
      "name": "get data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        300,
        40
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c8HGDizhcFSHwJKK7nuMNkRZgbdrphBmofQanD9a-js/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1c8HGDizhcFSHwJKK7nuMNkRZgbdrphBmofQanD9a-js",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c8HGDizhcFSHwJKK7nuMNkRZgbdrphBmofQanD9a-js/edit?usp=drivesdk",
          "cachedResultName": "Setlist_Manager"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f27df2b3-e77a-4fc2-9583-6bad3ce465de",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        520,
        40
      ],
      "parameters": {
        "text": "=You will be given an artist name and a song title. You'll need to verify the spelling and accuracy of the information. \n\nartist: {{ $json.Artist }}\nsongTitle: {{ $json.SongTitle }}",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "attributes": {
          "attributes": [
            {
              "name": "Artist",
              "required": true,
              "description": "The artist that wrote the song"
            },
            {
              "name": "SongTitle",
              "required": true,
              "description": "The name of the song"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "87b875af-e006-44c7-bd27-f3184d6c08ca",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        540,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8fc4de2e-9dd5-4c98-8e5e-bc629507516f",
      "name": "Get Lyrics",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        880,
        40
      ],
      "parameters": {
        "url": "=https://api.lyrics.ovh/v1/{{ $json.output.Artist }}/{{ $json.output.SongTitle }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "acb21e3e-fc53-43e9-ad4c-a05a4b1aada2",
      "name": "Populate Doc",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1080,
        40
      ],
      "parameters": {
        "actionsUi": {
          "actionFields": [
            {
              "text": "={{ $('Information Extractor').item.json.output.SongTitle }} - {{ $('Information Extractor').item.json.output.Artist }}\n\n{{ $('Get Lyrics').item.json.lyrics }}",
              "action": "insert"
            },
            {
              "action": "insert",
              "object": "pageBreak"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={{ $('Create Doc').item.json.id }}"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9232c124-b4a2-4445-93b4-3a07eba9c2bc",
      "name": "Search for Song",
      "type": "n8n-nodes-base.spotify",
      "position": [
        1280,
        40
      ],
      "parameters": {
        "limit": 1,
        "query": "={{ $('get data').item.json.Artist }} by {{ $('get data').item.json.SongTitle }}",
        "filters": {},
        "resource": "track",
        "operation": "search"
      },
      "credentials": {
        "spotifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "25c6b03b-a8c5-4fb4-9be4-acaba7a666a0",
      "name": "Add Song to Playlist",
      "type": "n8n-nodes-base.spotify",
      "position": [
        1480,
        40
      ],
      "parameters": {
        "id": "={{ $('Create Playlist').item.json.uri }}",
        "trackID": "={{ $('Search for Song').item.json.uri }}",
        "resource": "playlist",
        "additionalFields": {
          "position": 0
        }
      },
      "credentials": {
        "spotifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9ddf9bfe-4df3-40c2-87e2-3106a1042944",
      "name": "Create Playlist",
      "type": "n8n-nodes-base.spotify",
      "position": [
        -140,
        40
      ],
      "parameters": {
        "name": "=Setlist - {{ $now.format('yyyy-MM-dd') }}",
        "resource": "playlist",
        "operation": "create",
        "additionalFields": {}
      },
      "credentials": {
        "spotifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9dca5c93-7d87-4425-a2fe-b1a7629d169c",
      "name": "Create Doc",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        80,
        40
      ],
      "parameters": {
        "title": "=Setlist - {{ $now.format('yyyy-MM-dd') }}",
        "folderId": "1opzuazFfpdBRLzRas8bViF6TmO4VCW8V"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a0166877-d2f2-499a-9d8c-c8d0f80d7ce8",
  "connections": {
    "get data": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Doc": {
      "main": [
        [
          {
            "node": "get data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Lyrics": {
      "main": [
        [
          {
            "node": "Populate Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Populate Doc": {
      "main": [
        [
          {
            "node": "Search for Song",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Playlist": {
      "main": [
        [
          {
            "node": "Create Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for Song": {
      "main": [
        [
          {
            "node": "Add Song to Playlist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Add Song to Playlist": {
      "main": [
        []
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Get Lyrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Create Playlist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}