This workflow corresponds to n8n.io template #14574 — we link there as the canonical source.
This workflow follows the Agent → Form Trigger 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 →
{
"id": "zL1C61fbjCDWSyEN",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Book2Audio Pro",
"tags": [],
"nodes": [
{
"id": "80fd6739-afbd-4874-a37d-a5f35b26433a",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
480,
-160
],
"parameters": {
"options": {}
},
"executeOnce": false,
"typeVersion": 3
},
{
"id": "3c5a1477-d51b-4934-91f0-cae1f52120fd",
"name": "Upload file",
"type": "n8n-nodes-base.googleDrive",
"position": [
928,
-144
],
"parameters": {
"name": "={{ $('Loop Over Items').item.json.filename }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Loop Over Items').item.json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "6a12f645-c71d-4d82-8fcb-8e8016f442fd",
"name": "Create folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
-560,
-176
],
"parameters": {
"name": "={{ $('Book Pdf Upload').item.json[\"Book pdf\"][0].filename }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "/ (Root folder)"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 3
},
{
"id": "9c7f6ee5-eab2-40b1-a4af-6dca24433cb5",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
256,
-160
],
"parameters": {
"mode": "combineBySql",
"query": "SELECT \n i2.*,\n i1.*\nFROM input2 i2\nCROSS JOIN input1 i1;",
"options": {}
},
"typeVersion": 3.2
},
{
"id": "ecb774bc-4e40-43ef-84b4-4aaec7688f6c",
"name": "Book Pdf Upload",
"type": "n8n-nodes-base.formTrigger",
"position": [
-784,
-128
],
"parameters": {
"options": {},
"formTitle": "Turn your Book into Audio",
"formFields": {
"values": [
{
"fieldType": "file",
"fieldLabel": "Book pdf",
"requiredField": true
}
]
}
},
"typeVersion": 2.3
},
{
"id": "51f64354-517a-4614-b7c7-c55a3f9fa416",
"name": "Extract Book Content",
"type": "n8n-nodes-base.extractFromFile",
"position": [
-560,
-32
],
"parameters": {
"options": {},
"operation": "pdf",
"binaryPropertyName": "=Book_pdf"
},
"typeVersion": 1
},
{
"id": "40161bbf-4630-41bd-a047-705d108040e9",
"name": "Structure The Content",
"type": "n8n-nodes-base.code",
"position": [
48,
-32
],
"parameters": {
"jsCode": "// Get the structured JSON output from AI Agent\nconst agentOutput = $('AI Agent').item.json.output;\n\n// Capture the text BEFORE entering the new Function scope\nconst bookText = $('Extract Book Content').item.json.text;\n\n// Log the detected pattern for debugging\nconsole.log(\"Detected pattern:\", agentOutput.pattern);\n\n// Wrap the code\nconst wrappedCode = `\n ${agentOutput.code.replace('return output;', '')}\n \n // Wrap output in n8n format\n return output.map(item => ({ json: item }));\n`;\n\n// Pass bookText directly instead of $input\nconst fn = new Function('bookText', wrappedCode.replace(\n 'const text = $input.item.json.text;',\n 'const text = bookText;'\n));\n\nreturn fn(bookText);"
},
"typeVersion": 2
},
{
"id": "23262297-4b4d-47e6-b026-f566c0207941",
"name": "Generate audio",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
704,
-144
],
"parameters": {
"input": "={{ $json.text }}",
"options": {
"speed": 1
},
"resource": "audio"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "c9340557-2ff8-4e9f-aca8-b08697814844",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-304
],
"parameters": {
"width": 432,
"height": 640,
"content": "# Book2Audio Pro\n\n## Workflow brief\nBook2Audio Pro turns an uploaded book PDF into organized audio files. The workflow starts with a file upload form, extracts the book text, uses AI to detect the chapter structure and generate splitting logic, converts each chunk into audio, and then saves the final MP3 files into a Google Drive folder created for that upload.\n\n## How it works\n1. The user uploads a PDF through the form trigger.\n2. The PDF text is extracted from the uploaded binary file.\n3. An AI agent analyzes the first part of the book to detect chapter/section patterns and generates JavaScript code for structuring the full text.\n4. A code node executes the generated logic to split the book into chapters and smaller sentence-safe chunks.\n5. The text chunks are passed to OpenAI audio generation.\n6. Each generated audio file is uploaded to a Google Drive folder named after the uploaded book.\n\n## Quick Setup Guide\n\ud83d\udc49 [Demo & Setup Video](https://drive.google.com/file/d/1PkH1D164Xuju1hHLHayl8xTvYNJrhU34/view?usp=sharing)\n\ud83d\udc49 [Course](https://www.udemy.com/course/n8n-automation-mastery-build-ai-powered-enterprise-ready/?referralCode=2EAE71591D3BEB80F2CC)\n"
},
"typeVersion": 1
},
{
"id": "c82fbb11-0c64-472d-a1d7-593a3ee5dc9e",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-336,
-32
],
"parameters": {
"text": "=You are an expert at parsing book text.\n\nHere is a sample from the beginning of a book (first 3000 characters):\n{{ $json.text.slice(0, 3000) }}\n\nAnalyze the structure and detect how chapters/sections are marked (e.g. \"CHAPTER I.\", \"Chapter 1:\", \"1.\", \"Part One\", etc.).\n\nThen write a complete n8n Code node JavaScript function that:\n1. Accepts `$input.item.json.text` as the full book text\n2. Detects and splits the text into chapters/sections using the pattern you found\n3. Splits each chapter into chunks of max 3900 characters, breaking on sentence boundaries\n4. Returns an array of items with fields: chapter, part, title, text, filename (as .mp3)\n\nReturn ONLY the raw JavaScript code. No explanation, no markdown fences.",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "a4299820-8ff4-4166-a4a1-400514914ab8",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-336,
96
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "01c26a96-fd41-411a-b604-5f9e0c0c1eed",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-192,
96
],
"parameters": {
"jsonSchemaExample": "{\n \"pattern\": \"regex or description of what was detected\",\n \"code\": \"the actual JS code string to execute\"\n}"
},
"typeVersion": 1.3
},
{
"id": "69741b4a-f8bc-497e-9c00-3d487931a071",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
-304
],
"parameters": {
"color": 5,
"width": 432,
"height": 560,
"content": "\ud83d\udce5 INPUT & SETUP\n\nThe workflow begins with a user uploading a book in PDF format via a form trigger.\n"
},
"typeVersion": 1
},
{
"id": "4c727cad-e2cb-4eae-b6b8-2d531d574457",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-384,
-304
],
"parameters": {
"color": 5,
"width": 576,
"height": 560,
"content": "\ud83e\udde0 AI PROCESSING ENGINE\n\nAn AI agent analyzes the book content to detect chapter patterns and generate dynamic parsing logic.\n"
},
"typeVersion": 1
},
{
"id": "fe12ecf7-6060-4c1d-ace9-db05f630927b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
-304
],
"parameters": {
"color": 5,
"width": 896,
"height": 560,
"content": "\ud83d\udd0a AUDIO GENERATION & DELIVERY\n\nStructured text chunks are converted into audio and stored in Google Drive.\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "1bc8d353-d228-417b-b1fe-8ebf310bd02f",
"connections": {
"Merge": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Structure The Content",
"type": "main",
"index": 0
}
]
]
},
"Upload file": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Create folder": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Generate audio": {
"main": [
[
{
"node": "Upload file",
"type": "main",
"index": 0
}
]
]
},
"Book Pdf Upload": {
"main": [
[
{
"node": "Extract Book Content",
"type": "main",
"index": 0
},
{
"node": "Create folder",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Generate audio",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Extract Book Content": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Structure The Content": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}
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.
googleDriveOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Book2Audio Pro turns an uploaded book PDF into organized audio files. The workflow starts with a file upload form, extracts the book text, uses AI to detect the chapter structure and generate splitting logic, converts each chunk into audio, and then saves the final MP3 files…
Source: https://n8n.io/workflows/14574/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
HR Job Posting and Evaluation with AI. Uses formTrigger, airtable, googleDrive, stickyNote. Event-driven trigger; 36 nodes.
HR Job Posting and Evaluation with AI. Uses formTrigger, airtable, googleDrive, stickyNote. Event-driven trigger; 36 nodes.
The HR Job Posting and Evaluation with AI workflow is designed to streamline and enhance recruitment for technical roles, such as Automation Specialists. By automating key stages in the hiring process
This workflow turns Reddit pain points into emotionally-driven comic-style ads using AI. It takes in a product description, scrapes Reddit for real user pain points, filters relevant posts using AI, g