Automated NDA Document Generation and Email Delivery - n8n Workflow

Use this powerful n8n workflow to automatically generate custom Non-Disclosure Agreements (NDAs) in DOCX format from web form submissions and email them instantly.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Startups or small businesses requiring rapid, personalized legal document generation (e.g., NDAs).
Organizations looking to automate lead capture and compliance processes.
Technical professionals exploring advanced n8n templates for document processing.
Users needing a powerful, custom n8n trigger and response mechanism.

Overview

This comprehensive n8n workflow provides a robust solution for end-to-end document automation. It serves two functions: acting as a web server to host a custom input form, and operating as a backend processor for document creation and delivery. This process solves the critical challenge of manually creating personalized legal documents (like NDAs) by accepting user data through a front-end form served directly by an n8n trigger. The data is then used to dynamically populate an HTML template, which is subsequently converted into a professional DOCX file using a specialized n8n node. This automated n8n workflow ensures instant delivery of crucial documentation, significantly speeding up onboarding and compliance.

How it Works

This n8n workflow operates in two main phases:


  1. Serving the Landing Page: The workflow is initially executed via the Landingpage Endpoint n8n trigger. This trigger handles the request for the form page. The subsequent Set Form Endpoint n8n node dynamically injects the correct URL for the data submission webhook into the HTML for Landingpage node. Finally, the Respond to Webhook n8n node serves this HTML content back to the user's browser, displaying the form.

  2. Processing Data and Generating Document: When a user submits the form, the data is sent to the FormData Endpoint n8n trigger (configured to receive POST data).

  3. The captured details (name, address, city, etc.) are passed to the NDA (HTML Version) n8n node. This node uses n8n expressions ({{ $json.body.firstName }}) to inject all user data into a pre-formatted legal HTML template, creating a personalized NDA.

  4. The HTML to Docx n8n node takes the structured HTML output and converts it into a high-quality DOCX document file, preparing it for distribution.

  5. Finally, the Send email n8n node sends the generated DOCX file as an attachment to the specified recipient using configured SMTP credentials, completing the n8n workflow.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'Import from JSON' option.

  2. Set up Credentials:

SMTP Credentials: You must configure credentials for the Send email n8n node (labeled 'SMTP account' in the JSON) to allow the n8n workflow to send emails. Replace the placeholder '[email protected]' with the actual recipient's email.
Custom JS API: The HTML to Docx n8n node requires credentials for a 'Coding Service' to function. Ensure this external service is correctly linked and configured.

  1. Activate Webhooks: Once credentials are set, activate both the Landingpage Endpoint and FormData Endpoint n8n trigger nodes. Use the URL generated by the Landingpage Endpoint to access the live form.

Node Details

Landingpage Endpoint (n8n trigger):
Function: Serves as the entry point for users, displaying the custom HTML form.
Key Configuration: Response Mode set to 'Response Node' to serve the generated HTML content.
Set Form Endpoint (n8n node):
Function: Dynamically captures the URL of the data submission webhook and stores it as a variable (FormEndpoint) so the client-side JavaScript knows where to submit the data.
HTML for Landingpage (n8n node):
Function: Contains the Tailwind-styled HTML and JavaScript for the public-facing form. It uses the FormEndpoint variable for submission.
FormData Endpoint (n8n trigger):
Function: Receives the POST submission containing the user's personal details (name, address, etc.) from the form.
NDA (HTML Version) (n8n node):
Function: The core document generation n8n node. It uses placeholders and expressions to merge the incoming user data into the NDA legal template, outputting a personalized HTML file ready for conversion.
HTML to Docx (Custom n8n node):
Function: Converts the personalized NDA HTML content into a downloadable DOCX (Word) file format. Essential for final delivery.
Send email (n8n node):
* Function: The final action in the n8n workflow. It uses SMTP to email the dynamically generated DOCX file as an attachment.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Featured*