This workflow creates an AI-powered chatbot that generates custom songs through an interactive conversation, then uploads the results to Google Drive.
This workflow transforms n8n into a complete AI music production pipeline by combining:
It demonstrates a powerful hybrid architecture:
LLM Agent + Tools + API + Storage + Async Control Flow
From idea → to lyrics → to full generated track → to cloud storage
All handled automatically.
Users don’t need technical knowledge.
The AI collects missing information step-by-step.
The agent dynamically chooses:
This makes the system adaptive and intelligent.
Reduces failure rate dramatically.
Scalable and production-ready.
The architecture allows:
Uses buffer memory (last 10 messages)
Maintains conversational context and continuity.
Generated songs are:
No manual file handling required.
Here's the flow:
User Interaction: The workflow starts with a chat trigger that receives user messages. A "Music Producer Agent" powered by Google Gemini engages with the user conversationally to gather all necessary song parameters.
Data Collection: The agent collects four essential pieces of information:
Validation & Formatting: The collected data passes through an IF condition checking for valid JSON format, then a Code node parses and cleans the JSON output. A "Fix Json Structure" node ensures proper formatting with strict rules (no line breaks, no double quotes).
Song Generation: The formatted data is sent to the Kie.ai API (HTTP Request node) which generates the actual music track. The workflow includes a callback URL for asynchronous processing.
Wait & Retrieve: A Wait node pauses execution until the Kie.ai API sends a webhook callback with the generated songs. The "Get songs" node then retrieves the song data.
Process Results: The response is split out, and a Loop Over Items node processes each generated song individually. For each song, the workflow:
API Credentials (3 required):
Google Drive Configuration:
Webhook Setup:
Optional Customizations:
Testing: Activate the workflow and start a chat session to test song generation with sample requests like "Write a pop song about summer" or "Find lyrics for 'Bohemian Rhapsody' and make it in rock style"
👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n.
Contact me for consulting and support or add me on Linkedin.