๐Ÿ”ฌ Normalize and validate CSV data with Anthropic/OpenAI, Postgres, Slack and Sheets

โšก 111 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

Overview

This workflow automates CSV data processing from upload to database insertion.

It accepts CSV files via webhook, uses AI to detect schema and standardize columns, cleans and validates the data, and stores it in Postgres. Errors are logged separately, and notifications are sent for visibility.


How It Works

  1. CSV Upload A webhook receives CSV files for processing.

  2. Validation The workflow checks if the uploaded file is a valid CSV format. Invalid files are rejected with an error report.

  3. Data Extraction The CSV is parsed into structured rows for further processing.

  4. Schema Detection AI analyzes the data to:

    • Infer column types
    • Normalize column names
    • Detect inconsistencies
  5. Data Normalization Values are cleaned and converted into proper formats (numbers, dates, booleans), with optional unit standardization.

  6. Data Quality Validation The workflow checks:

    • Type mismatches
    • Missing values
    • Statistical outliers
  7. Conditional Processing

    • Clean data โ†’ prepared and inserted into Postgres
    • Errors โ†’ detailed report generated
  8. Database Insert Valid data is stored in the configured Postgres table.

  9. Error Logging Errors are logged into Google Sheets for tracking and debugging.

  10. Notifications A Slack message is sent with processing results.


Setup Instructions

  1. Configure the webhook endpoint for CSV uploads
  2. Set your Postgres table name in the configuration node
  3. Add Anthropic/OpenAI credentials for schema detection
  4. Connect Slack for notifications
  5. Connect Google Sheets for error logging
  6. Configure error threshold settings
  7. Test with sample CSV files
  8. Activate the workflow

Use Cases


Requirements


Notes

๐Ÿ”— Nodes Used

Google Sheets, Postgres, Slack, Webhook, AI Agent, Anthropic Chat Model

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup