Intelligent Document Analysis and Summarization Flow - n8n Workflow

Use this advanced n8n workflow to automatically analyze new Google Drive documents, extract text using Foxit, identify organizations with Diffbot, and send a summary report via Gmail.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Researchers and Analysts: Who need rapid summarization and extraction of key entities (like organizations) from large volumes of documents.
Data Processing Specialists: Users requiring a reliable, automated pipeline for handling document inputs (PDFs, docs) and generating structured data.
n8n Automation Engineers: Looking for robust n8n templates demonstrating complex asynchronous polling logic (wait/retry loops) and custom code scripting.
Businesses utilizing Foxit and Diffbot: Who want to integrate these services seamlessly into a cloud storage pipeline.

Overview

Managing documents often involves tedious manual steps: uploading, waiting for text extraction, running analysis, and compiling reports. This powerful n8n workflow completely eliminates this friction. It activates instantly when a new file appears in a designated Google Drive folder. The core value lies in its intelligent automation stack, combining a reliable n8n trigger with robust enterprise APIs like Foxit for high-quality text extraction from complex documents, and Diffbot for sophisticated entity recognition and summarization.

Furthermore, this n8n workflow demonstrates critical advanced n8n techniques, specifically employing a polling loop using the If n8n node and Wait n8n node to manage asynchronous tasks (Foxit extraction), ensuring the process doesn't proceed until the document processing is finalized. The final output is a clean, structured email report delivered via Gmail, summarizing key organizational entities and providing a high-level summary of the document content.

How it Works

This intelligent document analysis pipeline is initiated by a specific n8n trigger and follows a highly structured path:


  1. Trigger Activation: The Fire on New File in Google Drive Folder n8n trigger constantly monitors a specified Google Drive folder. Upon detection of a new file, the n8n workflow begins.

  2. File Acquisition: The workflow immediately uses the Google Drive n8n node to download the file's binary data into the n8n execution context.

  3. Foxit Upload & Extraction: The document is uploaded to Foxit PDF Services using an HTTP Request n8n node. A subsequent HTTP Request n8n node then kicks off the asynchronous text extraction process.

  4. Asynchronous Polling Loop: The workflow enters a crucial polling loop: the Check Task HTTP Request n8n node periodically queries Foxit for the job status. The Is the job done? If n8n node checks if the status is COMPLETED. If not, the Wait n8n node introduces a delay before checking again, demonstrating powerful core logic flow control.

  5. Text Retrieval: Once complete, the Download Extracted Text HTTP Request n8n node retrieves the raw text data.

  6. Diffbot Analysis: The extracted text is sent to Diffbot using an HTTP Request n8n node, instructing it to identify entities (organizations) and generate a concise summary.

  7. Data Shaping: The Shape Data Code n8n node processes Diffbot's JSON output, specifically filtering for organization entities with high confidence scores (>= 0.85) and structuring the data for the final report.

  8. Report Generation: The Make Email Contents Code n8n node generates a complete HTML report, incorporating the list of extracted organizations, the Diffbot summary, and a link back to the original Google Drive file.

  9. Notification: Finally, the Gmail n8n node sends this comprehensive report to a specified recipient.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance via the 'Workflows' section.

  2. Google Drive Setup: Configure the Google Drive Trigger n8n node and Google Drive n8n node with your credentials. Ensure the trigger is linked to a specific folder URL you intend to monitor.

  3. Foxit Credentials: Set up a Generic Credential Type (HTTP Custom Auth) for Foxit, providing the necessary API keys or authentication headers for all Foxit-related HTTP Request n8n nodes (Upload to Foxit, Kick off Foxit Extract, Check Task, Download Extracted Text).

  4. Diffbot Credentials: Set up a Query Auth credential for the Diffbot HTTP Request n8n node (Get Diffbot Entities), using your Diffbot API token.

  5. Gmail Credentials: Configure the Gmail n8n node with your Gmail OAuth2 credentials to enable sending the final report. Adjust the recipient email address in the Gmail n8n node parameters.

  6. Activate: Save the n8n workflow and set it to 'Active' to start monitoring the Google Drive folder.

Node Details

Fire on New File in Google Drive Folder (Google Drive Trigger n8n node):
Function: Serves as the primary n8n trigger, initiating the automation when a new file is uploaded to the specified Google Drive folder.
Key Configuration: Event: fileCreated, monitors a specific folder URL.
Download File (Google Drive n8n node):
Function: Fetches the binary content of the newly created document using the file ID provided by the n8n trigger data.
Upload to Foxit (HTTP Request n8n node):
Function: Transfers the binary document file to the Foxit PDF Services API for backend processing. Configured for multipart-form-data.
Kick off Foxit Extract (HTTP Request n8n node):
Function: Initiates the text extraction task on the uploaded document ID, setting extractType to TEXT.
Is the job done? (If n8n node):
Function: Implements core logic flow control, checking if the status property returned by the polling endpoint is exactly COMPLETED.
Get Diffbot Entities (HTTP Request n8n node):
Function: Analyzes the extracted text. It sends content to Diffbot and requests both entities (for organizations) and a summary.
Shape Data (Code n8n node):
Function: Custom scripting to refine the Diffbot output. It filters the entities array, retaining only items flagged as organization with a confidence score greater than or equal to 0.85, and organizes the names and summary for subsequent steps in the n8n workflow.
Make Email Contents (Code n8n node):
Function: Generates the final HTML body for the email notification, dynamically incorporating the extracted organization names, document summary, and a link to the original file.
Gmail (Gmail n8n node):
* Function: Final action node. Sends the complete, formatted HTML report to the user, finalizing this complex n8n workflow.

Related n8n Workflows

Free

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

As an API Evangelist for Foxit, Raymond Camden specializes in the power of APIs, the web platform, and generative AI. A prolific author and seasoned presenter, he has been a prominent voice in the developer community for over two decades. You can explore his work and insights on his long-running blog at www.raymondcamden.com or reach him directly at [email protected].

Featured*