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
- Download the workflow file using the Download button on this page.
- Open the n8n editor and select Import from File.
- Select the downloaded workflow JSON file to import it.
Step 2: Add credentials
- Add your OpenAI API Key in the OpenAI nodes.
- Add your Pinecone API Key and endpoint to the Pinecone nodes.
- Verify the Pinecone index name (default is n8n-demo) matches your index.
Step 3: Configure settings
- If needed, update node parameters such as API URLs or index names.
- Make sure the webhook URL from the When chat message received node is copied for your chat client.
Step 4: Test the workflow
- Manually trigger the workflow or send a test chat message to the webhook URL.
- Check the workflow run to confirm the GitHub OpenAPI JSON is fetched, split, embedded, and indexed without errors.
- Verify the chatbot replies with answers to your queries.
Step 5: Activate for production
- Enable (activate) the workflow in n8n to run automatically.
- Use the webhook URL in your front-end chatbot or client app to receive user questions live.
- Monitor workflow logs in n8n for any issues.
- 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.
