{
  "name": "Download Spotify music to Google Drive with automatic logging in sheets",
  "nodes": [
    {
      "id": "8b589726-cc0e-47e1-8ada-b098d551787c",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -200,
        0
      ]
    },
    {
      "id": "fe66d327-610b-4c07-955b-4f6a922f14a0",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        -20
      ]
    },
    {
      "id": "a519e85f-dfa5-436d-833e-31d5ed3cb6f1",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -20,
        0
      ]
    },
    {
      "id": "f24f1513-b5ab-4c6a-8f57-2d2a1bb03954",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        500,
        20
      ]
    },
    {
      "id": "429a1eb2-ddee-4d3d-85c4-b755c999febe",
      "name": "Download music",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        840,
        -400
      ]
    },
    {
      "id": "062222fa-77d3-493b-8f4b-de96590c3c95",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1120,
        -420
      ]
    },
    {
      "id": "1d754442-11ec-4e30-95ff-01b53491f877",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2500,
        0
      ]
    },
    {
      "id": "3b745c8b-bbfa-4302-a93f-6ea24d7915da",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1800,
        -320
      ]
    },
    {
      "id": "e148bc42-ecb2-44af-b8f4-4b713f4b427c",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1440,
        200
      ]
    },
    {
      "id": "6885550a-a1e5-46cf-835e-aad57c3a051a",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1000,
        240
      ]
    },
    {
      "id": "910f0b8d-7e3a-4dd3-932e-453ba5d487d7",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        2240,
        -320
      ]
    },
    {
      "id": "c4302364-9c96-4f6c-b4ca-85083012a0e8",
      "name": "Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1460,
        -500
      ]
    },
    {
      "id": "a622eaef-5494-4294-8a2d-90f6ace4673d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        -300
      ],
      "parameters": {
        "width": 560,
        "height": 1020,
        "content": "# Spotify Music Downloader Flow\n\n**Description**:  \nThis workflow allows users to download music from Spotify by pasting a track URL, and then saves the file to Google Drive, logging the details in a "
      }
    },
    {
      "id": "a6c8f56d-3cd2-4b8e-85d7-98f6d02275ce",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "**On form submission**:  \n   - **Description**: This node is triggered when a user submits a Spotify track URL via a form.  \n   - **Purpose**: Collects the URL input from the user to start the process"
      }
    },
    {
      "id": "708465a5-c968-459d-844b-27b1c05f39dd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": " **If (Link check)**:  \n   - **Description**: Validates that a valid Spotify track URL is provided in the form submission.  \n   - **Purpose**: Ensures that the form input is not empty and contains a v"
      }
    },
    {
      "id": "43722f14-157e-4ba4-8d18-26681a8eaa6f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "**HTTP Request**:  \n   - **Description**: Sends a request to the Spotify downloader API to retrieve the music file.  \n   - **Purpose**: Fetches the music file download link using the provided Spotify "
      }
    },
    {
      "id": "a2344ebe-f7bf-4a88-8295-1ff777c25d09",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "**If1 (Success check)**:  \n   - **Description**: Verifies whether the HTTP request for downloading the music was successful.  \n   - **Purpose**: Ensures that the API response was positive (successful "
      }
    },
    {
      "id": "f2ab9746-ce9c-416b-a0c8-9be6378ce288",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -560
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": " **Download music**:  \n   - **Description**: Downloads the music file from the provided Spotify URL.  \n   - **Purpose**: Initiates the actual download of the track to be stored on Google Drive."
      }
    },
    {
      "id": "697e5b8c-887b-4c6d-9c25-4a59f56a663a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        -600
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "**Google Drive**:  \n   - **Description**: Uploads the downloaded music file to Google Drive for storage.  \n   - **Purpose**: Saves the music file in Google Drive, making it available for future access"
      }
    },
    {
      "id": "2a4e9899-d4f4-475a-a36b-9bc45f2ee5ff",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        20
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "**Wait**:  \n   - **Description**: Introduces a delay between processes.  \n   - **Purpose**: Ensures that there is enough time for the music file to upload to Google Drive before proceeding with loggin"
      }
    },
    {
      "id": "56642ab2-bdbb-457c-beaf-115677a39e2a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        -720
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "7. **Google Sheets**:  \n   - **Description**: Logs the success details, such as the download link, file size, and timestamp to a Google Sheet.  \n   - **Purpose**: Creates a record of the download, mak"
      }
    },
    {
      "id": "3a0fa583-5bc3-4e7e-8cdd-8735cced94ab",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        -600
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "**Code**:  \n   - **Description**: Calculates the file size of the downloaded music in MB.  \n   - **Purpose**: Converts the file size from bytes to MB and formats the output data."
      }
    },
    {
      "id": "d2b90077-85eb-4989-866a-035c96794925",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2440,
        -260
      ],
      "parameters": {
        "width": null,
        "height": 380,
        "content": "**Google Sheets1**:  \n    - **Description**: Logs successful information, such as the URL and download link, to the primary Google Sheet.  \n    - **Purpose**: Records the successful download details ("
      }
    },
    {
      "id": "9f3a15c7-1577-4a55-959c-52a00e6640e6",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        -560
      ],
      "parameters": {
        "width": null,
        "height": 380,
        "content": "**Wait1**:  \n    - **Description**: Another wait node, used to introduce additional delays as needed in the flow.  \n    - **Purpose**: Similar to the previous \"Wait\" node, this node helps manage timin"
      }
    },
    {
      "id": "859207a9-1ae6-442b-86a2-c0e931d00482",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -20
      ],
      "parameters": {
        "width": 260,
        "height": 380,
        "content": "**Google Sheets2**:  \n    - **Description**: Logs the failed downloads (if any) to the secondary Google Sheet, with status \"failed.\"  \n    - **Purpose**: Creates a record in a separate Google Sheet fo"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Download music",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download music": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}