Skip to main content

Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets

Workflow preview

Workflow preview
100%
Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets preview
Open on n8n.io

1. Workflow Overview

Contract Template Generator with E Signature Integration What this workflow does This workflow automates the full contract lifecycle—from request intake to document generation and electronic signat...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.switch, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Yurie Ino.

Original n8n.io source

1.1 Workflow description

Title
Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets
Workflow name
Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets

Contract Template Generator with E-Signature Integration

What this workflow does

This workflow automates the full contract lifecycle—from request intake to document generation and electronic signature completion.

It receives contract requests via webhook, generates customized contract documents using AI, converts them into professionally formatted HTML, and sends them to an e-signature service for execution. The workflow pauses until signatures are completed, then records outcomes and notifies all parties accordingly.

This template is designed to reduce legal and operational overhead while ensuring consistent, trackable, and scalable contract management.


How it works

  1. Contract request intake
  • Triggered by a webhook or external form.
  • Validates required fields such as contract type and signatories.
  • Generates a unique contract ID for tracking.
  1. Contract data preparation
  • Normalizes contract metadata (dates, value, currency).
  • Stores party and term information for downstream processing.
  1. Template routing
  • Routes requests based on contract type (e.g., NDA, Service Agreement, Employment).
  • Applies predefined base terms for each contract category.
  • Falls back to a generic template if no specific type is matched.
  1. AI-powered contract generation
  • An AI agent generates a complete contract in Markdown format.
  • Suggests additional clauses and provides a brief risk assessment.
  • Ensures a consistent contract structure across types.
  1. Document processing
  • Converts Markdown into HTML for professional presentation.
  • Prepares signer metadata, signing order, and deadlines.
  1. E-signature request
  • Sends the document to an e-signature service (e.g., DocuSign, HelloSign).
  • Emails all signatories with signing instructions.
  • Uses a Wait node to pause execution until a signature webhook is received.
  1. Signature result handling
  • Processes webhook callbacks for completed, pending, or expired signatures.
  • Updates contract status accordingly.
  1. Completion & notifications
  • Logs signed or expired contracts to Google Sheets.
  • Sends confirmation, reminder, or expiration emails to all parties.
  • Responds to the original webhook with a structured status message.

Setup requirements

Before activating this workflow, make sure to:

  • Connect the contract request webhook to your intake form or system.
  • Configure contract types and base terms as needed.
  • Set up your e-signature provider webhook callback URL.
  • Prepare Google Sheets for contract logging.
  • Customize email me

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Contract Request Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 7 - Validate Contract Request

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 8 - Invalid Request Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Prepare Contract Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Route by Contract Type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 11 - NDA Template Base

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 12 - Service Agreement Base

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Employment Contract Base

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Generic Contract Base

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Merge Template Data

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 16 - AI Contract Advisor

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 17 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 18 - Parse AI Contract Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Convert Markdown to HTML

Type / Role
n8n-nodes-base.markdown - markdown
Config choices
Version 1

Block 20 - Prepare Signature Request

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Send to E-Signature Service

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 22 - Send Signing Request Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 23 - Wait for Signature Webhook

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 24 - Process Signature Result

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 31 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets
Complexity advanced
Nodes 31
Categories Document Extraction, Multimodal AI
Author Yurie Ino
Published 16 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11849/11849.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate AI-powered contracts with OpenAI, e-signature, Gmail and Sheets do?

Contract Template Generator with E Signature Integration What this workflow does This workflow automates the full contract lifecycle—from request intake to document generation and electronic signat...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, Multimodal AI use case.