Templates / Generate summaries from uploaded files using OpenAI Assistants API

Generate summaries from uploaded files using OpenAI Assistants API

Ready for 3.0

by Sam Robertson Β· 1,252 views Β· created 2025-06-13 Β· Document Extraction, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (4)

What it does

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: 1. Stores the file in OpenAI. 2. Runs an Assistant with File Search and Code Interpreter enabled. 3. Polls until the run finishes. 4. 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 (replace YOUR-OPENAI-API-KEY with your OpenAI API secret key for your assistant, starts with sk-) - Name it: openAIApiHeader --- πŸ”§ Setup 1. Import the workflow JSON. 2. When n8n prompts for a credential, choose openAIApiHeader for every HTTP Request node. 3. Open Run Assistant β†’ Body and replace json "assistantid": "REPLACEWITHYOURASSISTANTID" 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 fileid. | | 3 | Create Thread | Creates a thread and attaches the uploaded file. | | 4 | Run Assistant | Starts the run using your assistantid. | | 5 | Poll Run Status β†’ Wait 2 s β†’ IF | Loops until status = completed. | | 6 | Fetch Summary | GET /v1/threads/{threadid}/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.

View the original on n8n.io β†’ Check your own copy

Get the weekly β€œwhat broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.