PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

This node operation, AI-Process Contract, is designed to analyze and extract structured information from contract documents using AI-powered processing. It supports multiple input methods for providing the contract document, including binary data from a previous node, base64 encoded content, or a URL pointing to the contract file.

Typical use cases include automating contract review workflows, extracting key contract terms and clauses, summarizing contract contents, or converting contract data into structured formats for further processing or integration with other systems.

For example, a user might upload a PDF contract in a prior step, then use this node to extract important details like parties involved, dates, obligations, and payment terms, outputting the results as JSON for downstream automation or compliance checks.

Properties

Name Meaning
Input Data Type Choose how to provide the contract document to process. Options:
- Binary Data: Use contract file from previous node
- Base64 String: Provide contract content as base64 encoded string
- URL: Provide URL to contract file
Input Binary Field (Shown if Input Data Type is Binary Data) Name of the binary property that contains the contract file. Default is "data".
Base64 Contract Content (Shown if Input Data Type is Base64 String) Base64 encoded contract content to be processed.
Contract URL (Shown if Input Data Type is URL) URL to the contract file to process.
Contract Name Name of the source contract file for reference purposes. Default is "contract.pdf".
Output Format Choose the output format for the processed contract data. Options:
- JSON: Return structured JSON data with extracted contract information
- Text: Return formatted text summary of extracted contract data
Output File Name (Shown if Output Format is Text) Name for the output file without extension. Default is "processed_contract".
Advanced Options Collection of additional options:
- Use Async Processing: Whether to use asynchronous processing for large contracts (default true).
- Profiles: Custom processing profiles for contract analysis (comma-separated list).

Output

The node outputs an array of items where each item contains a json field with the processed contract data.

  • If Output Format is set to JSON, the json field contains structured data extracted from the contract, such as identified clauses, parties, dates, and other relevant contract metadata.
  • If Output Format is set to Text, the json field contains a formatted textual summary of the extracted contract information.
  • The node does not explicitly mention binary output, so it primarily returns JSON-formatted data or text summaries.

Dependencies

  • Requires access to an external AI-powered contract processing service or API capable of analyzing contract documents and extracting structured data.
  • The node expects the contract document to be provided either as binary data, base64 string, or accessible via a URL.
  • Proper authentication credentials (such as an API key or token) must be configured in n8n to authorize requests to the external contract processing service.
  • Network connectivity is required if using URL input or calling external APIs.

Troubleshooting

  • Common Issues:

    • Providing an invalid or inaccessible URL will cause the node to fail fetching the contract file.
    • Incorrect base64 encoding or corrupted binary data may lead to processing errors.
    • Large contract files might time out or fail if asynchronous processing is disabled.
    • Missing or invalid API credentials can result in authorization errors.
  • Error Messages:

    • Errors related to file retrieval (e.g., "Failed to fetch contract file") suggest checking the URL or binary input.
    • Authentication errors indicate misconfigured or missing API keys.
    • Parsing or processing errors may require verifying the contract file format and content integrity.
  • Resolutions:

    • Verify URLs are correct and publicly accessible or accessible within your network.
    • Ensure base64 strings are properly encoded.
    • Enable asynchronous processing for large files.
    • Confirm API credentials are correctly set up in n8n.

Links and References

  • n8n Documentation
  • Relevant AI contract analysis service documentation (specific link depends on the external service used)
  • General resources on contract automation and AI-based document processing

Discussion