Music Producer Chatbot 🎡🎀 using Gemini + Suno (via Kei AI) & Google Drive Upload

Go to Workflow
2 views
Built by Davide Boizza Davide Boizza
Created on June 06, 2026

Description

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

1. βœ… Fully Automated AI Music Production

From idea β†’ to lyrics β†’ to full generated track β†’ to cloud storage
All handled automatically.

2. βœ… Conversational UX

Users don’t need technical knowledge.
The AI collects missing information step-by-step.

3. βœ… Smart Tool Selection

The agent dynamically chooses:

Songwriter tool (for original lyrics)
Search tool (for existing lyrics)

This makes the system adaptive and intelligent.

4. βœ… Structured & Error-Safe Design

Strict JSON schema enforcement
Output parsing and validation
Cleanup of malformed LLM responses

Reduces failure rate dramatically.

5. βœ… Asynchronous API Handling

Uses webhook-based resume
Handles long-running AI generation
Supports multiple song outputs

Scalable and production-ready.

6. βœ… 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

7. βœ… Memory-Enabled Conversations

Uses buffer memory (last 10 messages)
Maintains conversational context and continuity.

8. βœ… 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.

Nodes Used (9)

AI Agent
@n8n/n8n-nodes-langchain.agent
AI Agent Tool
@n8n/n8n-nodes-langchain.agentTool
Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Drive
n8n-nodes-base.googleDrive
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
HTTP Request
n8n-nodes-base.httpRequest
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured