Music Producer Chatbot π΅π€ using Gemini + Suno (via Kei AI) & Google Drive Upload
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:
Conversational AI Structured data validation Tool orchestration External music generation API Cloud automation
It demonstrates a powerful hybrid architecture: LLM Agent + Tools + API + Storage + Async Control Flow
Key Advantages
- β Fully Automated AI Music Production
From idea β to lyrics β to full generated track β to cloud storage All handled automatically.
- β Conversational UX
Users donβt need technical knowledge. The AI collects missing information step-by-step.
- β Smart Tool Selection
The agent dynamically chooses:
Songwriter tool (for original lyrics) Search tool (for existing lyrics)
This makes the system adaptive and intelligent.
- β Structured & Error-Safe Design
Strict JSON schema enforcement Output parsing and validation Cleanup of malformed LLM responses
Reduces failure rate dramatically.
- β Asynchronous API Handling
Uses webhook-based resume Handles long-running AI generation Supports multiple song outputs
Scalable and production-ready.
- β Modular & Extensible
The architecture allows:
Switching LLM provider Changing music API Adding new tools (e.g., cover art generation) Supporting different vocal styles or languages
- β Memory-Enabled Conversations
Uses buffer memory (last 10 messages) Maintains conversational context and continuity.
- β Automatic File Management
Generated songs are:
Automatically downloaded Properly renamed Stored in Google Drive
No manual file handling required.
How it Works
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: Song title Musical style (genre) Lyrics (prompt) - either generated by calling the "Songwriter" tool or searched online via the "Search songs" tool Negative tags (styles/elements to avoid)
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: Downloads the audio file via HTTP request Uploads it to a specified Google Drive folder with a timestamped filename
Setup steps
API Credentials (3 required): Google Gemini (PaLM) API: Configure in the two Gemini Chat Model nodes Gemini Search API: Set up in the "Search songs" tool node Kie AI Bearer Token: Add in the HTTP Request nodes (Create song and Get songs)
Google Drive Configuration: Authenticate Google Drive OAuth2 in the "Upload song" node Verify/modify the folder ID if needed Ensure the Drive has proper write permissions
Webhook Setup: The Wait node has a webhook ID that needs to be publicly accessible Configure this URL in your Kie.ai API settings as the callback endpoint
Optional Customizations: Adjust the AI agent prompts in the "Music Producer Agent" and "Songwriter" nodes Modify song generation parameters in the Kie.ai API call (styleWeight, weirdnessConstraint, etc.) Update the Google Drive folder path for song storage Change the vocal gender or other music generation settings in the "Create song" node
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.
Need help customizing?
Contact me for consulting and support or add me on Linkedin.
Tags
Related Templates
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Add product ideas to Google Sheets via a Slack
Use Case This workflow is a slight variation of a workflow we're using at n8n. In most companies, employees have a lot o...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments