{"product_id":"n8n-sharepoint-docx-generator-outlook-emails-openai-pandoc","title":"n8n SharePoint DOCX Generator: Outlook Emails + OpenAI + Pandoc","description":"\u003ch3\u003eGenerate DOCX documents from Outlook requests—automatically\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your Microsoft Outlook mailbox for document-generation requests, matches each email to the right SharePoint template using OpenAI, fills it, converts it to \u003cstrong\u003eDOCX\u003c\/strong\u003e with \u003cstrong\u003ePandoc\u003c\/strong\u003e, uploads the result back to SharePoint, and emails the finished file to the requester.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDetects incoming requests:\u003c\/strong\u003e Triggers on every new email received in \u003cstrong\u003eMicrosoft Outlook\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates the request:\u003c\/strong\u003e Extracts sender, subject, and body text, then authorizes the request by checking the sender domain and a required subject\/body keyword.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a template catalog from SharePoint:\u003c\/strong\u003e Retrieves template metadata from a SharePoint list using the \u003cstrong\u003eMicrosoft Graph API\u003c\/strong\u003e and prepares a condensed catalog for matching.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSelects the best template with OpenAI:\u003c\/strong\u003e Uses \u003cstrong\u003eOpenAI\u003c\/strong\u003e to choose the most suitable template and extract structured fields (e.g., party names and dates) from the email.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles unmatched requests:\u003c\/strong\u003e If no template fits, replies in Outlook with available document types and why it could not match.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates filled content and converts to DOCX:\u003c\/strong\u003e Downloads the template from SharePoint, recreates it as filled \u003cstrong\u003eGitHub-flavored Markdown\u003c\/strong\u003e, then sends the Markdown to a \u003cstrong\u003ePandoc HTTP service\u003c\/strong\u003e to produce a DOCX.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUploads and responds:\u003c\/strong\u003e Uploads the generated DOCX back to SharePoint via Microsoft Graph and replies to the original Outlook email with the DOCX attached and a SharePoint link.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomate document creation (letters, forms, agreements) when users email request details.\u003c\/li\u003e\n  \u003cli\u003eCentralize template management in SharePoint while letting OpenAI map email text to the correct template and fields.\u003c\/li\u003e\n  \u003cli\u003eProvide a self-service “email → DOCX → SharePoint link” workflow for internal teams.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMicrosoft Outlook\u003c\/strong\u003e (read new emails, reply with attachments)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMicrosoft Graph API\u003c\/strong\u003e (list templates, upload generated DOCX)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOpenAI\u003c\/strong\u003e (template matching + structured field extraction)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePandoc HTTP service\u003c\/strong\u003e (Markdown → DOCX conversion)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/tools:\u003c\/strong\u003e if, set, code, no op, sticky note, http request\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eCategory:\u003c\/strong\u003e n8n automation workflow. Built for n8n users, automation engineers, and SaaS operators who need reliable, template-driven DOCX generation.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45865757311155,"sku":"N8N-18386","price":38.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/3QigPrVtYTJTisXWnKxom_xlhaAVZa.png?v=1787043916","url":"https:\/\/buyflowscripts.com\/products\/n8n-sharepoint-docx-generator-outlook-emails-openai-pandoc","provider":"N8N Commerce","version":"1.0","type":"link"}