Smart Contract Analysis Automation with UiPath, Maestro, and DataFabric

AgentHack submission type

Enterprise Agents

Name

Gabriel Moreno da Luz

Team name

Starta Team

Team members

@fehbarea

How many agents do you use

One agent

Industry category in which use case would best fit in (Select up to 2 industries)

Other sector

Complexity level

Intermediate

Summary (abstract)

We automated the entire contract review process from email reception to structured analysis using UiPath Agents, Maestro, and DataFabric.
No more manual reviews. Attachments are processed, analyzed, and responded to in a fully consistent and scalable way.
Perfect for legal, procurement, and compliance teams.

Detailed problem statement

Manual contract analysis is a slow, error-prone, and resource-intensive process.
In many companies, contracts arrive by email and must be manually opened, read, and interpreted by legal or compliance teams. This involves:

Opening and reading long PDF files, sometimes with dozens of pages

Identifying key clauses, such as payment terms, abusive conditions, and legal risks

Extracting parties’ information (names, CNPJs, roles)

Summarizing key points to support decision-making

Responding to the requester with insights or approval steps

This repetitive process:

Wastes valuable time from highly qualified professionals

Is vulnerable to human error and oversight

Creates bottlenecks in procurement, legal and compliance flows

Lacks consistency in the way contracts are reviewed and interpreted

Doesn’t scale with the volume of incoming contracts

The bigger the company, the worse the impact.

Detailed solution

Our automation was designed to solve a repetitive and high-risk problem: manual contract review. We built a robust, modular, and scalable architecture using UiPath, Maestro, DataFabric, and Gmail integration. Below is a breakdown of the process:

  1. Triggering the Process
    The automation is triggered by a Gmail Trigger. When a new email arrives and the subject contains the word “CONTRACT”, the process is initiated automatically. This eliminates the need for manual monitoring of inboxes.

  2. Attachment Validation
    The first step of the workflow is to verify whether the email contains an attachment:

If no attachment is found, the system immediately replies to the sender with a polite notification informing them that the contract was not attached.

If an attachment is found, the automation proceeds to the next step.

  1. Creating a Record in DataFabric
    A new record is created in a DataFabric entity designed specifically for contract analysis. This record includes:

The contract’s name (extracted from the email or attachment)

A placeholder field for the file itself

This structure allows centralization and tracking of all contract processing activities.

  1. Handling File Uploads
    Because UiPath has a known limitation of 10,000 characters in input arguments, sending large PDF files directly is not viable.

To solve this, we developed a separate workflow responsible for:

Downloading the attachment from the Gmail message

Uploading the file directly to the DataFabric entity

This decouples the file management from the main flow and ensures the solution handles large files reliably.

  1. Executing the UiPath Agent
    Once the contract is stored, we trigger a UiPath Agent, which is configured to:

Retrieve the contract content using the DataFabric record ID

Perform text extraction and preprocessing

Identify key legal and business information in the document:

Abusive or risky clauses

Payment terms and deadlines

Names, roles, and tax information of involved parties

The agent outputs a structured HTML summary with all extracted insights.

  1. Generating the HTML Summary
    To ensure consistency in the output, we created a predefined HTML template using UiPath Contexts. The template includes:

Header with contract information

Highlighted key points and risk areas

Structured formatting for easy reading

A visual score or status for decision-making

  1. Replying to the Original Email
    The final step of the process is sending an automated email back to the original sender. This email contains:

A summary of the analysis

The structured HTML with the detailed insights

Optional next steps if configured (e.g., request approval, forward to legal, etc.)

  1. Orchestration with Maestro
    All workflows (trigger, validation, file handling, agent execution, and email response) are orchestrated using UiPath Maestro, which ensures:

Clear monitoring of each step

Error handling and retries

Seamless data flow between components

Scalability for handling high volumes of contracts

Demo Video

Expected impact of this automation

The implementation of this automation brings measurable, high-impact results across multiple dimensions of business efficiency, cost savings, and risk reduction.

Drastic Reduction in Processing Time
Manual review of a contract used to take up to 2 full working days (approximately 960 minutes) including reading, identifying critical clauses, summarizing the content, and responding. With the automated workflow, this time was reduced to 2 minutes per contract — a 99.8% time reduction.

This means contracts can now be reviewed in near real-time, enabling faster procurement cycles, quicker legal validation, and overall business agility.

:money_bag: Significant Cost Savings
With a team of 7 professionals each earning R$ 45/hour, and a saving of 958 minutes per contract, the cost saving per document is approximately:

R$ 718.50 per contract

Assuming 70 contracts per month, this results in a monthly saving of R$ 50,295.00, or over R$ 600,000 per year, without compromising accuracy or quality.

:chart_increasing: Productivity Gains
The automation frees professionals from repetitive, manual tasks, allowing them to focus on strategic decision-making, legal analysis, and exception handling. This improves:

Team efficiency

Job satisfaction

Organizational output without increasing headcount

:puzzle_piece: Standardization and Consistency
Using UiPath Contexts and a predefined HTML template ensures that every contract analysis follows a consistent structure. This:

Reduces subjective interpretation

Ensures equal treatment of similar contracts

Facilitates auditability and compliance

:gear:Scalability and Volume Handling
The modular architecture using UiPath Agents and Maestro allows the process to scale horizontally. Whether it’s 70 contracts or 700, the system can handle the load with minimal human intervention, making it future-proof for business growth.

:locked_with_key: Improved Data Security and Traceability
By storing contract data and documents in DataFabric, the solution ensures:

Centralized, secure storage

Controlled access to sensitive documents

Complete traceability of who triggered, analyzed, and received each response

:bullseye: Strategic Business Value
Faster contract processing means faster deal closures, better negotiation positioning, and reduced operational bottlenecks in legal, procurement, and compliance teams. This contributes directly to:

Operational excellence

Business scalability

Competitive advantage

UiPath products used (select up to 4 items)

UiPath Agent Builder
UiPath Automation Cloud™
UiPath Data Service
UiPath Integration Service
UiPath Maestro
UiPath Orchestrator
UiPath Robots
UiPath Studio Web

Integration with external technologies

Gmail

Agentic solution architecture (file size up to 4 MB)

Sample inputs and outputs for solution execution

It’s located in other resources.

Other resources

Input example:

output example:

Presentation:

Other Attachments: