Back to Catalog

Ai prompt generator workflow

Anurag SrivastavaAnurag Srivastava
47916 views
2/3/2026
Official Page

🧠 AI Prompt Generator Workflow – n8n Documentation

Who is this for?

This workflow is for AI builders, prompt engineers, developers, marketers, and no-code creators who want to convert rough user input into structured, high-quality prompts for LLMs. It’s especially useful for tools that rely on precision prompting and want to automate the discovery of intent and constraints.


What problem is this workflow solving? / Use case

Many users struggle to write effective prompts due to vague ideas or unclear formatting needs. This workflow:

  • Collects structured user input.
  • Dynamically generates clarifying questions.
  • Returns a well-formatted AI prompt based on the user's intent and context.

This ensures the generated prompt is useful for downstream AI agents without requiring technical understanding from the end user.


What this workflow does

  1. Start with a branded form UI
    The user is shown a styled form with questions like:

    • What do you want to build?
    • What tools can you access?
    • What input can be expected?
    • What output do you expect?
  2. Analyze and generate relevant follow-up questions
    The workflow sends the user's answers to Google Gemini (via LangChain) which outputs 1–3 clarifying questions. These questions are parsed into a dynamic form.

  3. Loop through and collect follow-up answers
    Each follow-up question is shown in a form one at a time to capture additional context.

  4. Merge all inputs
    The base intent and follow-up responses are merged into a single context block.

  5. Generate a final AI-ready prompt
    The prompt generator node formats everything into a clean, six-section structure:

    • <constraints>
    • <role>
    • <inputs>
    • <tools>
    • <instructions>
    • <conclusions>
  6. Display the final result
    The finished prompt is shown in a clean UI where users can easily copy and reuse it.


Setup

  1. Credentials Required

    • Google Gemini (PaLM) API credentials (already integrated as Google Gemini(PaLM) Api account 2).
  2. Form Trigger

    • Ensure the On form submission trigger is exposed via a webhook or public endpoint (e.g. using ngrok or deployed server).
  3. Styling

    • Custom CSS is included in all form nodes for a beautiful UI. You can modify this to match your branding.
  4. Environment

    • This workflow is compatible with self-hosted n8n or n8n.cloud.
    • Webhooks must be accessible to users who will fill out the form.

How to customize this workflow to your needs

  • Change the base questions
    Update the BaseQuestions form node to add or remove fields depending on your use case.

  • Modify Gemini prompts
    You can edit the system prompt inside PromptGenerator to change tone, output structure, or AI instructions.

  • Change prompt formatting
    If you use a different AI agent (like GPT, Claude, or Mistral), adjust the section labels and formatting to suit that agent’s expected input.

  • Send results elsewhere
    Add integration nodes after PromptGenerator, such as:

    • Google Docs / Notion (to log prompts)
    • Gmail / Slack (to notify your team)
    • Zapier / Make (to push to other automation flows)
  • Skip follow-up questions (optional)
    If your base form collects all needed info, you can bypass the RelevantQuestions form section by modifying conditional logic.


Example Output Prompt (Structure)

<role> You are an AI assistant that converts videos into LinkedIn posts with a witty tone. </role> <inputs> - A short video (max 5 minutes) - Desired tone: witty - Style: both summary and quotes - Audience: general network </inputs> <tools> You do not have access to APIs or web search. </tools> <instructions> 1. Parse transcript. 2. Extract insights and quotes. 3. Write an engaging, witty LinkedIn post under 3000 characters. </instructions> <constraints> Avoid technical jargon. No generic intros. Make it platform-native. </constraints> <conclusions> Return a LinkedIn-ready post that starts with a hook and ends with hashtags.

AI Prompt Generator Workflow

This n8n workflow provides a web form to generate AI prompts using the Google Gemini Chat Model. It allows users to input a topic and desired tone, then leverages an AI model to create a structured prompt, which is then presented back to the user.

What it does

This workflow automates the following steps:

  1. Listens for Form Submissions: It starts when a user submits data through an n8n form.
  2. Collects User Input: The form collects a "Topic" and a "Tone" from the user.
  3. Generates AI Prompt: It uses the Google Gemini Chat Model to generate a prompt based on the provided topic and tone.
  4. Parses AI Output: The AI's response is processed by a Structured Output Parser to ensure it adheres to a defined JSON schema, and an Auto-fixing Output Parser attempts to correct any formatting issues.
  5. Splits and Merges Data: The generated prompt is then split out and merged back into a single item, preparing it for display.
  6. Presents Generated Prompt: The final, structured AI prompt is displayed back to the user via an n8n form.

Prerequisites/Requirements

  • n8n Instance: A running instance of n8n.
  • Google Gemini Chat Model Credentials: You will need to configure your n8n instance with access to the Google Gemini Chat Model. This typically involves an API key or service account.
  • LangChain Nodes: Ensure the @n8n/n8n-nodes-langchain package is installed and enabled in your n8n instance, as this workflow uses several LangChain nodes.

Setup/Usage

  1. Import the Workflow:
    • Download the provided JSON file for this workflow.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three dots menu (...) and select "Import from JSON".
    • Paste the workflow JSON or upload the file.
  2. Configure Credentials:
    • Locate the "Google Gemini Chat Model" node.
    • Click on it and select or create your Google Gemini credentials.
  3. Activate the Workflow:
    • Click the "Activate" toggle in the top right corner of the workflow editor to make it live.
  4. Access the Form:
    • The "On form submission" node will provide a unique URL for the input form. Access this URL in your browser.
    • Fill in the "Topic" and "Tone" fields and submit the form.
  5. View the Output:
    • After submission, the workflow will process your request, and the generated AI prompt will be displayed on a new n8n form page.

Related Templates

Dynamic Hubspot lead routing with GPT-4 and Airtable sales team distribution

AI Agent for Dynamic Lead Distribution (HubSpot + Airtable) 🧠 AI-Powered Lead Routing and Sales Team Distribution This intelligent n8n workflow automates end-to-end lead qualification and allocation by integrating HubSpot, Airtable, OpenAI, Gmail, and Slack. The system ensures that every new lead is instantly analyzed, scored, and routed to the best-fit sales representative β€” all powered by AI logic, sir. --- πŸ’‘ Key Advantages ⚑ Real-Time Lead Routing Automatically assigns new leads from HubSpot to the most relevant sales rep based on region, capacity, and expertise. 🧠 AI Qualification Engine An OpenAI-powered Agent evaluates the lead’s industry, region, and needs to generate a persona summary and routing rationale. πŸ“Š Centralized Tracking in Airtable Every lead is logged and updated in Airtable with AI insights, rep details, and allocation status for full transparency. πŸ’¬ Instant Notifications Slack and Gmail integrations alert the assigned rep immediately with full lead details and AI-generated notes. πŸ” Seamless CRM Sync Updates the original HubSpot record with lead persona, routing info, and timeline notes for audit-ready history, sir. --- βš™οΈ How It Works HubSpot Trigger – Captures a new lead as soon as it’s created in HubSpot. Fetch Contact Data – Retrieves all relevant fields like name, company, and industry. Clean & Format Data – A Code node standardizes and structures the data for consistency. Airtable Record Creation – Logs the lead data into the β€œLeads” table for centralized tracking. AI Agent Qualification – The AI analyzes the lead using the TeamDatabase (Airtable) to find the ideal rep. Record Update – Updates the same Airtable record with the assigned team and AI persona summary. Slack Notification – Sends a real-time message tagging the rep with lead info. Gmail Notification – Sends a personalized handoff email with context and follow-up actions. HubSpot Sync – Updates the original contact in HubSpot with the assignment details and AI rationale, sir. --- πŸ› οΈ Setup Steps Trigger Node: HubSpot β†’ Detect new leads. HubSpot Node: Retrieve complete lead details. Code Node: Clean and normalize data. Airtable Node: Log lead info in the β€œLeads” table. AI Agent Node: Process lead and match with sales team. Slack Node: Notify the designated representative. Gmail Node: Email the rep with details. HubSpot Node: Update CRM with AI summary and allocation status, sir. --- πŸ” Credentials Required HubSpot OAuth2 API – To fetch and update leads. Airtable Personal Access Token – To store and update lead data. OpenAI API – To power the AI qualification and matching logic. Slack OAuth2 – For sending team notifications. Gmail OAuth2 – For automatic email alerts to assigned reps, sir. --- πŸ‘€ Ideal For Sales Operations and RevOps teams managing multiple regions B2B SaaS and enterprise teams handling large lead volumes Marketing teams requiring AI-driven, bias-free lead assignment Organizations optimizing CRM efficiency with automation, sir --- πŸ’¬ Bonus Tip You can easily extend this workflow by adding lead scoring logic, language translation for follow-ups, or Salesforce integration. The entire system is modular β€” perfect for scaling across global sales teams, sir.

MANISH KUMARBy MANISH KUMAR
113

Track daily moods with AI analysis & reports using GPT-4o, Data Tables & Gmail

Track your daily mood in one tap and receive automated AI summaries of your emotional trends every week and month. Perfect for self-reflection, wellness tracking, or personal analytics. This workflow logs moods sent through a webhook (/mood) into Data Tables, analyzes them weekly and monthly with OpenAI (GPT-4o), and emails you clear summaries and actionable recommendations via Gmail. βš™οΈ How It Works Webhook – Mood β†’ Collects new entries (πŸ™‚, 😐, or 😩) plus an optional note. Set Mood Data β†’ Adds date, hour, and note fields automatically. Insert Mood Row β†’ Stores each record in a Data Table. Weekly Schedule (Sunday 20:00) β†’ Aggregates the last 7 days and sends a summarized report. Monthly Schedule (Day 1 at 08:00) β†’ Aggregates the last 30 days for a deeper AI analysis. OpenAI Analysis β†’ Generates insights, patterns, and 3 actionable recommendations. Gmail β†’ Sends the full report (chart + AI text) to your inbox. πŸ“Š Example Auto-Email Weekly Mood Summary (last 7 days) πŸ™‚ 5 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 😐 2 β–ˆβ–ˆβ–ˆβ–ˆ 😩 0 Average: 1.7 (Positive πŸ™‚) AI Insights: You’re trending upward this week β€” notes show that exercise days improved mood. Try keeping short walks mid-week to stabilize energy. 🧩 Requirements n8n Data Tables enabled OpenAI credential (GPT-4o or GPT-4 Turbo) Gmail OAuth2 credential to send summaries πŸ”§ Setup Instructions Connect your credentials: Add your own OpenAI and Gmail OAuth2 credentials. Set your Data Table ID: Open the Insert Mood Row node and enter your own Data Table ID. Without this, new moods won’t be stored. Replace the email placeholder: In the Gmail nodes, replace your.email@example.com with your actual address. Deploy and run: Send a test POST request to /mood (e.g. { "mood": "πŸ™‚", "note": "productive day" }) to log your first entry. ⚠️ Before activating the workflow, ensure you have configured the Data Table ID in the β€œInsert Mood Row” node. 🧠 AI Analysis Interprets mood patterns using GPT-4o. Highlights trends, potential triggers, and suggests 3 specific actions. Runs automatically every week and month. πŸ”’ Security No personal data is exposed outside your n8n instance. Always remove or anonymize credential references before sharing publicly. πŸ’‘ Ideal For Personal mood journaling and AI feedback Therapists tracking client progress Productivity or self-quantification projects πŸ—’οΈ Sticky Notes Guide 🟑 Mood Logging Webhook POST /mood receives mood + optional note. ⚠️ Configure your own Data Table ID in the β€œInsert Mood Row” node before running. 🟒 Weekly Summary Runs every Sunday 20:00 β†’ aggregates last 7 days β†’ generates AI insights + emails report. πŸ”΅ Monthly Summary Runs on Day 1 at 08:00 β†’ aggregates last 30 days β†’ creates monthly reflection. 🟣 AI Analysis Uses OpenAI GPT-4o to interpret trends and recommend actions. 🟠 Email Delivery Sends formatted summaries to your inbox automatically.

Jose CastilloBy Jose Castillo
105

Create, update, and get a person from Copper

This workflow allows you to create, update, and get a person from Copper. Copper node: This node will create a new person in Copper. Copper1 node: This node will update the information of the person that we created using the previous node. Copper2 node: This node will retrieve the information of the person that we created earlier.

Harshil AgrawalBy Harshil Agrawal
603