I need n8n workflow file to import into n8n: 1. n8n Setup n8n instance running…
- User
I need n8n workflow file to import into n8n:
- n8n Setup n8n instance running (self-hosted, desktop, or cloud) Access to n8n UI for importing and editing workflows
- Workflow Nodes Webhook node (entry point for your app to send files/URLs) IF node (to branch between document and video processing) Function node (to decode base64 file data) Extract Text node (for extracting text from documents) YouTube node (to fetch video details) YouTube Transcript node (to get transcript from YouTube video) AI Agent node (OpenAI GPT-4 for summarization) Function node (to create embeddings using OpenAI API) Supabase node (to store embeddings and metadata in your Supabase DB) Respond to Webhook node (to send the result back to your app)
- External Services & Credentials OpenAI API Key (for GPT-4 and embeddings) Supabase Project: Supabase URL Supabase Service Role Key (for secure inserts) Supabase table for storing documents and embeddings (see SQL below) YouTube Data API Key (if using YouTube node for transcript) n8n Credentials: Set up OpenAI credentials in n8n Set up Supabase credentials in n8n Set up YouTube credentials in n8n (if needed) this is the sample, I need the full fledge file: { "name": "AI Document Assistant - Complete Workflow", "nodes": [ { "parameters": { "path": "process-content", "options": { "responseMode": "lastNode" } }, "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 1, "position": [250, 300] }, { "parameters": { "conditions": { "string": [ { "value1": "={{ json.type }}", "operation": "equal", "value2": "document" } ] } }, "name": "Content Type Check", "type": "n8n-nodes-base.if", "typeVersion": 1, "position": [450, 300] }, { "parameters": { "functionCode": "// Decode base64 file data\nconst fileData = input.item.json.file_data;\nconst buffer = Buffer.from(fileData, 'base64');\nreturn { buffer, fileName: input.item.json.file_type };" }, "name": "Decode File", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [650, 200] }, { "parameters": { "operation": "extractText", "file": "={{ json.fileName }}" }, "name": "Extract Text", "type": "n8n-nodes-base.textExtract", "typeVersion": 1, "position": [850, 200] }, { "parameters": { "operation": "getVideo", "videoId": "={{ json.videoId }}" }, "name": "Get Transcript", "type": "n8n-nodes-base.youtubeTranscript", "typeVersion": 1, "position": [850, 400] }, { "parameters": { "model": "gpt-4", "prompt": "Split the following content into chunks of approximately 1000 tokens each, maintaining context and coherence. Return the chunks as a JSON array:\n\n{{ json.transcript }}", "options": { "temperature": 0.3, "maxTokens": 2000 } }, "name": "Chunk Content", "type": "n8n-nodes-base.aiAgent", "typeVersion": 1, "position": [1050, 300] }, { "parameters": { "functionCode": "// Process chunks and create embeddings\nconst chunks = JSON.parse({input.item.json.user_id,\n source_type: input.item.json.file_name || input.item.json };" }, "name": "Create Embeddings", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [1250, 300] }, { "parameters": { "operation": "upsert", "collection": "documents", "data": "={{ input.item.json.text || {supabase.rpc('match_documents', {\n query_embedding: queryEmbedding,\n match_threshold: 0.7,\n match_count: 5\n});\n\nif (error) throw error;\n\nreturn { ...json.text || json.similar_documents }}\n\nFormat the response as a JSON object with the following structure:\n{\n "summary": "...",\n "keyPoints": ["...", "..."],\n "topics": ["...", "..."],\n "connections": ["...", "..."]\n}", "options": { "temperature": 0.7, "maxTokens": 2000 } }, "name": "AI Analysis", "type": "n8n-nodes-base.aiAgent", "typeVersion": 1, "position": [1850, 300] }, { "parameters": { "functionCode": "// Generate semantic tags\nconst tagResponse = await fetch('', {\n method: 'POST',\n headers: {\n 'Authorization': ,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n model: 'gpt-4',\n messages: [\n {\n role: 'system',\n content: 'Generate relevant semantic tags for the following content. Return only the tags as a JSON array.'\n },\n {\n role: 'user',\n content: input.item.json.transcript\n }\n ],\n temperature: 0.3\n })\n});\n\nconst tagData = await tagResponse.json();\nconst tags = JSON.parse(tagData.choices[0].message.content);\n\n// Update document metadata\nconst { error } = await input.item.json.analysis,\n updated_at: new Date().toISOString()\n })\n .eq('id', input.item.json,\n tags,\n analysis: json.text || json.analysis.summary }}", "keyPoints": "={{ json.analysis.topics }}", "connections": "={{ json.tags }}", "similarDocuments": "={{ $json.similar_documents }}" } } }, "name": "Response", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1, "position": [2250, 300] } ], "connections": { "Webhook": { "main": [[{"node": "Content Type Check", "type": "main", "index": 0}]] }, "Content Type Check": { "main": [ [{"node": "Decode File", "type": "main", "index": 0}], [{"node": "Get Video", "type": "main", "index": 0}] ] }, "Decode File": { "main": [[{"node": "Extract Text", "type": "main", "index": 0}]] }, "Extract Text": { "main": [[{"node": "Chunk Content", "type": "main", "index": 0}]] }, "Get Video": { "main": [[{"node": "Get Transcript", "type": "main", "index": 0}]] }, "Get Transcript": { "main": [[{"node": "Chunk Content", "type": "main", "index": 0}]] }, "Chunk Content": { "main": [[{"node": "Create Embeddings", "type": "main", "index": 0}]] }, "Create Embeddings": { "main": [[{"node": "Store in Vector DB", "type": "main", "index": 0}]] }, "Store in Vector DB": { "main": [[{"node": "Semantic Search", "type": "main", "index": 0}]] }, "Semantic Search": { "main": [[{"node": "AI Analysis", "type": "main", "index": 0}]] }, "AI Analysis": { "main": [[{"node": "Generate Tags and Update", "type": "main", "index": 0}]] }, "Generate Tags and Update": { "main": [[{"node": "Response", "type": "main", "index": 0}]] } } }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.