{"id":"fSG22q8TeUtsGUGD","meta":{"instanceId":"workflow-403e8cbb","versionId":"1.0.0","createdAt":"2025-09-29T07:07:57.147787","updatedAt":"2025-09-29T07:07:57.147804","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"📄✨ Easy Wordpress Content Creation from PDF Document + Human In The Loop with Gmail Approval","nodes":[{"id":"77d8c73c-1cdd-4795-841c-29c3b85040e0","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1140,-860],"parameters":{"color":4,"width":461,"height":319,"content":"## Upload PDF and Extract Text"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"62dc4474-1803-4b6e-8fe5-530e9baf80f7","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1640,-860],"parameters":{"color":5,"width":649,"height":452,"content":"## Create Blog Post"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"b8da4206-f1b5-4a8f-b056-70c7558c825d","name":"Upload PDF","type":"n8n-nodes-base.formTrigger","position":[1220,-760],"webhookId":"6c4a4180-7206-469f-a645-f41824ccbf42","parameters":{"path":"pdf","options":{},"formTitle":"PDF2Blog","formFields":{"values":[{"fieldType":"file","fieldLabel":"Upload PDF File","multipleFiles":false,"requiredField":true,"acceptFileTypes":".pdf"}]},"formDescription":"Transform PDFs into captivating blog posts"},"typeVersion":2.1,"notes":"This formTrigger node performs automated tasks as part of the workflow."},{"id":"ef70bbe2-d66c-4c91-96cf-2d0500522e70","name":"Extract Text","type":"n8n-nodes-base.extractFromFile","position":[1420,-760],"parameters":{"options":{},"operation":"pdf","binaryPropertyName":"Upload_PDF_File"},"typeVersion":1,"notes":"This extractFromFile node performs automated tasks as part of the workflow."},{"id":"5de90f20-e0b3-4098-b5ae-c3bf5d724fcc","name":"gpt-4o-mini","type":"n8n-nodes-base.noOp","position":[1840,-600],"parameters":{"options":{"responseFormat":"text"}},"credentials":{"openAiApi":{"id":"jEMSvKmtYfzAkhe6","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"b6e33883-a13f-4bc8-bedc-18d93294ae75","name":"pollinations.ai","type":"n8n-nodes-base.httpRequest","position":[1520,300],"parameters":{"url":"{{ $env.BASE_URL }}","options":{}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"d928d841-8098-406e-ad66-cf7ca653a2c4","name":"Create Wordpress Post","type":"n8n-nodes-base.wordpress","onError":"continueRegularOutput","position":[1220,300],"parameters":{"title":"={{ $('Get Blog Post').item.json.title }}","additionalFields":{"status":"draft","content":"={{ $('Get Blog Post').item.json.content }}"}},"credentials":{"wordpressApi":{"id":"cOkzd5eeOiHaOXI2","name":"Wordpress account"}},"typeVersion":1,"alwaysOutputData":true,"notes":"This wordpress node performs automated tasks as part of the workflow."},{"id":"350cf732-037b-4e60-820e-4e38aecf7e57","name":"Upload Image to Wordpress","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","position":[1880,120],"parameters":{"url":"{{ $env.API_BASE_URL }}","method":"POST","options":{},"sendBody":true,"contentType":"binaryData","sendHeaders":true,"authentication":"{{ $credentials.predefinedCredentialType }}","headerParameters":{"parameters":[{"name":"Content-Disposition","value":"=attachment; filename=\"cover-image-{{ $('Create Wordpress Post').item.json.id }}.jpeg\""}]},"inputDataFieldName":"data","nodeCredentialType":"YOUR_CREDENTIAL_HERE"},"credentials":{"wordpressApi":{"id":"cOkzd5eeOiHaOXI2","name":"Wordpress account"}},"typeVersion":4.2,"alwaysOutputData":true,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"0f85ff07-13fb-40d5-8eee-7946f7064874","name":"Set Image on Wordpress Post","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","position":[2100,120],"parameters":{"url":"{{ $env.BASE_URL }}","method":"POST","options":{},"sendQuery":true,"authentication":"{{ $credentials.predefinedCredentialType }}","queryParameters":{"parameters":[{"name":"featured_media","value":"={{ $json.id }}"}]},"nodeCredentialType":"YOUR_CREDENTIAL_HERE"},"credentials":{"wordpressApi":{"id":"cOkzd5eeOiHaOXI2","name":"Wordpress account"}},"typeVersion":4.2,"alwaysOutputData":true,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"3bdc1e66-251f-4904-bbc2-dd4e667a4b40","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1140,40],"parameters":{"color":6,"width":1146,"height":521,"content":"## Create Wordpress Post and Add New Image\n{{ $env.WEBHOOK_URL }}"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"9d54b59e-5bf3-429b-856a-c3c1dcb25885","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1420,140],"parameters":{"color":7,"width":300,"height":340,"content":"## Create Post Image\n{{ $env.WEBHOOK_URL }}\n{{ $env.WEBHOOK_URL }}[your image description]"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"957b63d2-68af-4c44-b145-3460ed9ea0fc","name":"Send Error Message","type":"n8n-nodes-base.telegram","position":[1420,-240],"webhookId":"382a3b43-b83f-47b1-a276-67c6b98a441a","parameters":{"text":"=Error Creating Blog Post","chatId":"={{ $env.TELEGRAM_CHAT_ID }}","additionalFields":{"appendAttribution":false}},"credentials":{"telegramApi":{"id":"pAIFhguJlkO3c7aQ","name":"Telegram account"}},"typeVersion":1.2,"notes":"This telegram node performs automated tasks as part of the workflow."},{"id":"ef768593-053c-4a65-8eb9-b489cb115d2b","name":"Is there Title & Content?","type":"n8n-nodes-base.if","position":[1220,-400],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"aaf83c73-65f3-4a88-87f3-25b1acaf93ef","operator":{"type":"string","operation":"notEmpty","singleValue":true},"leftValue":"={{ $json.title }}","rightValue":""},{"id":"d9af5bce-f0fb-4c20-8b6a-b01a3bf3e1d1","operator":{"type":"string","operation":"notEmpty","singleValue":true},"leftValue":"={{ $json.content }}","rightValue":""}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"a6c70ec0-2809-4c38-a2dd-a16e0b44f23e","name":"Merge","type":"n8n-nodes-base.merge","position":[2380,280],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3,"notes":"This merge node performs automated tasks as part of the workflow."},{"id":"2562ab36-2fba-424e-8128-387591d2077e","name":"Markdown","type":"n8n-nodes-base.markdown","position":[2380,80],"parameters":{"html":"={{ $('Get Blog Post').item.json.content }}","options":{},"destinationKey":"YOUR_CREDENTIAL_HERE"},"typeVersion":1,"notes":"This markdown node performs automated tasks as part of the workflow."},{"id":"1739fe6e-4c0e-45b0-b368-6aab5dd79db9","name":"Human In The Loop Approve Blog Post","type":"n8n-nodes-base.gmail","position":[1780,-240],"webhookId":"48f44283-5f68-4d7a-a2d2-a42209d35032","parameters":{"sendTo":"joe@example.com","message":"={{ $json.content }}","options":{"limitWaitTime":{"values":{"resumeUnit":"minutes","resumeAmount":45}}},"subject":"=Approval Required for \"{{ $json.title }}\"","operation":"sendAndWait","approvalOptions":{"values":{"approvalType":"double"}}},"credentials":{"gmailOAuth2":{"id":"1xpVDEQ1yx8gV022","name":"Gmail account"}},"typeVersion":2.1,"notes":"This gmail node performs automated tasks as part of the workflow."},{"id":"ae015937-dffb-4445-a013-b22442850de7","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1640,-360],"parameters":{"color":4,"width":400,"height":340,"content":"## 💫🤩 New - Human In The Loop"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"aafee6b1-0273-429a-9002-e0406be6c281","name":"Is Approved?","type":"n8n-nodes-base.if","position":[2080,-240],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"316594d7-7ff6-4e39-bea3-45a11b9e750f","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $json.data.approved }}","rightValue":""}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"d7aa4ec8-e936-4e05-b94a-da42f6852591","name":"Gmail Final Blog","type":"n8n-nodes-base.gmail","position":[2640,280],"webhookId":"07692f3b-4e21-42d3-92dd-3dce5df3112f","parameters":{"sendTo":"joe@example.com","message":"={{ $('Get Blog Post').item.json.content }}","options":{},"subject":"={{ $('Get Blog Post').item.json.title }}"},"credentials":{"gmailOAuth2":{"id":"1xpVDEQ1yx8gV022","name":"Gmail account"}},"typeVersion":2.1,"notes":"This gmail node performs automated tasks as part of the workflow."},{"id":"cefad6b9-b061-4363-8221-34e15e262d00","name":"Telegram Partial Blog","type":"n8n-nodes-base.telegram","position":[2640,80],"webhookId":"77e3b2c9-79b7-4aa1-aa62-24da144c5f45","parameters":{"chatId":"={{ $env.TELEGRAM_CHAT_ID }}","operation":"sendPhoto","binaryData":true,"additionalFields":{"caption":"={{ $json.markdown.slice(0,400) }} ..."}},"credentials":{"telegramApi":{"id":"pAIFhguJlkO3c7aQ","name":"Telegram account"}},"typeVersion":1.2,"notes":"This telegram node performs automated tasks as part of the workflow."},{"id":"503ab66d-6924-4be4-8275-3bfa3b3bf69f","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[420,-860],"parameters":{"color":7,"width":680,"height":1420,"content":"## 🎯 Description\n\nThis n8n workflow automates the process of transforming PDF documents into engaging, SEO-friendly WordPress blog posts. It incorporates AI-powered text analysis, automatic image generation, and a human review step to ensure quality before publishing.\n\n## 🚀 How It Works\n\n### 🗂️ PDF Upload & Text Extraction  \n- Users upload a PDF document through a form trigger.  \n- The workflow extracts text from the uploaded file, ensuring compatibility with supported formats.\n\n### 🤖 AI-Powered Blog Post Generation  \n- The extracted text is analyzed by an AI model (GPT-based) to create a structured blog post.  \n- The AI generates:  \n  - A captivating SEO-friendly title.  \n  - Well-formatted HTML content, including an introduction, chapters with subheadings, and a conclusion.\n\n### 🎨 Image Creation & Integration  \n- An image is generated using **Pollinations.ai** based on the blog post title.  \n- The vibrant image is uploaded to WordPress and set as the featured image for the post.\n\n### 📝 WordPress Draft Creation  \n- A draft blog post is created on WordPress with the AI-generated title, content, and featured image.  \n\n### ✅ Human-in-the-Loop Approval  \n- The draft content is sent via Gmail to a reviewer for manual approval.  \n- If approved, the post is published on WordPress. If not, an error message is sent for troubleshooting.\n\n### 📢 Multi-Channel Notifications  \n- Once published, notifications are sent via Gmail and Telegram to relevant stakeholders.  \n\n## 🔧 Setup Steps\n\n### 🔑 Configure API Credentials  \n1. Set up API connections for:  \n   - OpenAI (for AI content generation).  \n   - WordPress (for post creation and media uploads).  \n   - Gmail (for sending approval emails).  \n   - Telegram (for notifications).  \n\n### ⚙️ Customize Workflow Parameters  \n2. Adjust the AI prompt to match your desired blog structure and tone.  \n3. Modify the image generation parameters to align with your branding needs.\n\n### 🧪 Test & Deploy  \n3. Test the workflow with sample PDFs to ensure:  \n   - Accurate text extraction.  \n   - Proper formatting of generated content.  \n   - Seamless approval and publishing processes.  \n\n\nThis workflow streamlines content creation while maintaining quality control through human oversight, making it an ideal solution for efficient blog management! 🎉\n"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"8ea57c7f-256b-4a89-b62f-3a6390fec719","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[360,-960],"parameters":{"width":2520,"height":1700,"content":"# 📄✨ Easy WordPress Content Creation from PDF Document + Human in the Loop with Gmail Approval"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"8cf6bd65-b025-45df-b556-a5fac970aa9b","name":"Get Blog Post","type":"n8n-nodes-base.code","position":[2080,-760],"parameters":{"jsCode":"// Get the HTML content from the previous node\nconst htmlContent = $input.first().json.text;\n\n// Use regex to extract the text between the first h1 tags\nconst titleRegex = /<h1>(.*?)<\\/h1>/s;\nconst match = htmlContent.match(titleRegex);\n\n// Extract the title or set to empty string if not found\nconst title = match ? match[1] : '';\n\n// Return the extracted title\nreturn [{\n  json: {\n    title: title,\n    content: htmlContent\n  }\n}];"},"typeVersion":2,"notes":"This code node performs automated tasks as part of the workflow."},{"id":"5e221628-d3b1-4242-bfa4-6a40599fa87b","name":"Write Blog Post","type":"n8n-nodes-base.noOp","position":[1740,-760],"parameters":{"text":"={{ $json.text }}","messages":{"messageValues":[{"message":"=Analyze the provided PDF article and create a compelling blog post. Follow these specifications:  \n\n## Title Requirements \n- Create an engaging, SEO-friendly title under 10 words \n- Must not contain a colon \n- Should capture the article's essence \n- Will be formatted as an H1 in the content  \n\n## Content Structure \n- Introduction (150-200 words)   \n  * Compelling hook   \n  * Topic context and importance   \n  * Preview of main points  \n- Main Content (6-8 chapters)   \n  * Each chapter requires:     \n    - Relevant H2 heading     \n    - 300-400 words of unique content     \n    - Specific topic focus     \n    - Source material quotes/data     \n    - Smooth transitions  \n    - Conclusion (200-250 words)   \n  * Key takeaways   \n  * Final thoughts/implications  \n\n## Formatting Guidelines \n- Use proper HTML tags throughout \n- Structure with <p> tags for paragraphs \n- Include appropriate spacing \n- Use <blockquote> for direct quotes \n- Maintain consistent formatting \n- Write in clear, professional tone \n- Break up long paragraphs \n- Use engaging subheadings \n- Include transitional phrases  \n\nThe content should be original, avoid direct copying, and maintain a consistent voice throughout. \nOnly return the bolg post and avoid any preamble or further explanation."}]},"promptType":"define"},"typeVersion":1,"notes":"This chainLlm node performs automated tasks as part of the workflow."},{"id":"58ff967f-e327-4719-8a95-bfe9df02d185","name":"Get Base64","type":"n8n-nodes-base.extractFromFile","position":[1880,500],"parameters":{"options":{},"operation":"binaryToPropery"},"typeVersion":1,"notes":"This extractFromFile node performs automated tasks as part of the workflow."},{"id":"a09a8b8b-ca30-4bbe-b3c9-a989e95d0fca","name":"Save Image to imgbb.com","type":"n8n-nodes-base.httpRequest","position":[2100,500],"parameters":{"url":"{{ $env.API_BASE_URL }}","method":"POST","options":{"redirect":{"redirect":{}}},"sendBody":true,"sendQuery":true,"contentType":"multipart-form-data","bodyParameters":{"parameters":[{"name":"image","value":"={{ $json.data }}"},{"name":"name","value":"="}]},"queryParameters":{"parameters":[{"name":"expiration","value":"600"},{"name":"key","value":"[your-imbgg-api-key-here]"}]}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"116a8bee-77b5-44c8-a9fd-df3776ddccd1","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1780,400],"parameters":{"color":7,"width":560,"height":300,"content":"## Save Image to imgbb\n{{ $env.API_BASE_URL }}"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."}],"active":false,"settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"versionId":"2d20cb21-b376-49c8-8dc8-cbdec4ddf543","connections":{"pollinations.ai":{"main":[[],[],[],[],[],[],[],[],[]]},"Upload Image to Wordpress":{"main":[[],[],[],[],[],[],[],[],[]]},"Set Image on Wordpress Post":{"main":[[],[],[],[],[],[],[],[],[]]},"Save Image to imgbb.com":{"main":[[],[],[],[],[],[],[],[],[]]},"Extract Text":{"main":[[]]},"gpt-4o-mini":{"main":[[]]},"Send Error Message":{"main":[[]]},"Telegram Partial Blog":{"main":[[]]},"Get Base64":{"main":[[]]}},"description":"Automated workflow: 📄✨ Easy Wordpress Content Creation from PDF Document + Human In The Loop with Gmail Approval. This workflow integrates 14 different services: stickyNote, formTrigger, httpRequest, wordpress, telegram. It contains 40 nodes and follows best practices for error handling and security.","notes":"Excellent quality workflow: 📄✨ Easy Wordpress Content Creation from PDF Document + Human In The Loop with Gmail Approval. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}