Skip to main content

Ai prompt generator workflow

Workflow preview

Workflow preview
100%
Ai prompt generator workflow preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 i...

Best for

  • Engineering automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.form, n8n-nodes-base.splitinbatches, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Anurag Srivastava.

Original n8n.io source

1.1 Workflow description

Title
Ai prompt generator workflow
Workflow name
Ai prompt generator workflow

🧠 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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 2 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 3 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 4 - BaseQuestions

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 5 - LoopQuestions

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - RelevantQuestions

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 7 - MergeUserIntent

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 8 - PromptGenerator

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 9 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - RelatedQuestionAI

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 12 - SplitQuestions

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 13 - Auto-fixing Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserAutofixing - outputParserAutofixing
Config choices
Version 1

Block 14 - Structured Output Parser1

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - SendingPrompt

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 21 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Ai prompt generator workflow
Complexity advanced
Nodes 21
Categories Engineering, Multimodal AI
Author Anurag Srivastava
Published 19 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5045/5045.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Ai prompt generator workflow do?

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 i...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, Multimodal AI use case.