Back to portfolio

Case study / AI Infrastructure

Event-Driven AI & RAG Automation Pipeline

Self-hosted workflow orchestration and retrieval-augmented generation, designed for secure automation and cost-efficient scaling.

  • n8n
  • Supabase
  • GCP
  • LLMs

01 / System design

Architecture overview

Illustrative flow: an event starts an n8n workflow, which retrieves context from Supabase and sends it to a language model.01Event / webhook02n8n + Supabase03LLM responseIllustrative flow: an event starts an n8n workflow, which retrieves context from Supabase and sends it to a language model.01Event / webhook02n8n + Supabase03LLM response
Illustrative flow: an event starts an n8n workflow, which retrieves context from Supabase and sends it to a language model.

Context

Bring ingestion, retrieval, and generation into a single event-driven workflow while keeping infrastructure and model costs predictable.

Approach

Self-hosted n8n orchestrates events and ingestion. Supabase stores the documents and vector index, while model calls are handled by a downstream generation step. GCP hosts the workflow services.

Key takeaways

  • Keep ingestion and generation independently retryable.
  • Give each workflow only the credentials it needs.
  • Track latency, model usage, and cost per workflow run.