AutomationFlowsAI & RAG › Summarize Pdfs with Groq AI and Convert to Audio Using Qwen Tts

Summarize Pdfs with Groq AI and Convert to Audio Using Qwen Tts

ByLaiba @laibazubair on n8n.io

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. User Uploads PDF : The workflow accepts a PDF via webhook. Extract Text : n8n extracts the text content from the PDF. Summarize with AI : The extracted text is passed to an AI…

Webhook trigger★★★★☆ complexityAI-powered17 nodesHTTP RequestGroq ChatAgentMemory Buffer Window
AI & RAG Trigger: Webhook Nodes: 17 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7470 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "Epn1xGw0ipAAedby",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Smart pdf summarizer with audio",
  "tags": [],
  "nodes": [
    {
      "id": "f18454b2-afb3-4df6-942c-98771c21fb5a",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1632,
        -896
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "=file"
      },
      "typeVersion": 1
    },
    {
      "id": "7b982a3d-e8a9-48ab-a9a0-8746bc440984",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1808,
        -896
      ],
      "parameters": {
        "path": "summarize-pdf",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 1
    },
    {
      "id": "12356a91-75ed-4099-a9c6-35458b578d1f",
      "name": "TTS Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        -896
      ],
      "parameters": {
        "url": "https://qwen-qwen-tts-demo.hf.space/gradio_api/call/predict",
        "method": "POST",
        "options": {
          "response": {
            "response": {}
          }
        },
        "jsonBody": "={\n  \"data\": [\n    \"{{ $json.summary }}\",\n    \"Dylan\"\n  ]\n} ",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "dfefaa26-a0a5-4e9c-91a6-ea1af4e82541",
      "name": "TTS Poll",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -496,
        -896
      ],
      "parameters": {
        "url": "=https://qwen-qwen-tts-demo.hf.space/gradio_api/call/predict/{{ $json.event_id }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "27856995-2ada-40bd-81df-957b526f9b33",
      "name": "Extract Audio URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -336,
        -896
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const raw = $json.data || $json || \"\";\n\n// Case 1: If it's already parsed JSON with data[0].url\nif (Array.isArray($json.data)) {\n  return {\n    json: {\n      audioUrl: $json.data[0]?.url || null,\n      rawJson: $json.data\n    }\n  };\n}\n\n// Case 2: Handle raw SSE text\nconst match = typeof raw === \"string\" ? raw.match(/data:\\s*(\\[[^\\]]+\\])/s) : null;\n\nif (match) {\n  try {\n    const parsed = JSON.parse(match[1]);\n    return {\n      json: {\n        audioUrl: parsed?.[0]?.url || null,\n        rawJson: parsed\n      }\n    };\n  } catch (e) {\n    return {\n      json: {\n        error: \"Failed to parse SSE JSON\",\n        raw\n      }\n    };\n  }\n}\n\n// Case 3: If neither worked\nreturn {\n  json: {\n    error: \"No audio URL found\",\n    raw\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9a375495-759d-44cd-a097-bf2368bb4360",
      "name": "Respond with Both",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        48,
        -896
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"summary\": \"{{ $json.summary }}\",\n  \"audioUrl\": \"{{ $json.audioUrl }}\"\n}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "80e57a89-6986-4b97-ad63-9b46f03420b7",
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1424,
        -896
      ],
      "parameters": {
        "language": "python",
        "pythonCode": "data = _input.first().json.text\nreturn {\"data\": data}"
      },
      "typeVersion": 2
    },
    {
      "id": "7751dff9-400d-4230-86ea-6f8f85ab341c",
      "name": "Groq Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -1376,
        -688
      ],
      "parameters": {
        "model": "openai/gpt-oss-20b",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "97f2f63e-acbb-4e42-9e0c-50f456e10c4a",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1248,
        -896
      ],
      "parameters": {
        "text": "=Summarize the data into 4-5 lines or less : {{ $json.data }}\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "a0e98280-7a13-46d7-853d-5831468a2329",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -128,
        -896
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b7efed1c-af46-4f2d-8da7-08b783248f19",
              "name": "audioUrl",
              "type": "string",
              "value": "={{ $json.audioUrl }}"
            },
            {
              "id": "924be2a2-9c3b-4d00-9e96-65b5d86e350c",
              "name": "summary",
              "type": "string",
              "value": "={{ $('summary').item.json.summary }}"
            }
          ]
        }
      },
      "executeOnce": false,
      "typeVersion": 3.4,
      "alwaysOutputData": false
    },
    {
      "id": "b11bc942-ecd6-4255-9b72-66d9478f4dfc",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1216,
        -656
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "3c3304a9-578c-4355-b036-c60f47291ebc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -1056
      ],
      "parameters": {
        "width": 640,
        "height": 80,
        "content": " ## SMART PDF SUMMARIZER WITH AUDIO PLAYBACK"
      },
      "typeVersion": 1
    },
    {
      "id": "d571385e-5410-43cd-981f-ddd0624fcec8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        -736
      ],
      "parameters": {
        "height": 80,
        "content": "- This will extract the pdf file from the frontend."
      },
      "typeVersion": 1
    },
    {
      "id": "f68b392f-7586-40fa-a0c3-43b244b903d9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -528
      ],
      "parameters": {
        "width": 256,
        "height": 192,
        "content": "- Use code node to get the data into the json output.\n\n- Use AI Agent with groq model (Open AI API) using free tokens and integrating simple memory to store the response (getting same results faster) "
      },
      "typeVersion": 1
    },
    {
      "id": "adae39f6-540f-4cdd-99fe-d6b3cf43d47b",
      "name": "summary",
      "type": "n8n-nodes-base.set",
      "position": [
        -912,
        -896
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={{ '{ \"summary\": \"' + $json.output + '\" }' }}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "6c5e1e3b-10a7-4cc7-a6f0-99374a18601e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -736
      ],
      "parameters": {
        "height": 112,
        "content": "- Use Hugging Face Qwen TTS demo for converting text to speech by using the summary & generate the audio."
      },
      "typeVersion": 1
    },
    {
      "id": "5aef29ff-3aa0-468f-8605-809fb31ecdc6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -752
      ],
      "parameters": {
        "height": 112,
        "content": "- Use code node to extract the audio url and send both the reponse into the webhook to generate the summary and audio on the frontend."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a6d4cacd-8d02-4e53-b70b-7e91c083f4e7",
  "connections": {
    "Code2": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summary": {
      "main": [
        [
          {
            "node": "TTS Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TTS Poll": {
      "main": [
        [
          {
            "node": "Extract Audio URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Respond with Both",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TTS Request": {
      "main": [
        [
          {
            "node": "TTS Poll",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Audio URL": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond with Both": {
      "main": [
        []
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. User Uploads PDF : The workflow accepts a PDF via webhook. Extract Text : n8n extracts the text content from the PDF. Summarize with AI : The extracted text is passed to an AI…

Source: https://n8n.io/workflows/7470/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

L&D_AgentsAI_ATIVO. Uses httpRequest, agent, googleCalendarTool, toolSerpApi. Webhook trigger; 93 nodes.

HTTP Request, Agent, Google Calendar Tool +9
AI & RAG

Lead Pipeline v3.0. Uses httpRequest, agent, lmChatAnthropic, toolThink. Webhook trigger; 77 nodes.

HTTP Request, Agent, Anthropic Chat +4
AI & RAG

My workflow 15. Uses httpRequest, memoryBufferWindow, agent, lmChatOpenAi. Webhook trigger; 74 nodes.

HTTP Request, Memory Buffer Window, Agent +5
AI & RAG

Hi! I'm Bruno — I’ve been building AI-powered workflows for n8n and Make for 2+ years, focused on smart automation and real conversational agents.

OpenAI, Agent, OpenAI Chat +5
AI & RAG

Flux. Uses lmChatOpenAi, agent, googleGemini, httpRequest. Webhook trigger; 67 nodes.

OpenAI Chat, Agent, Google Gemini +8