8
n8n 中文网amn8n.com

基于 AI、星座和天气的个性化台湾独立音乐推荐(通过 Spotify)

中级

这是一个Other, AI领域的自动化工作流,包含 11 个节点。主要使用 Set, Spotify, ManualTrigger, OpenAi, LmChatOpenAi 等节点,结合人工智能技术实现智能自动化。 通过 Spotify 基于 AI、星座和天气的个性化台湾独立音乐推荐

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "8a7a06ca46c827816b3e42e41915716d3e80066bf90dbab3499b52324462ffc1",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "820139f5-5e9f-49d4-80a4-0ddec7d5bf80",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        60,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "992416bc-1363-4741-9550-405167851afe",
      "name": "获取歌曲推荐",
      "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": {
          "id": "iRzJ9c2X4H9EkpGi",
          "name": "tkicorp n8n API with $10"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "42d7fd05-73a7-4722-86fc-8b6751e0723e",
      "name": "信息提取器",
      "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\": \"台北\",\n    \"weather\":\"台北今天的天氣預報顯示,局部地區有雷雨,最高氣溫32°C,最低氣溫24°C\",\n    \"star sign\": \"雙子座\",\n    \"fortune\":\"雙子座的每日星座運勢顯示,今天適合尋求隱私和放鬆,並與自己連結。\",\n     \"song\":\"小步舞曲\",\n     \"artist\":\"陳綺貞\",\n    \"additional infomation\":\"這首歌旋律輕快,歌詞富有詩意,能夠帶給您放鬆和愉悅的感覺,適合在陰雨天氣中享受。這首歌的亮點在於其簡單卻深刻的歌詞,表達了對生活的熱愛和對美好事物的追求,與雙子座今天的星座運勢相呼應。\"\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "e98aaaa7-ab70-4f98-9f5a-41543764e374",
      "name": "OpenAI 聊天模型",
      "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": {
          "id": "iRzJ9c2X4H9EkpGi",
          "name": "tkicorp n8n API with $10"
        }
      },
      "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": {
          "id": "vZolsMovUBZO8qIi",
          "name": "Spotify account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d63753e2-9770-4fc5-8490-c72c867102e2",
      "name": "最终输出",
      "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": "信息",
      "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": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -400
      ],
      "parameters": {
        "width": 520,
        "height": 700,
        "content": "## 台湾独立音乐推荐模板 by [n8nguide](https://www.threads.com/@n8nguide.tw)"
      },
      "typeVersion": 1
    },
    {
      "id": "0abc9d2d-fa36-4c6b-b60c-e4aafd97b9a8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        180
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 120,
        "content": "### - 更改您的位置"
      },
      "typeVersion": 1
    },
    {
      "id": "d4ebe393-2903-4675-bd17-872b3b578f52",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        180
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 80,
        "content": "### 更新凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "d89a1990-2986-4a0c-88a3-43b439d6fbed",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 180,
        "height": 80,
        "content": "此节点整理事务。可从其他工作流自由调用。"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "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 ‘Test workflow’": {
      "main": [
        [
          {
            "node": "infomation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 其他, 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量11
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流