# sndkr/n8n-workflows architecture

> Architecture diagram of the GitHub repository sndkr/n8n-workflows, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sndkr/n8n-workflows
- Repository: https://github.com/sndkr/n8n-workflows

## Overview

This repository combines a large n8n workflow collection with a searchable documentation application. The primary user journey is to browse or search indexed workflows, inspect details or diagrams, and download workflow JSON. The Python FastAPI/SQLite implementation is the README’s recommended path; the tree and sampled sources also show a Node.js implementation. Categorization and workflow import are supporting capabilities. Relationships reflect the excerpts and README; unsampled internals are not assumed.

Main entry points: [`api_server.py`](https://github.com/sndkr/n8n-workflows/blob/main/api_server.py) (FastAPI endpoints), [`workflow_db.py`](https://github.com/sndkr/n8n-workflows/blob/main/workflow_db.py) (Workflow index and queries), [`workflows`](https://github.com/sndkr/n8n-workflows/tree/main/workflows) (Workflow collection), [`create_categories.py`](https://github.com/sndkr/n8n-workflows/blob/main/create_categories.py) (Category builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browse and search"]
  node_ui["Search interface<br/>[index.html]"]
  node_workflows["Workflow collection"]
end

subgraph group_indexing["Index and categorize"]
  node_category_defs["Category definitions"]
  node_category_builder["Category builder"]
  node_category_data["Search categories"]
  node_importer["Workflow importer"]
end

subgraph group_python["Python application"]
  node_python_api["FastAPI endpoints<br/>[api_server.py]"]
  node_python_db["Workflow index and queries<br/>[workflow_db.py]"]
  node_sqlite[("SQLite FTS database")]
  node_launcher["Search launcher<br/>[run.py]"]
end

subgraph group_node["Node.js application"]
  node_node_server["Express endpoints<br/>[server.js]"]
  node_node_db["Workflow index and queries<br/>[database.js]"]
  node_node_indexer["Workflow indexer<br/>[index-workflows.js]"]
end

node_user(("Workflow browser"))
node_n8n["n8n CLI"]

node_user -->|"browses"| node_ui
node_ui -.->|"searches"| node_python_api
node_python_api -->|"serves page"| node_ui
node_python_api -->|"queries"| node_python_db
node_python_api -->|"downloads"| node_workflows
node_python_api -->|"requests diagram data"| node_python_db
node_launcher -->|"sets up index"| node_python_db
node_launcher -->|"starts API"| node_python_api
node_python_db -->|"indexes files"| node_workflows
node_python_db -->|"reads and writes"| node_sqlite
node_category_builder -->|"scans files"| node_workflows
node_category_builder -->|"loads mappings"| node_category_defs
node_category_builder -->|"generates"| node_category_data
node_user -->|"starts import"| node_importer
node_importer -->|"imports files"| node_workflows
node_importer -->|"runs CLI"| node_n8n
node_user -.->|"uses API"| node_node_server
node_node_server -->|"queries"| node_node_db
node_node_indexer -->|"indexes workflows"| node_node_db
node_node_db -->|"indexes files"| node_workflows

click node_ui "https://github.com/sndkr/n8n-workflows/blob/main/static/index.html"
click node_workflows "https://github.com/sndkr/n8n-workflows/tree/main/workflows"
click node_python_api "https://github.com/sndkr/n8n-workflows/blob/main/api_server.py"
click node_python_db "https://github.com/sndkr/n8n-workflows/blob/main/workflow_db.py"
click node_launcher "https://github.com/sndkr/n8n-workflows/blob/main/run.py"
click node_category_defs "https://github.com/sndkr/n8n-workflows/blob/main/context/def_categories.json"
click node_category_builder "https://github.com/sndkr/n8n-workflows/blob/main/create_categories.py"
click node_category_data "https://github.com/sndkr/n8n-workflows/blob/main/context/search_categories.json"
click node_importer "https://github.com/sndkr/n8n-workflows/blob/main/import_workflows.py"
click node_node_server "https://github.com/sndkr/n8n-workflows/blob/main/src/server.js"
click node_node_db "https://github.com/sndkr/n8n-workflows/blob/main/src/database.js"
click node_node_indexer "https://github.com/sndkr/n8n-workflows/blob/main/src/index-workflows.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_workflows,node_user toneBlue
class node_category_defs,node_category_builder,node_category_data,node_importer toneAmber
class node_python_api,node_python_db,node_sqlite,node_launcher toneMint
class node_node_server,node_node_db,node_node_indexer toneRose
class node_n8n toneIndigo
```

## Components

### Browse and search

- [Search interface](https://github.com/sndkr/n8n-workflows/blob/main/static/index.html): `static/index.html`
- [Workflow collection](https://github.com/sndkr/n8n-workflows/tree/main/workflows): `workflows`

### Index and categorize

- [Category definitions](https://github.com/sndkr/n8n-workflows/blob/main/context/def_categories.json): `context/def_categories.json`
- [Category builder](https://github.com/sndkr/n8n-workflows/blob/main/create_categories.py): `create_categories.py`
- [Search categories](https://github.com/sndkr/n8n-workflows/blob/main/context/search_categories.json): `context/search_categories.json`
- [Workflow importer](https://github.com/sndkr/n8n-workflows/blob/main/import_workflows.py): `import_workflows.py`

### Python application

- [FastAPI endpoints](https://github.com/sndkr/n8n-workflows/blob/main/api_server.py): `api_server.py`
- [Workflow index and queries](https://github.com/sndkr/n8n-workflows/blob/main/workflow_db.py): `workflow_db.py`
- **SQLite FTS database**
- [Search launcher](https://github.com/sndkr/n8n-workflows/blob/main/run.py): `run.py`

### Node.js application

- [Express endpoints](https://github.com/sndkr/n8n-workflows/blob/main/src/server.js): `src/server.js`
- [Workflow index and queries](https://github.com/sndkr/n8n-workflows/blob/main/src/database.js): `src/database.js`
- [Workflow indexer](https://github.com/sndkr/n8n-workflows/blob/main/src/index-workflows.js): `src/index-workflows.js`

### Other components

- **Workflow browser**
- **n8n CLI**

## Connections

- Workflow browser → Search interface: browses (evidence: `README.md`)
- Search interface → FastAPI endpoints: searches (evidence: `README.md`)
- FastAPI endpoints → Search interface: serves page (evidence: `api_server.py`)
- FastAPI endpoints → Workflow index and queries: queries (evidence: `api_server.py`)
- FastAPI endpoints → Workflow collection: downloads (evidence: `api_server.py`)
- FastAPI endpoints → Workflow index and queries: requests diagram data (evidence: `api_server.py`)
- Search launcher → Workflow index and queries: sets up index (evidence: `run.py`)
- Search launcher → FastAPI endpoints: starts API (evidence: `run.py`)
- Workflow index and queries → Workflow collection: indexes files (evidence: `README.md`)
- Workflow index and queries → SQLite FTS database: reads and writes (evidence: `workflow_db.py`)
- Category builder → Workflow collection: scans files (evidence: `create_categories.py`)
- Category builder → Category definitions: loads mappings (evidence: `README.md`)
- Category builder → Search categories: generates (evidence: `README.md`)
- Workflow browser → Workflow importer: starts import (evidence: `README.md`)
- Workflow importer → Workflow collection: imports files (evidence: `import_workflows.py`)
- Workflow importer → n8n CLI: runs CLI (evidence: `import_workflows.py`)
- Workflow browser → Express endpoints: uses API (evidence: `README.md`)
- Express endpoints → Workflow index and queries: queries (evidence: `src/server.js`)
- Workflow indexer → Workflow index and queries: indexes workflows (evidence: `src/index-workflows.js`)
- Workflow index and queries → Workflow collection: indexes files (evidence: `src/database.js`)
