Best n8n AI Automation Prompts: 25 Examples
Discover 25 powerful n8n AI automation prompts to streamline workflows, boost productivity, and automate complex tasks effortlessly.
Using target-driven ai prompts for n8n automation allows you to turn raw, unstructured data into actionable, structured workflows. By crafting precise system and user prompts inside n8n’s AI nodes—such as the AI Agent, Information Extractor, or OpenAI nodes—you can parse emails, score leads, summarize logs, and route data without writing fragile code. Effective n8n prompts explicitly define roles, state input context via n8n expressions, enforce strict JSON output formatting, and specify clear fallback rules.
As workflow automation evolves from static API triggers to dynamic AI orchestrations, the quality of your prompt engineering directly dictates the reliability of your workflows. n8n has integrated advanced AI capabilities through native node integrations and LangChain abstractions. However, an AI node is only as good as the instructions you provide. In this comprehensive guide, we will explore key principles for prompting inside n8n and supply 25 copy-and-use prompt templates designed for high-performance automation.
Why System Prompts Matter in n8n AI Workflows
In standard web development or chat apps, prompts are written for human-readable outputs. In automation platforms like n8n, AI outputs are frequently fed directly into downstream nodes such as PostgreSQL databases, Slack webhooks, Notion pages, or CRM platforms. If an LLM returns conversational filler (“Here is your JSON output:”), it can break the next node in your flow.
Optimizing ai prompts for n8n automation offers several key benefits:
- Deterministic Outputs: Forces the LLM to adhere strictly to JSON schemas, ensuring compatibility with n8n’s data structure (`$json`).
- Error Reduction: Clear guardrails prevent hallucinatory fields and unhandled exceptions during execution.
- Contextual Data Injection: Using n8n expressions like
{{ $json.body }}seamlessly feeds dynamic payload data into the prompt context. - Token Efficiency: Well-structured prompts reduce response length, cutting API billing costs on providers like OpenAI and Anthropic.
Key Concepts: Structuring AI Prompts for n8n Nodes
To write bulletproof prompts for n8n, you must understand how data flows through n8n’s internal data structures. Every node outputs an array of JSON objects under the $json selector.
1. Role Definition and Rules Engine
Always start your n8n system prompts by setting an absolute persona, establishing task boundaries, and listing negative constraints (what the model must never do).
2. Dynamic Variable Injection
n8n allows you to map dynamic variables into prompts using double curly braces. Ensure your expressions refer to the correct input item, such as {{ $json.message }} or {{ $('Webhook').item.json.body.email }}.
3. Strict JSON and Schema Constraints
When chaining AI nodes to standard nodes, require output as valid, raw JSON with no markdown formatting or commentary unless you are using the native Structured Output Parser node.
25 Actionable n8n AI Prompts Categorized
Below are 25 ready-to-use prompts categorized by operational domain. Copy these directly into your n8n LLM Chain, AI Agent, or OpenAI nodes. Replace the {{ $json.field }} placeholders with your workflow’s exact variables.
Category 1: Customer Support & Email Triage
1. Support Ticket Sentiment and Priority Classifier
Use this prompt in an email or ticket trigger workflow to categorize incoming customer requests and determine priority for routing.
Fill in the blanks below, or click a highlighted word in the prompt.
You are an automated customer support triage system.
Analyze the following incoming support ticket:
Ticket Content: "{{ $json.ticket_body }}"
Tasks:
1. Determine sentiment: POSITIVE, NEUTRAL, or NEGATIVE.
2. Determine urgency level: LOW, MEDIUM, HIGH, or URGENT.
3. Classify category: BILLING, TECHNICAL, FEATURE_REQUEST, ACCOUNT_ACCESS, or OTHER.
Output strictly valid JSON with no markdown tags or introductory text:
{
"sentiment": "STRING",
"urgency": "STRING",
"category": "STRING",
"summary": "1 sentence brief summary of the issue"
}
2. Customer Support Draft Response Generator
Passes incoming customer emails along with dynamic knowledge base snippets into an AI node to prepare auto-draft responses in Zendesk or Gmail.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a helpful customer support agent for a SaaS platform.
Draft a polite, professional reply to the customer based ONLY on the context provided.
Customer Email: "{{ $json.email_body }}"
Knowledge Base Context: "{{ $json.kb_context }}"
Rules:
- If the knowledge base does not contain the answer, set "can_answer" to false and provide a escalation draft.
- Keep the tone helpful, concise, and professional.
Output Format (JSON only):
{
"can_answer": true,
"draft_reply": "Your draft email body here...",
"suggested_action": "RESOLVE or ESCALATE_TO_HUMAN"
}
3. Spam and Abuse Detection Prompt
Filters out contact form spam before it hits your internal team channels or CRM.
Fill in the blanks below, or click a highlighted word in the prompt.
Analyze the following web form submission for spam, promotional fluff, phishing attempts, or automated bot messages.
Form Submission:
Name: {{ $json.name }}
Email: {{ $json.email }}
Message: {{ $json.message }}
Analyze the input and return pure JSON:
{
"is_spam": true/false,
"confidence_score": 0.00 to 1.00,
"reason": "Brief explanation for the score"
}
4. Multi-Language Detection and Translation Router
Detects foreign language messages and translates them into English while providing a localized reply draft.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a multilingual communication processor.
Analyze the incoming text message: "{{ $json.incoming_text }}"
Perform the following:
1. Detect source language (ISO 639-1 code).
2. Translate text into English if it is not already English.
Output pure JSON:
{
"language_code": "en",
"is_english": true/false,
"english_translation": "Translated text here",
"original_text": "{{ $json.incoming_text }}"
}
5. SLA Breach Risk Evaluator
Evaluates unresolved ticket logs to flag items nearing SLA violation.
Fill in the blanks below, or click a highlighted word in the prompt.
You are an SLA monitor for an IT service desk.
Evaluate the following ticket metrics:
Ticket ID: {{ $json.ticket_id }}
Created At: {{ $json.created_at }}
Last Update: {{ $json.updated_at }}
Customer Tier: {{ $json.customer_tier }}
Latest Message: "{{ $json.last_message }}"
Analyze risk of SLA breach. Return JSON:
{
"sla_risk": "LOW" | "MEDIUM" | "HIGH" | "CRITICAL",
"recommended_action": "Short string describing next step",
"escalate": true/false
}
Category 2: Data Extraction & Structuring
6. Unstructured Email-to-JSON Invoice Extractor
Extracts line items, totals, due dates, and vendor details from vendor emails or OCR text outputs.
Fill in the blanks below, or click a highlighted word in the prompt.
Extract key invoice information from the following unformatted text input:
Input Text:
"{{ $json.text_content }}"
Extract and return JSON according to this exact structure:
{
"vendor_name": "String or null",
"invoice_number": "String or null",
"invoice_date": "YYYY-MM-DD or null",
"due_date": "YYYY-MM-DD or null",
"total_amount": 0.00,
"currency": "USD",
"line_items": [
{
"description": "String",
"amount": 0.00
}
]
}
Return only JSON. Do not add markdown backticks.
7. Document Action Item and Key Takeaway Extractor
Processes meeting transcripts or document uploads to generate structured action items for Slack or Asana nodes.
Fill in the blanks below, or click a highlighted word in the prompt.
Read the following meeting notes and extract key decision points and explicit action items.
Transcript:
"{{ $json.transcript }}"
Output pure JSON format:
{
"key_decisions": ["Decision 1", "Decision 2"],
"action_items": [
{
"task": "Task description",
"owner": "Person name or Unassigned",
"deadline": "Mentioned deadline or Unknown"
}
]
}
8. Web Scraping Data Standardizer
Cleans dirty HTML, raw text, or unstructured product web scrapes into clean ecommerce schemas.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a data transformation engine. Convert the raw scraped product text into standard e-commerce fields.
Raw Data:
"{{ $json.scraped_text }}"
Return standard JSON format:
{
"product_title": "Clean Title",
"brand": "Brand Name or Unknown",
"price": 0.00,
"in_stock": true/false,
"features": ["Feature 1", "Feature 2"],
"specs_dict": {}
}
9. Resume / Candidate Profile Extractor
Parses applicant resumes to update HR ATS platforms like Greenhouse or Airtable automatically.
Fill in the blanks below, or click a highlighted word in the prompt.
Parse the following candidate resume text into a structured profile:
Resume Text:
"{{ $json.resume_text }}"
JSON Output Schema:
{
"full_name": "String",
"email": "String",
"phone": "String",
"years_experience": Number,
"skills": ["Skill1", "Skill2"],
"education_level": "Bachelor's / Master's / PhD / Other",
"current_company": "String or null"
}
10. Receipt Data Extractor for Expense Approvals
Processes raw OCR text from image receipts attached to Telegram or Slack notifications.
Fill in the blanks below, or click a highlighted word in the prompt.
Extract structured financial receipt data from this raw text string:
Raw Text:
"{{ $json.ocr_text }}"
Return JSON strictly:
{
"merchant_name": "String",
"transaction_date": "YYYY-MM-DD",
"tax_amount": 0.00,
"tip_amount": 0.00,
"grand_total": 0.00,
"category": "MEALS" | "TRAVEL" | "SUPPLIES" | "SOFTWARE" | "OTHER"
}
Category 3: Content Creation & Social Media Automation
11. Blog Post to Multi-Platform Social Media Generator
Turns long-form article content into targeted social posts formatted for LinkedIn, X (Twitter), and Facebook.
Fill in the blanks below, or click a highlighted word in the prompt.
You are an expert social media strategist.
Take the following article excerpt and write tailored posts for multiple channels.
Article Excerpt:
"{{ $json.article_text }}"
Requirements:
- Twitter/X: Under 280 characters, engaging hook, 2 hashtags.
- LinkedIn: Professional tone, bullet points, clear call to action.
- Facebook: Friendly tone, conversational tone.
Return JSON only:
{
"twitter_post": "String",
"linkedin_post": "String",
"facebook_post": "String"
}
12. Weekly Newsletter Summary Generator
Takes an array of ingested RSS articles and outputs a cohesive newsletter draft.
Fill in the blanks below, or click a highlighted word in the prompt.
You are an editor for a tech newsletter.
Summarize the following list of news articles into an engaging 3-bullet newsletter section.
Articles Input:
"{{ $json.articles_combined }}"
Rules:
- Include a catch title.
- Provide 3 distinct highlights with single-sentence summaries.
- Keep output markdown-formatted for direct publishing.
JSON Output:
{
"subject_line": "Catchy Subject",
"markdown_body": "Markdown text here"
}
13. SEO Meta Title and Description Generator
Generates search engine metadata based on draft pages created in WordPress or Ghost.
Fill in the blanks below, or click a highlighted word in the prompt.
Generate an SEO-optimized title tag and meta description based on the provided page content.
Page Title: "{{ $json.title }}"
Content Body: "{{ $json.content }}"
Target Keyword: "{{ $json.keyword }}"
Guidelines:
- Meta Title: Max 60 characters, include target keyword near the front.
- Meta Description: Max 155 characters, includes target keyword, strong CTA.
Output pure JSON:
{
"meta_title": "String",
"meta_description": "String",
"character_counts": {
"title_len": 0,
"desc_len": 0
}
}
14. YouTube Transcript to Timestamps & Subheadings
Transforms raw transcript text into structured chapters for YouTube video descriptions.
Fill in the blanks below, or click a highlighted word in the prompt.
Organize this raw video transcript into logical chapters with timestamps.
Transcript Input:
"{{ $json.raw_transcript }}"
JSON Format:
{
"chapters": [
{"timestamp": "00:00", "title": "Introduction"},
{"timestamp": "02:15", "title": "Topic 1"}
],
"overall_summary": "Short paragraph text"
}
15. Technical Release Notes / Changelog Rewriter
Converts dense GitHub commit logs or PR descriptions into customer-friendly release notes.
Fill in the blanks below, or click a highlighted word in the prompt.
Rewrite the following developer Git commits into polished, customer-facing product update release notes.
Commit Messages:
"{{ $json.commit_logs }}"
Formatting Requirements:
- Group into "New Features", "Improvements", and "Bug Fixes".
- Remove technical jargon and internal PR numbers.
Output JSON:
{
"changelog_markdown": "Formatted markdown text"
}
Category 4: Lead Scoring & Sales Workflows
16. Inbound Lead Intent and Fit Scorer
Evaluates new signup form submissions and scores them based on Ideal Customer Profile (ICP) criteria.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a Sales Operations AI. Evaluate incoming lead details to calculate an ICP fit score (0-100).
Lead Data:
Email: {{ $json.email }}
Company Size: {{ $json.company_size }}
Job Title: {{ $json.job_title }}
Use Case Description: "{{ $json.use_case }}"
Scoring Criteria:
- Enterprise domain (@company.com vs @gmail.com): +20
- Senior decision maker (Director, VP, C-Level): +30
- High match use case: +30
- Company size > 50 employees: +20
Return pure JSON:
{
"lead_score": 85,
"qualification_status": "HOT" | "WARM" | "COLD",
"scoring_breakdown": "Explanation of score"
}
17. Enterprise Firmographic Profiler
Constructs a company summary profile using raw web scrape text from a prospect’s landing page.
Fill in the blanks below, or click a highlighted word in the prompt.
Analyze the web page text of a target company and return firmographic intelligence.
Scraped Web Page:
"{{ $json.website_text }}"
JSON Output:
{
"company_name": "String",
"industry": "String",
"business_model": "B2B" | "B2C" | "Marketplace" | "Unknown",
"core_value_proposition": "1 sentence description",
"target_audience": "Description of target customer"
}
18. Personalized Sales Email Generator
Generates tailored cold outreach emails based on a prospect’s LinkedIn bio and corporate website data.
Fill in the blanks below, or click a highlighted word in the prompt.
Craft a personalized 3-sentence sales email to a prospect.
Prospect Name: {{ $json.prospect_name }}
Prospect Title: {{ $json.prospect_title }}
Company: {{ $json.company }}
Recent News / Bio Snippet: "{{ $json.bio_snippet }}"
Our Product Value Prop: "{{ $json.our_value_prop }}"
Guidelines:
- No generic openers ("I hope this email finds you well").
- Refer to their specific context in line 1.
- Offer a soft call to action.
Return JSON:
{
"subject_line": "String",
"email_body": "String"
}
19. Competitor Mention Extractor
Identifies whether a sales call transcript contains references to competitors and extracts sentiment context.
Fill in the blanks below, or click a highlighted word in the prompt.
Analyze this sales call snippet for mentions of market competitors.
Transcript Segment:
"{{ $json.call_segment }}"
Output pure JSON:
{
"competitor_mentioned": true/false,
"competitors_found": ["Competitor A", "Competitor B"],
"customer_sentiment_towards_competitor": "POSITIVE" | "NEGATIVE" | "NEUTRAL",
"key_concerns_raised": ["Concern 1"]
}
20. Executive Meeting Summary and Next Steps
Processes raw Zoom or Otter.ai transcripts into bullet points for CRM update logging.
Fill in the blanks below, or click a highlighted word in the prompt.
Summarize the following client meeting transcript for sales record logging.
Transcript Text:
"{{ $json.transcript }}"
Return JSON:
{
"executive_summary": "Brief 2-3 sentence overview.",
"client_pain_points": ["Point 1", "Point 2"],
"agreed_next_steps": ["Step 1", "Step 2"],
"deal_health": "STRONG" | "NEUTRAL" | "AT_RISK"
}
Category 5: System Administration & Workflow Logic
21. Webhook Error Log Summarizer & Root Cause Analyzer
Processes complex JSON error traces from failed n8n workflows and sends plain-English alerts to Slack developers.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a DevOps assistant monitor. Diagnose this system execution failure log.
Node Name: {{ $json.node_name }}
Error Message: "{{ $json.error_message }}"
Execution Stack: "{{ $json.stack_trace }}"
Tasks:
1. Explain the root cause in simple language.
2. Recommend immediate fix steps for the developer.
Output JSON:
{
"summary": "1 sentence plain language error explanation",
"probable_cause": "Detailed technical cause",
"action_required": "Step-by-step resolution guidance",
"severity": "CRITICAL" | "WARNING" | "INFO"
}
22. Unstructured Payload to API Schema Converter
Maps dynamic, variable incoming JSON payloads into standard, strictly expected destination API structures.
Fill in the blanks below, or click a highlighted word in the prompt.
Transform the dynamic payload into the required destination structure.
Input JSON Payload:
{{ JSON.stringify($json.raw_payload) }}
Target Fields:
- external_id (map from id, uuid, or user_id)
- user_email (map from email, contact_email)
- status (default to "PENDING" if not explicitly provided)
Return target structure as pure JSON only.
23. Database SQL Query Error Explainer
Analyzes failed Postgres or MySQL queries inside n8n workflow execution failures and suggests fixes.
Fill in the blanks below, or click a highlighted word in the prompt.
An n8n SQL node executed with an error. Analyze the statement and error message.
Query: "{{ $json.query }}"
SQL Error: "{{ $json.error }}"
Return JSON:
{
"error_type": "SyntaxError" | "ConstraintError" | "ConnectionError" | "Unknown",
"corrected_sql": "Suggested corrected SQL statement",
"explanation": "Why the original query failed"
}
24. Automated Toxicity Guardrail Filter
Evaluates incoming user-generated input before sending it to public endpoints or database storage.
Fill in the blanks below, or click a highlighted word in the prompt.
Screen the following text for safety compliance (hate speech, severe profanity, personal identifiable information leaks).
Input Text:
"{{ $json.user_input }}"
Return pure JSON:
{
"passed_filter": true/false,
"flagged_categories": ["CategoryName"],
"sanitized_text": "Text with PII/redacted items replaced by [REDACTED] if needed"
}
25. Intelligent Router Decision Engine
Acts as an AI-driven Switch node inside n8n to make complex routing decisions based on fuzzy inputs.
Fill in the blanks below, or click a highlighted word in the prompt.
You are a routing decision engine for a business process workflow.
Evaluate the incoming payload and decide which workflow branch should handle it.
Payload:
"{{ $json.payload_description }}"
Available Branches:
- BRANCH_A: Financial transactions, refund requests, billing inquiries.
- BRANCH_B: Technical bug reports, API questions, platform outages.
- BRANCH_C: General inquiries, marketing messages, sales leads.
Output strictly valid JSON:
{
"selected_branch": "BRANCH_A" | "BRANCH_B" | "BRANCH_C",
"reasoning": "Brief explanation for this choice"
}
Step-by-Step: Implementing AI Prompts in n8n
To implement these system prompts efficiently inside your n8n instance, follow this standard setup sequence:
- Select the Right Node: For basic text operations or single completions, use the standard OpenAI Node or Anthropic Node. For autonomous execution requiring tools, use the AI Agent Node combined with a LangChain Model Node.
- Configure System Messages: Place system instructions (role, rules, output JSON format) inside the “System Message” parameter, reserving the “Prompt” parameter for dynamic user inputs.
- Toggle Expression Mode: Click on the dynamic expression icon (
{{ }}) next to the input field to reference data from preceding nodes in the canvas (e.g.,{{ $json.body }}). - Enforce JSON Output: If downstream nodes require JSON, pair your model node with the Structured Output Parser Node or explicitly set response parameters to
response_format: { type: "json_object" }if using OpenAI. - Test with Standard Inputs: Execute the node using pinned test data to verify that the LLM adheres consistently to the schema rules.
Comparison: Standard Logic Nodes vs. AI Prompts in n8n
Deciding when to use traditional n8n logic nodes versus an AI-driven prompt setup depends on data structure, predictability, and processing cost.
| Feature / Node Type | Standard n8n Logic Nodes (Code, Switch, Set) | AI Prompts in n8n (OpenAI, LangChain, Agents) |
|---|---|---|
| Data Requirement | Strict, predictable, pre-formatted JSON. | Unstructured text, messy HTML, raw emails, audio transcripts. |
| Execution Speed | Instant (< 10 milliseconds). | Latency-dependent on LLM API (500ms – 5+ seconds). |
| Execution Cost | Free (runs on your n8n host server). | Requires LLM API tokens (OpenAI, Anthropic, Google). |
| Reliability | 100% deterministic (exact match rules). | Probabilistic (requires guardrails and schema validation). |
| Setup Complexity | Requires manual Regex or JavaScript for dirty data parsing. | High accessibility via natural language instructions. |
Best Practices for Crafting Prompts in n8n
- Set Low Temperature Settings: Set the temperature parameter between
0.0and0.2for data extraction, schema mapping, and decision classification tasks to minimize hallucination risk. Save higher temperatures (0.7+) strictly for creative draft generation. - Never Trust Raw Output: Always pass AI outputs through a JSON Parse step or place error handling (Continue On Fail) on the AI node to handle rare malformed model completions safely.
- Limit Input Token Scope: Avoid passing whole HTML structures or massive payloads into prompt variables. Use an n8n Code node or HTML Extract node to trim excess clutter prior to feeding data into the LLM chain.
- Inject Multi-Shot Examples: When strict formatting is required, embed 1 to 2 concrete input/output examples (“Few-Shot Prompting”) directly inside your system prompt.
Common Mistakes to Avoid
- Mixing Up System and User Prompts: Putting generic rules (“Output JSON only”) into the User Prompt field instead of the System Prompt increases the risk of rules being ignored by the model.
- Neglecting Markdown Stripping: LLMs frequently surround JSON outputs with markdown fences (
```json ... ```). Failing to tell the model “Do not use markdown backticks” can break standardJSON.parse()methods downstream. - Missing Default Values: Prompts that don’t instruct the model on how to handle missing data fields may lead to omitted keys, breaking downstream node schemas that depend on specific object properties.
Frequently Asked Questions
How do I make sure n8n AI prompts return valid JSON?
To guarantee valid JSON, use n8n’s native Structured Output Parser node attached to an AI Agent or Chain. Alternatively, use OpenAI’s native JSON Mode setting and include an explicit example schema inside your system prompt while explicitly forbidding markdown backticks.
Can I use free or self-hosted models with AI prompts in n8n?
Yes. n8n supports self-hosted LLMs using the Ollama, LocalAI, or Hugging Face nodes. You can run open-source models like Llama 3 or Mistral locally and pass these same system prompts to maintain complete data privacy without API costs.
How do I inject n8n workflow variables into an AI prompt?
Switch the prompt input parameter in your AI node from Fixed to Expression mode. Use standard n8n expression syntax, such as {{ $json.myVariable }}, to insert dynamic node outputs directly into your system or user messages.
What is the difference between the Basic LLM Chain and AI Agent node in n8n?
The Basic LLM Chain takes a simple prompt and processes text directly through a model. The AI Agent node uses a reasoning loop (ReAct model) and can autonomously choose and execute external tools (like vector stores, web search, or database Lookups) based on your system instructions.
Conclusion
Mastering ai prompts for n8n automation allows you to build resilient, flexible automated systems capable of processing unpredictable enterprise data. By combining defined roles, strict output formats, and n8n’s native data expressions, you transform LLMs from basic chatbots into reliable automation logic engines. Test the templates above in your workflows, calibrate temperatures for accuracy, and enforce fallback pathways to maximize productivity across your organization.