M/N Malek El Najjarproject system

PROJECT / 02 · AI AUTOMATION / BUSINESS OPERATIONS

AutoFlow

A lead comes in.
The system takes it from there.

AutoFlow connects public lead intake, PostgreSQL, n8n, structured AI analysis, authenticated write-back, and outbound notifications into one observable business workflow.

ROLEFull-stack · automation · integration · hardening
STACKNext.js · React · Neon Postgres · Prisma · n8n
AIOpenAI structured output
01Leadsubmitted
02Postgrespersisted
03n8norchestrates
04OpenAIanalyzes
05Scoringstructured JSON
06ADiscordhot lead
06BEmailevery lead
07Dashboardactivity log
AUTOMATIONFLOWONLINE
POSTGRES = SYSTEM OF RECORDPACKET ROUTE / LIVE MODEL
WHY I BUILT IT

AI is one stage in the workflow.
It is not the workflow.

The value of AutoFlow is in how the systems connect: durable state first, automation second, AI as a constrained transformation step, then authenticated application logic and retry-safe notifications.

DEMO / WHAT YOU CAN SEE

SYNTHETIC LEAD · REAL WORKFLOW SHAPE

Submit one lead and watch the whole chain react.

01Persist first.

The lead enters durable application state before automation starts doing work.

02n8n orchestrates.

The workflow validates input, calls the AI stage, and coordinates authenticated write-back.

03AI returns structured fields.

Score, temperature, urgency, category, summary, and recommendation are explicit outputs.

04Side effects stay retry-safe.

Discord and email paths are designed so a workflow retry does not duplicate notifications.

Try a synthetic lead
SYSTEM / ARCHITECTURE

INTAKE → PERSIST → ORCHESTRATE → ANALYZE → WRITE-BACK → NOTIFY

The automation engine is replaceable.
The data model is not.

01Lead intakepublic request
02PostgreSQLpersist first
03n8nworkflow state
04OpenAIstrict JSON result
05Internal APIsecret-auth write
06NotificationsDiscord + email
ENGINEERING / DECISIONS
01 / STATE

PostgreSQL is the system of record.

The dashboard and workflow share durable lead state instead of relying on transient automation-node memory.

02 / OUTPUT

AI output has a schema, not vibes.

Lead score, temperature, urgency, category, summary, and recommendation are validated structured fields.

03 / SECURITY

n8n writes through a dedicated internal API.

Machine-to-machine updates use separate secret authentication rather than the general user mutation surface.

04 / RETRIES

Notification side effects are idempotent.

Workflow retries cannot silently duplicate outbound alerts or emails.

DEMO / BOUNDARY
PUBLIC DEMO

Looks live without touching live data.

The demo uses synthetic records and has no path to the production database or notification side effects.

READ ONLY

Safety is structural.

The demo repository exposes reads only; mutation attempts do not alter the synthetic workspace.

ENGINEERED BY MALEK EL BADAWI EL NAJJAR

Automation becomes useful when retries, state, and side effects are designed on purpose.