Advanced RAG Assistant for Slack using Pinecone and Azure OpenAI - n8n Workflow

Deploy a sophisticated RAG pipeline using an n8n workflow. Integrate Slack, Google Sheets, Pinecone vector database, and Azure OpenAI to build a context-aware AI Agent.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Teams needing a context-aware Slack bot for quick knowledge retrieval.
Developers building complex AI Agents using n8n and LangChain.


  • Organizations leveraging Azure OpenAI and Pinecone for enterprise RAG solutions.

Overview

This is an advanced n8n workflow designed for high-performance, context-aware slack automation. It combines the versatility of n8n's core capabilities with the power of LangChain AI Agents, Azure OpenAI services (for chat and embeddings), and Pinecone vector databases. The solution addresses the challenge of providing up-to-date, structured answers by leveraging multiple knowledge sources (Google Sheets for structured data, Pinecone for vector data) and refining the output through iterative AI Agents and sophisticated parsing. This n8n template is crucial for creating robust internal knowledge management systems accessible directly via Slack, reducing dependency on external tools.

How it Works


  1. Slack Activation: The n8n trigger activates when a message arrives in a configured Slack channel (using the Slack Trigger n8n node).

  2. User Context Retrieval: The workflow immediately fetches the sender’s profile using the Slack n8n node (Get a user's profile).

  3. Initial AI Processing (AI Agent 1): The information is passed to AI Agent1. This agent utilizes an Azure OpenAI Chat Model1 and multiple tools: Google Sheets (for structured data lookup) and Pinecone Vector Store2 (for vector search, powered by Embeddings Azure OpenAI2 and refined by Reranker Cohere1).

  4. Structured Context Creation & Indexing: AI Agent1 processes the query and generates a structured output using Structured Output Parser1. The resulting enriched context is then indexed into a temporary storage in the knowledge base using Pinecone Vector Store5.

  5. Context Refinement (AI Agent 3): The newly indexed context (from VStore 5) is passed to AI Agent3. This second agent uses the refined context as its input, leveraging Azure OpenAI Chat Model3 and using VStore 5 itself as a retrieval tool, ensuring high context fidelity.

  6. Robust Output Generation: AI Agent3 uses an Auto-fixing Output Parser to guarantee the final response adheres to a strict schema, ensuring reliability, which often uses the Structured Output Parser2 definition.

  7. Final Knowledge Indexing: After refinement and structure correction, the output data is formatted via the Edit Fields1 n8n node and finally indexed into a persistent vector store (Pinecone Vector Store3), completing the cycle of retrieval, refinement, and knowledge update.

Installation Guide


  1. Import the n8n Workflow: Copy the provided n8n workflow JSON. In your n8n instance, go to Workflows and select "New" -> "Import from JSON."

  2. Slack Credentials: Configure credentials for the Slack Trigger and the Slack n8n node (Get a user's profile). Ensure your Slack app has the necessary event subscriptions and scope permissions.

  3. Azure OpenAI Credentials: Set up Azure OpenAI credentials for the Chat Models (Azure OpenAI Chat Model1/3) and all three Embeddings n8n nodes (Embeddings Azure OpenAI2/3/5). You must specify the deployment names for your models.

  4. Pinecone Credentials: Configure Pinecone credentials (API Key and Environment) for the three Pinecone Vector Store n8n nodes (2, 3, and 5). Note the connection details for your target indexes.

  5. Google Sheets & Cohere: Set up credentials for the Get row(s) in sheet in Google Sheets n8n node and the Cohere service required by the Reranker Cohere n8n nodes.

  6. Test: Activate the n8n workflow and monitor the executions after triggering it via a message in your configured Slack channel.

Node Details

Slack Trigger: The initiating n8n node. It acts as the n8n trigger, listening for Slack events (like new channel messages) to start the automation.
AI Agent1 / AI Agent3 (LangChain): Core orchestration n8n node. These agents define the prompt template and the sequence of tools (Pinecone, Google Sheets) and models they use to process the Slack query.
Azure OpenAI Chat Model1 / 3 (LangChain): Provides the large language model capabilities used by the AI Agents for complex reasoning and generation within the n8n workflow.
Pinecone Vector Store2 / 3 / 5 (LangChain): Manages read (retrieval) and write (indexing) operations with the Pinecone vector database. Critical for the RAG functionality in this n8n template.
Embeddings Azure OpenAI2 / 3 / 5 (LangChain): Transforms input text into vector representations, a key step before data can be stored or searched in the Pinecone vector database.
Reranker Cohere1 / 3 (LangChain): Used after initial vector retrieval to re-sort context documents based on relevance, ensuring high-quality input for the LLM.
Get row(s) in sheet in Google Sheets: Acts as a specialized tool for AI Agent1, allowing the AI to retrieve structured data directly from Google Sheets based on the query.
Structured Output Parser1 / 2 (LangChain): Enforces a predefined data structure (schema) on the LLM’s output, ensuring that the n8n workflow handles reliable, predictable data.


  • Auto-fixing Output Parser (LangChain): A resilient n8n node that uses the LLM itself to correct outputs that fail to meet the required structure defined by Structured Output Parser2, maximizing workflow reliability.

Related n8n Workflows

Paid

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

Featured*