Advanced AI demo (presented at AI Developers #14 meetup)
This workflow was presented at the AI Developers meet up in San Fransico on 24 July, 2024.
AI workflows
- Categorize incoming Gmail emails and assign custom Gmail labels. This example uses the Text Classifier node, simplifying this usecase.
- Ingest a PDF into a Pinecone vector store and chat with it (RAG example)
- AI Agent example showcasing the HTTP Request tool. We teach the agent how to check availability on a Google Calendar and book an appointment.
Advanced AI Demo Workflow for AI Developers Meetup
This n8n workflow demonstrates an advanced AI application, likely presented at an "AI Developers Meetup". It showcases a sophisticated integration of AI models, vector stores, and conversational memory to provide intelligent responses and perform actions based on user input. The workflow is designed to process chat messages, classify their intent, retrieve relevant information, and potentially interact with external APIs.
What it does
This workflow orchestrates several AI and automation components to deliver an intelligent conversational agent:
- Listens for Chat Messages: It starts by receiving incoming chat messages, acting as the primary trigger for the workflow.
- Classifies Message Intent: The incoming message is passed to a Text Classifier to determine its category or intent.
- Conditional Routing based on Intent:
- If the message is classified as "General Question", it proceeds to a Question and Answer Chain.
- If the message is classified as "Tool Usage", it routes to an AI Agent designed to utilize tools.
- If the message classification is neither of the above, it performs a "No Operation" (effectively ending the flow for unclassified messages).
- Handles General Questions (Q&A Chain):
- Utilizes a Pinecone Vector Store to retrieve relevant information.
- Generates embeddings for the query using OpenAI Embeddings.
- Processes the retrieved information and the user's question using an OpenAI Chat Model (or Anthropic Chat Model, if configured) to formulate an answer.
- Maintains conversational context using a Simple Memory buffer.
- Handles Tool Usage (AI Agent):
- An AI Agent is employed to understand the user's request and decide if an external tool is needed.
- It has access to an "HTTP Request Tool" which allows it to make API calls.
- Maintains conversational context using a Simple Memory buffer.
- Uses an OpenAI Chat Model (or Anthropic Chat Model, if configured) for reasoning and generating responses.
- Prepares Documents for Vector Store (Initial Setup/Maintenance):
- A separate branch, likely for initial data ingestion or updates, uses a "Default Data Loader" to load documents.
- These documents are then split into manageable chunks using a "Recursive Character Text Splitter".
- Embeddings are generated for these chunks using "Embeddings OpenAI".
- Finally, these embeddings and document chunks are stored in the "Pinecone Vector Store".
- Sends Email Notifications: In a separate, seemingly independent branch, the workflow can send emails via Gmail.
- Sends Slack Messages: Another independent branch allows the workflow to post messages to Slack.
- Performs HTTP Requests: A generic HTTP Request node is available, potentially for direct API calls outside of the AI Agent's tool usage.
- Triggers on New Gmail Emails: The workflow can also be triggered by new emails received in a Gmail inbox.
- Executes Custom Code: A Code node is included for executing custom JavaScript logic within the workflow.
Prerequisites/Requirements
To run this workflow, you will need:
- n8n Instance: A running instance of n8n.
- OpenAI API Key: For the OpenAI Chat Model and OpenAI Embeddings.
- Anthropic API Key (Optional): If you choose to use the Anthropic Chat Model.
- Pinecone Account and API Key: For the Pinecone Vector Store.
- Gmail Account: For the Gmail Trigger and Gmail node.
- Slack Account: For the Slack node.
- Credentials: Appropriate n8n credentials configured for OpenAI, Anthropic (optional), Pinecone, Gmail, and Slack.
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure Credentials:
- Set up your OpenAI API Key credentials for the "OpenAI Chat Model" and "Embeddings OpenAI" nodes.
- Set up your Anthropic API Key credentials for the "Anthropic Chat Model" node if you intend to use it.
- Configure your Pinecone API Key and environment for the "Pinecone Vector Store" node.
- Set up your Gmail OAuth 2.0 credentials for the "Gmail Trigger" and "Gmail" nodes.
- Configure your Slack API Token credentials for the "Slack" node.
- Activate the Workflow: Ensure the workflow is active to start listening for triggers.
- Initial Document Ingestion (if applicable): If you are using the Pinecone Vector Store for RAG (Retrieval Augmented Generation), you'll need to run the "Default Data Loader" -> "Recursive Character Text Splitter" -> "Embeddings OpenAI" -> "Pinecone Vector Store" branch at least once to populate your vector database with relevant documents. This branch is currently not connected to the main chat flow, implying it's a separate setup step.
- Trigger the Workflow:
- Chat Trigger: Send a message to the configured chat platform that the "When chat message received" node is listening to.
- Gmail Trigger: Receive a new email in the configured Gmail account.
- Webhook: Make an HTTP POST request to the webhook URL provided by the "Webhook" node.
- Monitor Execution: Observe the workflow execution in n8n to see the AI agent in action, classifying messages, retrieving information, and potentially interacting with external services.
Related Templates
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chatβturn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. π What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing π§ Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation π Required Credentials OpenAI API Setup Go to platform.openai.com β API keys (sidebar) Click "Create new secret key" β Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai β Dashboard β API Keys Generate a new API key β Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) βοΈ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowβchat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" π― Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration β οΈ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions
AI-powered code review with linting, red-marked corrections in Google Sheets & Slack
Advanced Code Review Automation (AI + Lint + Slack) Whoβs it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting β all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0β10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your teamβs channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow β reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why itβs valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n β combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your teamβs review history transparent and centralized.
Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review
This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.