Compliance Report Logger and File Metadata Extractor - n8n Workflow

Use this robust n8n workflow to automatically capture compliance reports submitted via Google Forms, extract uploaded file metadata from Google Drive, and securely log the structured data into a MySQL database.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Compliance and Governance Professionals needing automated audit trails.

  • IT Administrators who manage incident reporting and data logging.

  • Users searching for advanced n8n templates that bridge Google Forms, Google Drive, and relational databases.

  • Developers needing a robust example of a multi-step data transformation n8n workflow.

Overview

Collecting structured data via Google Forms is easy, but integrating details about associated file uploads (like file names, sizes, and MIME types) requires an additional layer of automation. This specific n8n workflow solves this synchronization problem. It automatically starts when a new report is submitted, uses custom JavaScript within an n8n node to extract the critical file ID embedded in the form response, retrieves the actual file metadata from Google Drive, merges this metadata with the form submission details, and finally, ensures all normalized data is accurately logged into a MySQL table. This n8n template provides a reliable, end-to-end audit trail for critical compliance reports.

How it Works

This automation is initiated by an n8n trigger and executes a six-step process to ensure data integrity and full logging:


  1. Trigger on Submission: The n8n workflow begins with the Google Sheets form Trigger n8n node, which constantly monitors the designated Google Sheet for new rows added via a Google Form submission.

  2. Data Extraction: The Function n8n node immediately parses the incoming row. Crucially, it uses custom logic to extract the Google Drive File ID from the file upload URL provided by the form, preparing the metadata (reporter name, category, timestamp, folderid, etc.) for the next step.

  3. Retrieve File Metadata: The Google Drive n8n node utilizes the extracted file ID (folderid) to download the file metadata. This step generates binary data containing the necessary file name and MIME type.

  4. Combine Data: The Merge n8n node combines the structured text data from the Google Sheet (reporter details) with the binary file metadata (file name, MIME type) obtained from Google Drive, ensuring all relevant information is attached to a single item.

  5. Normalization: The Set n8n node, named 'Rename Fields', normalizes the combined JSON structure, renaming fields like fileName to filename to match the expected schema of the MySQL database. This ensures the data is perfectly clean before insertion.

  6. Final Logging: The final n8n node, Log to MySQL, takes the clean, structured data and inserts it as a new record into the specified reportlogs table, completing the execution of this complex n8n workflow.

Installation Guide

To successfully deploy this valuable n8n workflow, follow these setup steps:


  1. Import the n8n Workflow: Copy the provided JSON code and paste it into your n8n instance using the 'Import from JSON' function.

  2. Google Sheets Credentials: Configure the 'Google Sheets form Trigger' n8n node with OAuth2 credentials that grant access to the specific Google Sheet linked to your compliance form. Ensure you provide the Document ID (1U4MfFW06VMW0gW3fAkGFDvDnomb1j0E-0lbEkPlli0 in the provided n8n template).

  3. Google Drive Credentials: Set up the Google Drive OAuth2 credentials for the 'Get file uploaded metadata' n8n node. This account must have read access to the Google Drive folder where the form submissions upload files.

  4. MySQL Credentials: Configure the 'Log to MySQL' n8n node with the appropriate database credentials. Verify the table name (reportlogs) matches the intended target table in your database schema. Ensure the target table has columns corresponding to the renamed fields (e.g., reporter, category, timestamp, file_name).

  5. Activate the n8n Trigger: Set the Google Sheets form Trigger n8n node to 'Active' to begin monitoring for new form submissions.

Node Details

This n8n workflow leverages multiple powerful n8n node types for robust data handling:

Google Sheets form Trigger n8n node: The starting point of the n8n workflow. It is configured to monitor a specific Google Sheet for the rowAdded event, ensuring immediate execution upon form submission.
Function: Trigger on new report submission.
Key Configuration: Monitors Document ID 1U4MfFW06VMW0gW3fAkGFDvDnomb1j0E-0lbEkPlli0 and uses the everyMinute poll time.

Function n8n node (Extract googlesheet data): Performs crucial data transformation and cleansing.
Function: Parses the sheet data, extracts relevant fields, formats the timestamp, and most importantly, extracts the Google Drive File ID from the submission URL using regex.

Google Drive n8n node (Get file uploaded metadata): Interacts with Google Drive using the extracted ID.
Function: Downloads the file (temporarily) to retrieve binary metadata like the fileName and mimeType using the download operation.

Merge n8n node (Merge sheet & file data): Synchronizes the different data streams.
Function: Combines the text data payload (from the Google Sheet) with the binary file data (from Google Drive) using combineByPosition.

Set n8n node (Rename Fields): Prepares the final data structure for the database.
Function: Normalizes field names (e.g., fileName to filename) and filters the payload to include only essential fields required by the MySQL table schema.

MySQL n8n node (Log to MySQL): The final action n8n node.
* Function: Inserts the cleaned, merged data into the report_logs table, finalizing the data logging process for this n8n workflow.

Related n8n Workflows

Free

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

A Leading Software Engineering, Consulting & Outsourcing Services Company in USA & India serving Clients Globally since 1999.

Featured*