Skip to content

malihanawshin/Client-Onborading-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Client Onboarding Automation

An end-to-end automated client onboarding pipeline built with n8n, JavaScript, Supabase, Google Drive, and SendGrid. The system handles webhook intake, data validation, company enrichment, legacy ERP data import, welcome document generation, structured storage, tier-based email notifications, and a live pipeline dashboard.

Screenshot 2026-04-13 at 3 50 36 PM

Features

  • Webhook Intake & Validation — Accepts new client submissions via HTTP POST, validates all required fields server-side with structured error responses
  • Company Data Enrichment — Automatically enriches company profiles with industry, size, and location data via the Clearbit Autocomplete API
  • Legacy ERP CSV Import — Parses ISO-8859-1 semicolon-delimited CSV exports with German headers, detects duplicates, merges secondary contacts, and imports valid records
  • Welcome Document Generation — Generates a tier-specific branded HTML welcome document per client and uploads it to a dedicated Google Drive folder
  • Structured Database Storage — Stores all client data in Supabase PostgreSQL with ENUMs, constraints, and aggregation views
  • Tier-Based Notification Routing — Sends detailed emails for Enterprise clients, summary emails for Professional clients, and skips notifications for Basic tier
  • Pipeline Status Tracking — Updates client status at each pipeline stage: received → validated → enriched → stored → notified → completed
  • Live Dashboard — A webhook-served HTML dashboard showing client pipeline by tier and status with search and filtering

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     Two Entry Points                        │
├────────────────────────┬────────────────────────────────────┤
│   Webhook Form         │   Manual ERP Import Trigger        │
│   (Live submissions)   │   (Legacy CSV batch import)        │
└────────────┬───────────┴──────────────┬─────────────────────┘
             │                          │
             ▼                          ▼
      Validate Input             Fetch & Parse CSV
             │                   (Google Sheets export)
             ▼                          │
      Enrich via Clearbit         Map ERP Records
             │                          │
             ▼                    Check Duplicates /
      Generate Client Ref         Merge Secondary Contacts
             │                          │
             └──────────┬───────────────┘
                        ▼
              Generate Welcome Document
                        │
                        ▼
              Upload to Google Drive
                        │
                        ▼
              Store in Supabase
                        │
                  ┌─────┴──────┐
                  ▼            ▼
           Switch by Tier   Basic Tier
          ┌──────┴──────┐   (no email)
          ▼             ▼        │
   Enterprise     Professional   │
   Full Email     Summary Email  │
          │             │        │
          └──────┬──────┘        │
                 ▼               ▼
         Update Final Status (notified / completed)

Tech Stack

Component Technology
Workflow Automation n8n (self-hosted)
Database Supabase (PostgreSQL)
Document Storage Google Drive
Email Delivery SendGrid
Company Enrichment Clearbit Autocomplete API
Frontend Dashboard Vanilla HTML/JS served via n8n webhook

Setup

Prerequisites

  • n8n instance (local or cloud)
  • Supabase project
  • Google Drive OAuth credentials configured in n8n
  • SendGrid account with verified sender

Steps

  1. Import workflows — Import both JSON files from /workflows into your n8n instance
  2. Create credentials in n8n:
    • Supabase Service Role → HTTP Header Auth (apikey + service role JWT)
    • Supabase Anon → HTTP Header Auth (apikey + anon JWT)
    • SendGrid → HTTP Header Auth (Authorization: Bearer YOUR_KEY)
    • Google Drive → OAuth2 (use n8n built-in Google Drive credential)
  3. Run Supabase schema — Execute supabase/schema.sql in the Supabase SQL Editor
  4. Update webhook URLs — Set your n8n base URL in the dashboard Code node's apiUrl variable
  5. Activate workflows — Toggle both workflows to Active in n8n
  6. Test — Submit a test payload via curl or the intake form

Security Notes

  • All API keys and tokens are stored in n8n Credentials — never hardcoded in workflow nodes
  • Webhook endpoints can be secured with Header Auth in n8n webhook node settings
  • Supabase service role key is only used server-side in n8n — never exposed to the frontend
  • The dashboard uses the anon key with read-only Supabase queries

About

An end-to-end automated client onboarding pipeline built with n8n, Supabase, Google Drive, and SendGrid.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages