Use this advanced n8n workflow to automatically transform basic user prompts stored in Google Sheets into professional, structured, and detailed AI prompts using multiple LLMs (Gemini, Groq) with smart retry logic.
Download this n8n workflow template and start using it instantly.
This robust n8n workflow template solves the challenge of inconsistent AI output by ensuring every prompt is professionally refined before use. By leveraging a specialized n8n node powered by multiple LLMs (like Groq's Qwen and Google's Gemini), the system analyzes brief inputs originating from a Google Sheet (detected by an n8n trigger) and transforms them into detailed, structured, and complete prompts.
The core innovation is the integrated retry mechanism within this n8n workflow, which intelligently identifies missing fields and regenerates the prompt up to three times, guaranteeing the final output includes critical metadata like topic, categories, and specific modification notes. The results are systematically stored back into Google Sheets, providing a reliable audit trail and a library of optimized prompts. This is a crucial, high-value n8n workflow for anyone serious about production-grade AI automation.
Loop Over Items n8n node ensures sequential processing, handling one prompt at a time.ExecutionController code n8n node is central to the logic. It manages execution tracking, prevents duplicate runs, and dynamically generates the specialized systemMessage required for the AI agent. It differentiates between a first-time prompt enhancement run and a focused regeneration retry.PromptModifer n8n node, configured as a Langchain Agent, executes the refinement task. It routes the prompt and system instructions to powerful models like Gemini and Qwen (via Groq) to enhance the basic request into a detailed, structured JSON object.Parse AI Chat code n8n node is essential for reliability. It extracts structured data (Title, Topic, Categories, Notes) from the AI's potentially inconsistent text response, using three fallback methods for robust JSON parsing. The Switch n8n node then checks if all required metadata fields are complete.ExecutionController for a focused regeneration attempt, asking the AI to complete the missing data.Finalize ModifiedPrompt DataModel n8n node prepares the data structure. The Create/Upate Modified Prompt n8n node then writes the fully optimized prompt and its rich metadata back to the result Google Sheet.Telegram n8n node sends a final notification confirming the prompt refinement success, including a summary of the enhanced output, offering real-time visibility into the n8n workflow's operation.ExecutionController), or failed definitively (leading to a Telegram error notification).Automate the creation of custom direct booking websites from Airbnb listings using this powerful n8n workflow. Scrape data, generate a static HTML site, and deploy instantly to Netlify.

Use this robust n8n workflow to instantly capture data from external services via a webhook and append it directly to Google Sheets. Ideal for real-time data logging using the n8n trigger.

Use this efficient n8n workflow to automate file transfers from an FTP server to a specific Google Drive folder. Leverage the FTP and Google Drive n8n node for seamless data movement.

Use this powerful n8n workflow to automatically transform new blog posts (via RSS) into 5 distinct social media formats using GPT-4o, fetch related images via Unsplash, and save everything to Airtable for review. Discover advanced n8n templates for marketing.

An advanced n8n workflow that transforms cloud documentation URLs into standardized security control baselines using a three-stage OpenAI Assistant pipeline. Features dynamic file appending in Google Drive.









































