LLM with Advanced Text Summarization and Token Splitting

This workflow automates advanced text summarization using OpenAI’s GPT-3.5-turbo-0125 with token splitting. Key nodes include Manual Trigger (initiates workflow), Input Validation (sets input_text), Validate Input Text (ensures text ≥50 characters), Set Baseline (provides reference summary), Set Article (loads text), Summary Advanced (generates summary), Token Splitter (chunks text), Check Summary Success (verifies output), Evaluate to Baseline (compares with baseline), Format Success Response, Format Summary Error, and Format Validation Error (manage outputs). It uses OpenAI’s API for summarization and evaluation.\n\nSetup Requirements and Configuration: Install n8n by downloading from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow installation prompts or create a cloud account. Obtain an OpenAI API key from platform.openai.com: sign up, go to ‘API Keys,’ and generate a key. In n8n, import the provided JSON to create the workflow. Configure the OpenAI Chat Model and OpenAI Chat Model1 nodes by adding your API key under ‘Credentials’ > ‘OpenAI API’ in n8n’s interface. Replace the Manual Trigger with a Webhook Trigger for automation: set its path to ‘advanced-summarization,’ configure for POST requests, and optionally enable header authentication with a secure key. Ensure sufficient server resources for cloud or self-hosted setups to handle API requests.\n\nTesting and Deployment Steps: Test by sending a POST request to the Webhook URL (after replacing Manual Trigger) using Postman. Example JSON body: {'text': 'The dancing plague of 1518 in Strasbourg involved 50-400 people dancing uncontrollably...'} with the authentication header if enabled. Alternatively, use the Manual Trigger in n8n’s editor. The ‘Format Success Response’ node returns a 200 status with summary, evaluation_score, and summarization_method (advanced_chunking), or ‘Format Validation Error’ (400 status) for short/empty text, or ‘Format Summary Error’ (500 status) for API issues like invalid credentials. Monitor logs for errors like ‘Invalid API key’ or ‘Token splitting failed,’ and verify credentials or input length if issues occur. Activate the workflow in n8n for deployment. Validate outputs to confirm the summary aligns with the baseline and the evaluation_score is present.

$6.99

Workflow steps: 14

Integrated apps: manualTrigger, set, if

LLM with Advanced Text Summarization and Token Splitting  preview