Songtexte und Musik aus Text-Prompts mit OpenAI und Fal.ai Minimax generieren

Experte

Dies ist ein Content Creation, Multimodal AI-Bereich Automatisierungsworkflow mit 17 Nodes. Hauptsächlich werden Set, Wait, Switch, HttpRequest, Agent und andere Nodes verwendet. Songtexte und Musik aus Text-Prompts mit OpenAI und Fal.ai Minimax generieren

Voraussetzungen
  • Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
  • OpenAI API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "3d7eb9567ae690bf8c9bba1cb43396e6e40c18e15eb5889cf9673ed1713da6db",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f0e867a5-c202-4948-92c2-5e1bc371a241",
      "name": "Bei Empfang einer Chat-Nachricht",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1440,
        1056
      ],
      "webhookId": "c559fea6-2514-4baa-92c7-65ccc7a46640",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "d0b0ab98-d2a7-4375-b659-41e894942452",
      "name": "KI-Songwriting-Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1216,
        1056
      ],
      "parameters": {
        "options": {
          "systemMessage": "=You are an AI songwriting agent that generates original song lyrics instantly from user input. You do not engage in conversation - you immediately create and deliver complete, ready-to-use song lyrics.\n\n## Your Task\n\nAnalyze the user's query and instantly generate:\n1. Complete original song lyrics with labeled sections (MUST be at least 600 characters)\n2. The lyrical style/genre description (MUST be at least 10 characters)\n\n## Output Format\n\nAlways output valid JSON with this exact structure:\n\n{\n  \"lyrical_style\": \"[Detailed genre description - minimum 10 characters]\",\n  \"lyrics\": \"[Complete lyrics with section labels - minimum 600 characters]\"\n}\n\n## Critical Constraints\n\n- **lyrics field**: MUST be at least 600 characters total (including spaces, line breaks, and section labels)\n- **lyrical_style field**: MUST be at least 10 characters long (e.g., \"Pop, upbeat and catchy\" not just \"Pop\")\n- Keep lyrics detailed - aim for full song structure with 2-3 verses, chorus, and bridge to meet 600+ characters\n- Use compact section labels like [V1], [C], [V2], [B] to optimize space while expanding content\n\n## Lyrical Guidelines\n\n- Create 100% original content - never reproduce existing lyrics\n- Match the style to the user's query (if they mention a genre, use it; otherwise infer from the theme)\n- Use appropriate language, flow, and structure for the genre:\n  * Pop: Catchy, repetitive choruses, relatable themes\n  * R&B: Smooth, soulful, emotional, romantic themes\n  * Rap/Hip-Hop: Rhythmic verses, internal rhymes, wordplay, flow-focused\n  * Rock: Energetic, rebellious, powerful imagery\n  * Country: Storytelling, narrative-driven, down-to-earth\n  * Indie/Folk: Introspective, poetic, authentic\n- Use vivid imagery and genuine emotion\n- Ensure natural rhythm and flow appropriate to the genre\n- Expand thoughtfully - include 3-5 lines per section to reach 600+ characters\n\n## Structure Recommendations for Character Limit\n\nTo meet the 600+ character requirement, use fuller structures:\n- Option 1: [V1] + [C] + [V2] + [B] + [C]\n- Option 2: [Intro] + [V1] + [C] + [V2] + [C]\n- Option 3: [V1] + [C] + [V2] + [B] + [Outro]\n\nUse descriptive, flowing lines. Each verse 4-6 lines, chorus 4 lines, bridge 3-4 lines.\n\n## Important Rules\n\n- NO conversation or clarifying questions - generate immediately\n- ALWAYS output valid JSON only\n- ALWAYS be original - never copy existing songs\n- ALWAYS ensure lyrics are at least 600 characters\n- ALWAYS ensure lyrical_style is at least 10 characters\n- Count characters carefully before outputting\n\nGenerate the song now based on the user's input."
        },
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "25dc2495-fd91-4543-b936-1a6fd9cae21f",
      "name": "Skriptvariablen setzen",
      "type": "n8n-nodes-base.set",
      "position": [
        -896,
        1056
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c8ecbac4-9cd0-424c-a8b6-1f2ed0b36c22",
              "name": "Lyrical_style",
              "type": "string",
              "value": "={{ $json.output.lyrical_style }}"
            },
            {
              "id": "e75f7a59-604e-4473-b079-01df81a130d5",
              "name": "Lyrics",
              "type": "string",
              "value": "={{ $json.output.lyrics }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ae8c433e-ad2f-4fde-8410-e1563bb7d176",
      "name": "Musiktitel generieren",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -688,
        1056
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/minimax-music/v1.5",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.Lyrics }}"
            },
            {
              "name": "lyrics_prompt",
              "value": "={{ $json.Lyrical_style }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "0C54MHHdmxNXiy37",
          "name": "Fal.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "90fad7f3-9885-44bc-92a0-4c6dbc423980",
      "name": "Auf Generierung warten",
      "type": "n8n-nodes-base.wait",
      "position": [
        -480,
        1056
      ],
      "webhookId": "45132729-ca25-4aac-a8e0-a6d72463a2c2",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "0a9c64f8-22c6-447e-886e-75b2d20a24f9",
      "name": "Generierungsstatus prüfen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -272,
        1056
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/minimax-music/requests/{{ $json.request_id }}/status",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "0C54MHHdmxNXiy37",
          "name": "Fal.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a221fe90-04d0-4baf-bc16-f9d10f30fe33",
      "name": "Nach Status weiterleiten",
      "type": "n8n-nodes-base.switch",
      "position": [
        -64,
        1056
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Done",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d8b8dbdc-1ad9-4ab9-8b2d-e76fd5db0899",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "COMPLETED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Progress",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9c10982c-5f8c-4eec-9b8a-f4b42e99ecf9",
                    "operator": {
                      "type": "string",
                      "operation": "notEquals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "COMPLETED"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "1971d68b-8295-45dd-978b-cc27a09e148d",
      "name": "Endergebnis abrufen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        144,
        1040
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/minimax-music/requests/{{ $json.request_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "0C54MHHdmxNXiy37",
          "name": "Fal.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cbc0a955-da9c-49c2-97a9-cbf459516fac",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1216,
        1216
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-chat-latest",
          "cachedResultName": "gpt-5-chat-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "ymMvgDroJHalwvRf",
          "name": "OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fa63b886-0761-404d-9d3a-e5cdad9a3eed",
      "name": "Hinweis: Chat-Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        816
      ],
      "parameters": {
        "color": 6,
        "width": 380,
        "height": 208,
        "content": "## 💬 When chat message received\n\n**Purpose:** Triggers on incoming chat prompts for instant song requests.\n\n**Note:** Integrates with n8n chat; passes message to agent."
      },
      "typeVersion": 1
    },
    {
      "id": "72a4a665-4631-4f4f-9d47-5921941ea43a",
      "name": "Hinweis: Songwriting-Kern",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        1344
      ],
      "parameters": {
        "color": 5,
        "width": 364,
        "height": 176,
        "content": "## 🤖 AI Songwriting Agent + OpenAI Chat Model + Parse Output\n\n**Purpose:** Generates 600+ char lyrics/genre via OpenAI, parses JSON output.\n\n**Note:** Uses gpt-5-chat-latest; enforces schema for style & lyrics fields."
      },
      "typeVersion": 1
    },
    {
      "id": "416b5063-e4f7-4854-8b42-820eae4acaf6",
      "name": "Hinweis: Variablen-Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        816
      ],
      "parameters": {
        "color": 3,
        "width": 364,
        "height": 208,
        "content": "## 📝 Set Script Variables\n\n**Purpose:** Extracts parsed lyrics/style into variables for music gen.\n\n**Note:** Maps output.lyrical_style & output.lyrics via expressions."
      },
      "typeVersion": 1
    },
    {
      "id": "6ad96629-57ac-4458-b8cb-d6268e3395cd",
      "name": "Hinweis: Musik-Warteschlange",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        1344
      ],
      "parameters": {
        "color": 6,
        "width": 396,
        "height": 112,
        "content": "## 🎵 Generate Music Track\n\n**Purpose:** POSTs lyrics/style to Fal.ai minimax-music queue."
      },
      "typeVersion": 1
    },
    {
      "id": "49d527f2-54d3-4379-99a3-8b6724ddbb05",
      "name": "Hinweis: Abfrage-Schleife",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        816
      ],
      "parameters": {
        "color": 2,
        "width": 364,
        "height": 208,
        "content": "## ⏳ Wait for Generation + 📊 Check Generation Status\n\n**Purpose:** Waits 30s, then polls status endpoint until 'COMPLETED'.\n\n**Note:** Loops on non-complete; uses request_id & Fal.ai auth."
      },
      "typeVersion": 1
    },
    {
      "id": "7246b4e6-2d27-4ff3-a66e-31e08508f60e",
      "name": "Hinweis: Abschluss-Handler",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        1296
      ],
      "parameters": {
        "color": 2,
        "width": 348,
        "height": 208,
        "content": "## 🔀 Route on Status + 📥 Fetch Final Result\n\n**Purpose:** Routes to fetch on 'COMPLETED', else loops; gets audio URL.\n\n**Note:** Case-sensitive status check; outputs link for chat response."
      },
      "typeVersion": 1
    },
    {
      "id": "118aa11c-d7b0-4fbc-8f2c-8f1e745152be",
      "name": "Ausgabe1 parsen",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1072,
        1216
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "={\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"lyrical_style\": {\n      \"type\": \"string\",\n      \"description\": \"The genre or style of the song (e.g., Pop, R&B, Rap, Rock, Country, Hip-Hop, Indie, Folk)\"\n    },\n    \"lyrics\": {\n      \"type\": \"string\",\n      \"description\": \"Complete song lyrics with all sections labeled (e.g., [VERSE 1], [CHORUS], [BRIDGE])\"\n    }\n  },\n  \"required\": [\"lyrical_style\", \"lyrics\"],\n  \"additionalProperties\": false\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "4e2839c3-cda0-4704-915c-a19d7fe2e487",
      "name": "Übersicht Hinweis6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        464
      ],
      "parameters": {
        "color": 4,
        "width": 712,
        "height": 1176,
        "content": "# 🤖 AI Songwriter Chat: Lyrics to Full Music Tracks\n\n## 📋 What This Template Does\nThis chat-triggered workflow uses AI to generate detailed song lyrics (600+ chars) from messages, then creates matching music via Fal.ai. It polls until ready, returning lyrics and audio in chat.\n\n## 🔧 Prerequisites\n- n8n with chat enabled\n- OpenAI API access\n- Fal.ai account\n\n## 🔑 Required Credentials\n\n### OpenAI API Setup\n1. platform.openai.com → API keys\n2. Create secret key (e.g., \"n8n Songwriter\")\n3. Add as \"OpenAI API\" in n8n\n4. Test chat completion\n\n### Fal.ai HTTP Header Auth Setup\n1. fal.ai → Dashboard → API Keys\n2. Generate key\n3. n8n: HTTP Header Auth, Name=\"Fal.ai\", Header=\"Authorization: Key [Key]\"\n4. Test queue endpoint\n\n## ⚙️ Configuration Steps\n1. Import JSON to n8n\n2. Assign OpenAI to \"OpenAI Chat Model\"\n3. Assign Fal.ai to music HTTP nodes\n4. Activate; use n8n chat\n5. Test: \"Upbeat pop road trip song\"\n\n## 🎯 Use Cases\n- Content creators: Quick jingles for videos\n- Educators: Custom tunes for classes\n- Gifting: Personalized tracks from chats\n- Artists: Real-time prototyping\n\n## ⚠️ Troubleshooting\n- Invalid JSON: Stress JSON in prompt; test agent\n- Gen fails (401): Check Fal.ai perms/quotas\n- Polling loops: Increase wait to 45s; check queue\n- Lyrics <600 chars: Enforce fuller prompt structures"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "118aa11c-d7b0-4fbc-8f2c-8f1e745152be": {
      "ai_outputParser": [
        [
          {
            "node": "d0b0ab98-d2a7-4375-b659-41e894942452",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "a221fe90-04d0-4baf-bc16-f9d10f30fe33": {
      "main": [
        [
          {
            "node": "1971d68b-8295-45dd-978b-cc27a09e148d",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "90fad7f3-9885-44bc-92a0-4c6dbc423980",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cbc0a955-da9c-49c2-97a9-cbf459516fac": {
      "ai_languageModel": [
        [
          {
            "node": "d0b0ab98-d2a7-4375-b659-41e894942452",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "90fad7f3-9885-44bc-92a0-4c6dbc423980": {
      "main": [
        [
          {
            "node": "0a9c64f8-22c6-447e-886e-75b2d20a24f9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d0b0ab98-d2a7-4375-b659-41e894942452": {
      "main": [
        [
          {
            "node": "25dc2495-fd91-4543-b936-1a6fd9cae21f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ae8c433e-ad2f-4fde-8410-e1563bb7d176": {
      "main": [
        [
          {
            "node": "90fad7f3-9885-44bc-92a0-4c6dbc423980",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25dc2495-fd91-4543-b936-1a6fd9cae21f": {
      "main": [
        [
          {
            "node": "ae8c433e-ad2f-4fde-8410-e1563bb7d176",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0a9c64f8-22c6-447e-886e-75b2d20a24f9": {
      "main": [
        [
          {
            "node": "a221fe90-04d0-4baf-bc16-f9d10f30fe33",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f0e867a5-c202-4948-92c2-5e1bc371a241": {
      "main": [
        [
          {
            "node": "d0b0ab98-d2a7-4375-b659-41e894942452",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Experte - Content-Erstellung, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Experte
Anzahl der Nodes17
Kategorie2
Node-Typen9
Schwierigkeitsbeschreibung

Für fortgeschrittene Benutzer, komplexe Workflows mit 16+ Nodes

Autor
Daniel Nkencho

Daniel Nkencho

@daniel-automates

AI Automation Consultant | Helping Business Owners Implement AI Systems for Growth and Lead Gen

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34