Generate summaries from uploaded files using OpenAI Assistants API
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER 🎉 Early Black Friday Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
Generate Summaries from Uploaded Files using OpenAI Assistants API
📑 Overview
Upload a document (PDF, DOCX, PPTX, TXT, CSV, JSON, or Markdown) and receive an AI-generated summary containing:
- title – 5-10 words
- summary – 1-2 sentences
- bullets – 3-5 key points
- tags – 3-6 short keywords
The workflow:
- Stores the file in OpenAI.
- Runs an Assistant with File Search and Code Interpreter enabled.
- Polls until the run finishes.
- Retrieves the summary JSON.
✅ Prerequisites
OpenAI Assistant
- Create one at <https://platform.openai.com/assistants>
- Enable File Search and Code Interpreter
- Note: The assistant ID starts with
asst_
OpenAI API credential setup in n8n
- Go to Credentials → New → HTTP Header Auth
- Header name:
Authorization - Value:
Bearer YOUR-OPENAI-API-KEY(replaceYOUR-OPENAI-API-KEYwith your OpenAI API secret key for your assistant, starts withsk-) - Name it:
openAIApiHeader
🔧 Setup
Import the workflow JSON.
When n8n prompts for a credential, choose
openAIApiHeaderfor every HTTP Request node.Open Run Assistant → Body and replace
"assistant_id": "REPLACE_WITH_YOUR_ASSISTANT_ID"with your real ID (starts with
asst_…). Save.
🚀 How it works
| # | Node | Purpose |
|---|---|---|
| 1 | On form submission | User uploads a file (File). |
| 2 | Upload File | POST /v1/files (multipart) → returns file_id. |
| 3 | Create Thread | Creates a thread and attaches the uploaded file. |
| 4 | Run Assistant | Starts the run using your assistant_id. |
| 5 | Poll Run Status → Wait 2 s → IF | Loops until status = completed. |
| 6 | Fetch Summary | GET /v1/threads/{thread_id}/messages → summary JSON. |
🖌️ Customisation ideas
- Edit the user prompt in Create Thread to change summary length, tone, or language.
- Add an HTTP Response node after Fetch Summary to return plaintext to the uploader.
- Replace the polling loop with OpenAI’s forthcoming wait-for-run endpoint when available.
No community nodes required. Works on any n8n Cloud plan (Starter, Pro, Enterprise) or self-hosted Community Edition.