ETL process automation agent (n8n) - Sofrecom Tunisia internship
# ETL Process Automation Agent — Sofrecom Tunisia Internship
Agentic conversational agent (n8n) that automates end-to-end Excel file processing: selecting a source file from Google Drive, applying real transformations (cleaning, formatting, dates, deduplication, calculated columns, pivot tables) on a **working copy** Google Sheet, answering questions/statistics computed deterministically (no numbers invented by the LLM), and final multi-destination loading (Local, Google Drive, SharePoint).
Project built as part of an internship at **Sofrecom Tunisia**.
## Table of contents
- Overview
- Architecture
- Repository contents
- Quick start
- Usage
- Known limitations
- Detailed documentation
## Overview
The user chats with the agent (n8n chat or webhook) in natural language. A router agent classifies each message into an intent, then routes to the matching sub-flow:
| Intent | What it does |
|---|---|
| `select_file` | Lists the raw Excel files available in Drive, or — if a name is given — creates a working copy and converts it to a Google Sheet |
| `transform` | Applies a real transformation on the working copy: text cleaning (upper/lower/proper case), date normalization, deduplication, calculated column, cell formatting, or pivot table |
| `question` | Answers a numeric question (count, sum, average, distinct values...) using statistics computed in JS on the real data — the LLM only phrases the answer |
| `visualisation` | Proposes a chart configuration from the same real statistics |
| `consult` | Returns the working-copy Google Sheet link at any time, for visual verification |
| `loading` | Exports the working copy to a clean `.xlsx` and delivers it to 3 destinations: local disk, `Final` Drive folder, SharePoint |
| `sharing` | Prepares a share message (email, Slack, Teams...) |
| `conversation` | Regular conversational exchange |
Each session's state (selected file, current working copy, status) is kept in a Postgres table (`etl_sessions`), so a conversation …