{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "820139f5-5e9f-49d4-80a4-0ddec7d5bf80",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        60,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "992416bc-1363-4741-9550-405167851afe",
      "name": "get song recommendation",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        440,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini-search-preview",
          "cachedResultName": "GPT-4O-MINI-SEARCH-PREVIEW"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=you are an expert of taiwan indie music. you are good at discover good, unique music for people.\nuser will give you his city, mood, and birhday. \nyou need to give them a music you recommend, considering today's weather and star sign.\n\nstep 1. find out the today weather in that city.\nstep 2. find out user start sign\nstep 3. lookup for the fortune of that start sign\nstep 4. take the weather and fortune into consideration, and than give user a taiwan indie music recommendation\nstep 5. explain why you pick this song\nstep 6. (optional) explain the highlight of this song if you can find the information.\n\nReply Language: {{ $json['Reply Language'] }}"
            },
            {
              "content": "=city:  {{ $json.City }}\nbirthday: {{ $json.birthday }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "42d7fd05-73a7-4722-86fc-8b6751e0723e",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        760,
        0
      ],
      "parameters": {
        "text": "={{ $json.message.content }}",
        "options": {},
        "schemaType": "fromJson",
        "jsonSchemaExample": "{\n\t\"todays date\": \"2026/05/20\",\n\t\"city\": \"\u53f0\u5317\",\n    \"weather\":\"\u53f0\u5317\u4eca\u5929\u7684\u5929\u6c23\u9810\u5831\u986f\u793a\uff0c\u5c40\u90e8\u5730\u5340\u6709\u96f7\u96e8\uff0c\u6700\u9ad8\u6c23\u6eab32\u00b0C\uff0c\u6700\u4f4e\u6c23\u6eab24\u00b0C\",\n    \"star sign\": \"\u96d9\u5b50\u5ea7\",\n    \"fortune\":\"\u96d9\u5b50\u5ea7\u7684\u6bcf\u65e5\u661f\u5ea7\u904b\u52e2\u986f\u793a\uff0c\u4eca\u5929\u9069\u5408\u5c0b\u6c42\u96b1\u79c1\u548c\u653e\u9b06\uff0c\u4e26\u8207\u81ea\u5df1\u9023\u7d50\u3002\",\n     \"song\":\"\u5c0f\u6b65\u821e\u66f2\",\n     \"artist\":\"\u9673\u7dba\u8c9e\",\n    \"additional infomation\":\"\u9019\u9996\u6b4c\u65cb\u5f8b\u8f15\u5feb\uff0c\u6b4c\u8a5e\u5bcc\u6709\u8a69\u610f\uff0c\u80fd\u5920\u5e36\u7d66\u60a8\u653e\u9b06\u548c\u6109\u6085\u7684\u611f\u89ba\uff0c\u9069\u5408\u5728\u9670\u96e8\u5929\u6c23\u4e2d\u4eab\u53d7\u3002\u9019\u9996\u6b4c\u7684\u4eae\u9ede\u5728\u65bc\u5176\u7c21\u55ae\u537b\u6df1\u523b\u7684\u6b4c\u8a5e\uff0c\u8868\u9054\u4e86\u5c0d\u751f\u6d3b\u7684\u71b1\u611b\u548c\u5c0d\u7f8e\u597d\u4e8b\u7269\u7684\u8ffd\u6c42\uff0c\u8207\u96d9\u5b50\u5ea7\u4eca\u5929\u7684\u661f\u5ea7\u904b\u52e2\u76f8\u547c\u61c9\u3002\"\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "e98aaaa7-ab70-4f98-9f5a-41543764e374",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        760,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c9b818c1-cc73-45d1-9abd-cc21b776f984",
      "name": "Spotify",
      "type": "n8n-nodes-base.spotify",
      "position": [
        1080,
        0
      ],
      "parameters": {
        "limit": 1,
        "query": "={{ $json.output.artist }} {{ $json.output.song }}",
        "filters": {},
        "resource": "track",
        "operation": "search"
      },
      "credentials": {
        "spotifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d63753e2-9770-4fc5-8490-c72c867102e2",
      "name": "Final Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "eefdd65c-cbdc-44f0-801b-a783b4f57a9c",
              "name": "output['todays date']",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output['todays date'] }}"
            },
            {
              "id": "c53441d9-712a-4b28-9039-27a874e02d25",
              "name": "output.city",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output.city }}"
            },
            {
              "id": "26a3c75a-2cbe-425e-9c7b-e41f6f226326",
              "name": "output.weather",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output.weather }}"
            },
            {
              "id": "0cffafdd-6736-450b-bd43-091a19ad0533",
              "name": "output['star sign']",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output['star sign'] }}"
            },
            {
              "id": "763fa9ab-542c-4402-82d0-2cdf4df1e6e8",
              "name": "output.fortune",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output.fortune }}"
            },
            {
              "id": "2ec0a6d0-aed4-4253-91a7-b0b15a99cc2c",
              "name": "output.artist",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output.artist }}"
            },
            {
              "id": "02683d4c-6087-422d-a762-790b839cc822",
              "name": "output.song",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output.song }}"
            },
            {
              "id": "c06c349e-76f9-4098-be24-b6151bc6e833",
              "name": "output.songlink",
              "type": "string",
              "value": "={{ $json.external_urls.spotify }}"
            },
            {
              "id": "1a764f2b-71ea-4e59-a17a-4075eb5b44f5",
              "name": "output['additional infomation']",
              "type": "string",
              "value": "={{ $('Information Extractor').item.json.output['additional infomation'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d81c4f81-afdc-4dcd-8a28-99bbbb89d810",
      "name": "infomation",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "863d34aa-4af7-4a03-976d-5c36e63facad",
              "name": "City",
              "type": "string",
              "value": "Taipei"
            },
            {
              "id": "d1ea866c-5882-4a8e-b7cb-d2bfd491bc72",
              "name": "Mood",
              "type": "string",
              "value": "Happy"
            },
            {
              "id": "aacdcef2-d8aa-4f70-b0a3-d50ffa786334",
              "name": "birthday",
              "type": "string",
              "value": "1996/11/21"
            },
            {
              "id": "eae8dadb-b6be-42b2-ad40-1d91b8cb462b",
              "name": "Reply Language",
              "type": "string",
              "value": "zh-tw"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "391cf2d2-8cd6-40e1-a18f-63dcb9dec86b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -400
      ],
      "parameters": {
        "width": 520,
        "height": 700,
        "content": "## Taiwan Indie Music Recommend Template by [n8nguide](https://www.threads.com/@n8nguide.tw)\n\nThis n8n workflow recommends Taiwan indie music based on a user's city, mood, birthday, today's weather, and zodiac sign. Here's a concise overview:\n\n1. **Trigger**: Starts manually with the \"When clicking \u2018Test workflow\u2019\" node.\n2. **Input Setup**: The \"infomation\" node sets user inputs (e.g., city: Taipei, mood: Happy, birthday: 1996/11/21).\n3. **Song Recommendation**: The \"get song recommendation\" node uses OpenAI's GPT-4o-mini to:\n   - Fetch today's weather for the specified city.\n   - Determine the user's zodiac sign from their birthday.\n   - Check the zodiac sign's daily fortune.\n   - Recommend a Taiwan indie song considering weather and fortune.\n   - Explain the song choice and highlight its features.\n   - Return results in JSON format.\n4. **Data Extraction**: The \"Information Extractor\" node parses the JSON output, extracting fields like date, city, weather, zodiac sign, fortune, song, artist, and additional info.\n5. **Spotify Search**: The \"Spotify\" node searches for the recommended song using the artist and song name, retrieving a Spotify URL.\n6. **Final Output**: The \"Final Output\" node compiles all data, including the Spotify link, into a structured format.\n7. **Additional Note**: A \"Sticky Note\" provides context about the workflow's purpose and credits the creator, n8nguide.\n\nThis workflow integrates AI, weather data, astrology, and Spotify to deliver personalized Taiwan indie music recommendations."
      },
      "typeVersion": 1
    },
    {
      "id": "0abc9d2d-fa36-4c6b-b60c-e4aafd97b9a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        180
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 120,
        "content": "### - Change your location\n### - Change Your Birthday\n### - Change Your prefer output language"
      },
      "typeVersion": 1
    },
    {
      "id": "d4ebe393-2903-4675-bd17-872b3b578f52",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        180
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 80,
        "content": "### update credential"
      },
      "typeVersion": 1
    },
    {
      "id": "d89a1990-2986-4a0c-88a3-43b439d6fbed",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 180,
        "height": 80,
        "content": "this node tidy up things. feel free to call from other workflow."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Spotify": {
      "main": [
        [
          {
            "node": "Final Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "infomation": {
      "main": [
        [
          {
            "node": "get song recommendation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Final Output": {
      "main": [
        []
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Spotify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get song recommendation": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "infomation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}