Advanced AI demo (presented at AI Developers #14 meetup)
Needs changesWhat this workflow does
This AI workflow has 26 nodes and runs when an HTTP GET request hits its webhook URL (plus 2 other triggers). Along the way it connects Slack, Embeddings OpenAI, OpenAI Chat Model and Pinecone Vector Store and 3 more. It also calls googleapis.com over HTTP.
How it runs
Trigger: When an HTTP GET request hits its webhook URL (plus 2 other triggers).
- Whether email contains n8n (If): checks a condition and branches into true / false
- Assign label with AI (Text Classifier): classifies text into categories with AI, with model: OpenAI Chat Model
- Question and Answer Chain: answers questions over your documents (RAG), with model: OpenAI Chat Model; retriever: Vector Store Retriever
- Execute JavaScript (Code): runs custom JavaScript code
- Send message (Slack): uses Slack
- Add automation label (Gmail): add labels
- Add music label (Gmail): add labels
- Download PDF (HTTP Request): calls an HTTP API
- Insert into Pinecone vector store (Pinecone Vector Store): stores documents in the Pinecone vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
- Appointment booking agent (AI Agent): runs an AI agent, with model: Anthropic Chat Model; 2 tools (Book appointment, Get calendar availability); memory: Window Buffer Memory
Services it uses
HTTP calls to: googleapis.com
Before you upgrade to n8n 3.0
2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- HTTP Request Tool (legacy) in Get calendar availability, Book appointment: replace with HTTP Request node connected to the AI Agent's Tool input.
- AI Agent v1 (old agent modes) in Appointment booking agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
| Removed in 3.0 | Replace with |
|---|---|
| HTTP Request Tool (legacy) Get calendar availability, Book appointment | HTTP Request node connected to the AI Agent's Tool input |
| AI Agent v1 (old agent modes) Appointment booking agent (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (21)
- Slack
n8n-nodes-base.slack - Code
n8n-nodes-base.code - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Vector Store Retriever
@n8n/n8n-nodes-langchain.retrieverVectorStore - HTTP Request
n8n-nodes-base.httpRequest - No Operation, do nothing
n8n-nodes-base.noOp - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Question and Answer Chain
@n8n/n8n-nodes-langchain.chainRetrievalQa - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - HTTP Request Tool
@n8n/n8n-nodes-langchain.toolHttpRequest - AI Agent
@n8n/n8n-nodes-langchain.agent - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Gmail
n8n-nodes-base.gmail - Gmail Trigger
n8n-nodes-base.gmailTrigger - Text Classifier
@n8n/n8n-nodes-langchain.textClassifier - Webhook
n8n-nodes-base.webhook - If
n8n-nodes-base.if
From the author
This workflow was presented at the AI Developers meet up in San Fransico on 24 July, 2024. AI workflows 1. Categorize incoming Gmail emails and assign custom Gmail labels. This example uses the Text Classifier node, simplifying this usecase. 2. Ingest a PDF…