See llms.txt for all machine-readable content.

Back to Templates

Clean Ukrainian CRM client CSVs with OpenAI and web forms

Quick overview

This workflow accepts a CSV upload via an authenticated n8n form, normalizes Ukrainian client data with rule-based parsing, uses OpenAI to extract structured fields from free-text comments, merges duplicates by phone/email, and returns a cleaned CSV ready for CRM import.

How it works

  1. Receives a CSV file upload through an n8n form protected with Basic Auth.
  2. Reads the CSV, validates required columns and row limits, and normalizes fields like phone numbers (+380), city names, dates, and emails.
  3. Batches rows and sends each batch to the OpenAI Responses API to extract structured client details from names and comment text using a strict JSON schema.
  4. Merges the OpenAI output back into the normalized rows, flagging rows for manual review when the AI response is missing or malformed.
  5. Deduplicates clients by matching phone numbers and emails, flags near-matches (same name and city) as possible duplicates, and compiles a “що_перевірити” review column.
  6. Generates a Ukrainian-labeled output CSV and returns it to the browser as a downloadable file.

Setup

  1. Create and select an n8n Basic Auth credential for the upload form.
  2. Add an OpenAI API credential (OpenAI API) for the HTTP request to the Responses endpoint.
  3. Update the Config values (especially columns_json, model, batch_size, and row_limit) to match your source CSV headers and desired processing limits.
  4. Activate the workflow and use the form URL to upload a CSV and download the cleaned clients_clean.csv output.