# josepozuelo/n8naiworkflow architecture

> Architecture diagram of the GitHub repository josepozuelo/n8naiworkflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josepozuelo/n8naiworkflow
- Repository: https://github.com/josepozuelo/n8naiworkflow

## Overview

##### Project type and purpose
- This is an open‑source educational tool/demo (“n8n AI workflow maker”) that takes a natural‑language description of an automation workflow, uses GPT to plan and generate a JSON representation of that workflow, and then lets you paste it into an n8n canvas.
- Key features:
- A set of n8n JSON workflows under n8n_AI_workflows
- Scripts/workflows to build auxiliary data stores (vector store in Pinecone, parameter DB in Firestore) under n8n_data_workflows
- A small REPL Python script (create_embeddings.py) to populate the Pinecone index

##### File structure
- Top‑level files:
- README.md – project overview & instructions
- n8n_node_list_full.json – raw list of all n8n nodes
- n8n_AI_workflows/ – JSON definitions for the main GPT‑driven workflow + sub‑workflows (“if node parameters,” “action nodes parameters,” etc.)
- n8n_data_workflows/ – JSON workflows that scrape/generate parameter metadata for each n8n node into Firestore
- Replit embedding script (mentioned but lives externally as create_embeddings.py)

##### README for additional insights
- Three logical parts:
a) Main n8n JSON workflows for generating the user’s requested automation
b) Embedding store creation (Python REPL → Pinecone vector DB)
c) Node‑parameter metadata generation (n8n_data_workflows → Firestore)
- External dependencies:
- OpenAI API (GPT calls inside n8n HTTP Request nodes)
- Pinecone (vector similarity store)
- Firestore (parameter metadata store)
- n8n cloud or self‑hosted instance (runtime & editor)

##### Detail without overthinking
- Every JSON workflow and external store as a separate component
- How each data store is populated and consumed

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Repository (Local/File System)"
        direction TB
        README["README.md"]:::repo
        RawList["n8n_node_list_full.json"]:::repo
        subgraph "n8n_AI_workflows"
            direction TB
            MainWF["Main GPT-driven Workflow"]:::repo
            IFWF["IF-node Parameters Sub-workflow"]:::repo
            ActionWF["Action-node Parameters Sub-workflow"]:::repo
        end
        subgraph "n8n_data_workflows"
            direction TB
            ScrapeWF["Scrape Node Parameters"]:::repo
            ExternalParamsWF["External Nodes Params"]:::repo
            SettingFieldsWF["Setting Fields"]:::repo
        end
        EmbedScript["create_embeddings.py"]:::repo
    end

    subgraph "Data Prep Layer (Offline)" 
        direction TB
        EmbedScript -->|"Generate embeddings"| Pinecone["Pinecone Vector Store"]:::external
        ScrapeWF -->|"Ingest metadata"| Firestore["Firestore Parameter Store"]:::external
        ExternalParamsWF -->|"Ingest metadata"| Firestore
        SettingFieldsWF -->|"Ingest metadata"| Firestore
    end

    subgraph "Runtime Layer" 
        direction TB
        User["User & n8n Editor (UI)"]:::runtime
        Runtime["n8n Runtime"]:::runtime
        User -->|"Click Execute"| Runtime
        Runtime -->|"Load Main Workflow JSON"| MainWF
        Runtime -->|"Load IF-node Sub-workflow"| IFWF
        Runtime -->|"Load Action-node Sub-workflow"| ActionWF
        Runtime -->|"Query GPT plan"| OpenAI["OpenAI GPT API"]:::external
        Runtime -->|"Query Pinecone for embeddings"| Pinecone
        Runtime -->|"Fetch parameter schemas"| Firestore
        Runtime -->|"Construct final n8n JSON output"| User
    end

    classDef dataprep fill:#D0E8FF,stroke:#333,stroke-width:1px;
    classDef runtime fill:#D0FFD0,stroke:#333,stroke-width:1px;
    classDef external fill:#FFE0B2,stroke:#333,stroke-width:1px;
    classDef repo fill:#EEEEEE,stroke:#333,stroke-width:1px;

    click MainWF "https://github.com/josepozuelo/n8naiworkflow/tree/main/n8n_AI_workflows/main_n8n_workflow"
    click IFWF "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_AI_workflows/IF_node_properties_n8n_workflow.json"
    click ActionWF "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_AI_workflows/action_nodes_properties_n8n_workflow.json"
    click ScrapeWF "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_data_workflows/Scrape_n8n_nodes_with_parameters.json"
    click ExternalParamsWF "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_data_workflows/N8n_nodes___external_nodes_parameters.json"
    click SettingFieldsWF "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_data_workflows/N8n_nodes___setting_fields.json"
    click RawList "https://github.com/josepozuelo/n8naiworkflow/blob/main/n8n_node_list_full.json"
    click README "https://github.com/josepozuelo/n8naiworkflow/blob/main/README.md"
```
