Skip to main content

Generate summaries from uploaded files using OpenAI Assistants API

Workflow preview

Workflow preview
100%
Generate summaries from uploaded files using OpenAI Assistants API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.wait

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Sam Robertson .

Original n8n.io source

1.1 Workflow description

Title
Generate summaries from uploaded files using OpenAI Assistants API
Workflow name
Generate summaries from uploaded files using OpenAI Assistants API

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

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

    "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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2

Block 2 - Create Thread

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 3 - Poll Run Status

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 4 - Is Not Complete?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - Wait 2s

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 6 - Fetch Summary

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 7 - Run Assistant

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Upload File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow Generate summaries from uploaded files using OpenAI Assistants API
Complexity intermediate
Nodes 8
Categories Document Extraction, AI Summarization
Author Sam Robertson
Published 13 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4911/4911.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate summaries from uploaded files using OpenAI Assistants API do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.