Normalize and validate CSV data with Anthropic/OpenAI, Postgres, Slack and Sheets
Ready for 3.0What this workflow does
This AI workflow has 15 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Anthropic Chat Model, Postgres, Slack and Google Sheets.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Workflow Configuration (Edit Fields (Set)): sets 3 fields: postgresTable, errorThreshold, slackChannel
- Check File Type (If): checks a condition and branches into true / false
- Extract CSV Data (Extract from File): extracts data from a file
- Error - Unsupported File Type (Edit Fields (Set)): sets 4 fields: error, fileName, mimeType…
- Schema Inference & Header Normalization (AI Agent): runs an AI agent, with model: Anthropic Chat Model; output parser: Structured Output Parser
- Generate Error Report (Edit Fields (Set)): sets 5 fields: errorReport, totalErrors, errorRate…
- Apply Normalization & Type Coercion (Code): runs custom JavaScript code
- Log to Google Sheets (Google Sheets): append or update
- Validate Data Quality (Code): runs custom JavaScript code
- Prepare Clean CSV Output (Edit Fields (Set)): sets 4 fields: cleanData, rowsProcessed, errorRate…
…plus 2 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - Postgres
n8n-nodes-base.postgres - Slack
n8n-nodes-base.slack - Google Sheets
n8n-nodes-base.googleSheets
From the author
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,…