Tired of manually building N8n workflows or dealing with incomplete JSON files from AI tools? In this guide, I’ll show you a secret method to generate complete, ready-to-use N8n workflows with just a single prompt—100% free, no paid plans required!
What You’ll Learn
✅ How to use Gemini CLI (free) to automate N8n workflow creation
✅ Step-by-step setup in VS Code
✅ Generate complex workflows instantly (e.g., e-commerce order fulfillment)
✅ Auto-upload workflows to N8n—no manual imports!
Prerequisites
Before we begin, make sure you have:
✔ N8n instance (local or cloud)
✔ VS Code (or any terminal-based code editor)
✔ Google account (for Gemini CLI auth)
Step 1: Install Gemini CLI in VS Code
- Open VS Code and launch a new terminal (
Ctrl+Shift+
orTerminal > New Terminal
). - Run the following command to install Gemini CLI:
npm install -g @google/gemini-cli
- Once installed, start Gemini CLI:
gemini
- Authorize with Google when prompted (follow the on-screen login steps).
Step 2: Set Up N8n MCP Server for Auto-Workflow Generation
To automatically generate and deploy workflows, we’ll use an N8n MCP Server.
- Open your Gemini CLI settings file by running:
code ~/.gemini/settings.json
(If the file doesn’t exist, create it.)
- Add the N8n MCP Server config (replace placeholders with your N8n details):
{
"mcps": {
"n8n": {
"type": "n8n",
"config": {
"apiKey": "YOUR_N8N_API_KEY",
"apiUrl": "YOUR_N8N_INSTANCE_URL"
}
}
}
}
- Get your N8n API key:
- Go to N8n Settings > API and create a new key.
- N8n Instance URL:
- Local:
http://localhost:5678
- Cloud:
https://your-n8n-cloud-url.com
- Local:
- Save the file and restart Gemini CLI:
gemini
Step 3: Generate an N8n Workflow with One Prompt
Now, let’s create a workflow automatically!
Example Prompt:
“Generate an N8n workflow that triggers on a new WooCommerce order. First, fetch customer details using the WooCommerce node. Then, generate a PDF packing slip, upload it to Google Drive, and create a Trello card for the fulfillment team.”
Steps:
- Paste the prompt into Gemini CLI and press Enter.
- Allow tool permissions when asked (type
yes
). - Gemini CLI will:
- Search for relevant N8n nodes
- Generate a complete JSON workflow
- Auto-upload it to your N8n instance
- Check your N8n dashboard—the workflow will appear ready to use!
Step 4: Customize & Extend Workflows
Want a different workflow? Just tweak the prompt!
More Prompt Examples:
- “Generate an N8n workflow that sends a Slack alert when a new email arrives in Gmail.”
- “Create a workflow that syncs Shopify orders to Airtable and notifies via Telegram.”
Final Thoughts
With Gemini CLI + N8n MCP Server, you can:
✔ Save hours of manual workflow building
✔ Generate error-free workflows in seconds
✔ Avoid paid cloud plans (100% free!)
Need help? Drop a comment below! If this guide gets 300+ likes, I’ll make an advanced tutorial covering complex automations.
🔗 Resources:
Happy automating! 🚀