πŸ”¬ Generate summaries from uploaded files using OpenAI Assistants API

⚑ 1,184 views Β· πŸ”¬ Document Extraction & Analysis

Description

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:

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

OpenAI API credential setup in n8n


πŸ”§ 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

    "assistant_id": "REPLACE_WITH_YOUR_ASSISTANT_ID"

    with your real ID (starts with asst_…). Save.


πŸš€ How it works

#NodePurpose
1On form submissionUser uploads a file (File).
2Upload FilePOST /v1/files (multipart) β†’ returns file_id.
3Create ThreadCreates a thread and attaches the uploaded file.
4Run AssistantStarts the run using your assistant_id.
5Poll Run Status β†’ Wait 2 s β†’ IFLoops until status = completed.
6Fetch SummaryGET /v1/threads/{thread_id}/messages β†’ summary JSON.

πŸ–ŒοΈ Customisation ideas


No community nodes required. Works on any n8n Cloud plan (Starter, Pro, Enterprise) or self-hosted Community Edition.

πŸ”— Nodes Used

HTTP Request, n8n Form Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup