Chat with GitHub API using n8n, Pinecone & OpenAI RAG

This n8n workflow enables a conversational interface to query the GitHub OpenAPI specification using Retrieval-Augmented Generation (RAG) techniques with Pinecone vector database and OpenAI. It solves the problem of navigating complex API docs manually by providing quick, accurate answers.
manualTrigger
httpRequest
vectorStorePinecone
+11
Workflow Identifier: 1701
NODES in Use: Manual Trigger, HTTP Request, Pinecone Vector Store, Default Data Loader, Recursive Character Text Splitter, When chat message received, AI Agent, OpenAI Chat Model, Window Buffer Memory, Vector Store Tool, Generate User Query Embedding, Pinecone Vector Store (Querying), Generate Embeddings, Sticky Note
Automate GitHub API chat with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow creates a chatbot that answers questions about the GitHub API by using its official OpenAPI JSON file.

It solves the problem of spending too much time searching through complex API docs. Instead, users get quick and correct answers from the workflow.

The chatbot works by processing the GitHub OpenAPI specs, storing them as searchable vectors in Pinecone, and answering queries with GPT-4o-mini.


How the workflow works – Inputs, Process, Output

Inputs

The starting input is the GitHub OpenAPI JSON file fetched by the HTTP Request node.

User questions come in through the When chat message received webhook node.

Processing Steps

  • Splits the large JSON into smaller text chunks with Recursive Character Text Splitter.
  • Generates vector embeddings for each chunk using OpenAI embeddings model.
  • Stores embeddings in Pinecone vector index with Pinecone Vector Store node.
  • When a user question arrives, converts it into an embedding.
  • Queries Pinecone for the most relevant API doc chunks matching the question.
  • Provides these chunks as context to the AI Agent node using GPT-4o-mini to generate answers.
  • Maintains conversation context using Window Buffer Memory node for better replies.

Output

The result is a chatbot reply that explains GitHub API endpoint details or usage clearly and precisely based on the official OpenAPI specs.


Who should use this workflow

This workflow is made for developers or anyone working with GitHub API who wants fast and accurate information about API endpoints.

No need to manually sift through complex JSON docs or OpenAPI files. It helps save time, reduce errors, and understand API usage quickly.


Tools and services used

  • n8n automation tool: To create and run the workflow.
  • OpenAI API: Generates vector embeddings and chat answers using GPT-4o-mini.
  • Pinecone vector database: Stores and searches vector embeddings for fast context retrieval.
  • GitHub OpenAPI JSON file: Source document describing GitHub REST API endpoints.
  • Webhook trigger: Receives user chat messages in real time.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor and select Import from File.
  3. Select the downloaded workflow JSON file to import it.

Step 2: Add credentials

  1. Add your OpenAI API Key in the OpenAI nodes.
  2. Add your Pinecone API Key and endpoint to the Pinecone nodes.
  3. Verify the Pinecone index name (default is n8n-demo) matches your index.

Step 3: Configure settings

  1. If needed, update node parameters such as API URLs or index names.
  2. Make sure the webhook URL from the When chat message received node is copied for your chat client.

Step 4: Test the workflow

  1. Manually trigger the workflow or send a test chat message to the webhook URL.
  2. Check the workflow run to confirm the GitHub OpenAPI JSON is fetched, split, embedded, and indexed without errors.
  3. Verify the chatbot replies with answers to your queries.

Step 5: Activate for production

  1. Enable (activate) the workflow in n8n to run automatically.
  2. Use the webhook URL in your front-end chatbot or client app to receive user questions live.
  3. Monitor workflow logs in n8n for any issues.
  4. Optionally, use a self-host n8n setup if running on your own server.

Customization ideas

  • Change the Pinecone index name to your own custom index in both insert and query nodes.
  • Switch OpenAI GPT models in the chat node to GPT-4 or GPT-3.5 based on desired cost and accuracy.
  • Add a node after the AI Agent to log chat conversations to Google Sheets or a database.
  • Adjust Recursive Character Text Splitter node settings to change chunk size or separators for better chunks.
  • Extend with additional HTTP Request nodes to add more API docs or other JSON specs.


Common errors and how to fix them

Error: “Failed to insert vectors into Pinecone.”
Cause: Wrong Pinecone index name or invalid API keys.
Fix: Double-check index name in nodes and update API credentials in n8n.

Error: “OpenAI API call limit exceeded.”
Cause: Too many embedding or chat requests.
Fix: Reduce requests or upgrade OpenAI plan.

Error: “Webhook not triggering.”
Cause: Incorrect webhook URL or inactive workflow.
Fix: Copy the correct webhook URL and ensure workflow is active.


Summary of results

✓ Fast chatbot answers from GitHub OpenAPI docs.

✓ Saves time by avoiding manual doc reading.

✓ Helps developers understand API calls better.

✓ Easily customize for other APIs or data sources.


Automate GitHub API chat with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, but this workflow is set up specifically for Pinecone. Using others like Weaviate or Faiss requires changing node configurations.
Yes, generating embeddings and chat completions uses API credits. Manage usage by controlling queries and model types.
Pinecone stores vectors securely and OpenAI uses encrypted connections. Keeping API keys private is important.
Pinecone indexes scale well for many queries but the n8n instance may need autoscaling for high loads.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.