{
  "openruna_format": "flow-graph-v1",
  "title": "RAG & GenAI App With WordPress Content",
  "slug": "rag-genai-app-with-wordpress-content",
  "source_filename": "1752_Postgres_Wordpress_Automation_Webhook.json",
  "nodes": [
    {
      "id": "When clicking ‘Test workflow’",
      "name": "When clicking ‘Test workflow’",
      "integration": "manual",
      "kind": "trigger"
    },
    {
      "id": "Embeddings OpenAI",
      "name": "Embeddings OpenAI",
      "integration": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "kind": "action"
    },
    {
      "id": "Default Data Loader",
      "name": "Default Data Loader",
      "integration": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "kind": "action"
    },
    {
      "id": "Token Splitter",
      "name": "Token Splitter",
      "integration": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "kind": "action"
    },
    {
      "id": "Embeddings OpenAI1",
      "name": "Embeddings OpenAI1",
      "integration": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "kind": "action"
    },
    {
      "id": "OpenAI Chat Model",
      "name": "OpenAI Chat Model",
      "integration": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "kind": "action"
    },
    {
      "id": "Postgres Chat Memory",
      "name": "Postgres Chat Memory",
      "integration": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "kind": "action"
    },
    {
      "id": "Respond to Webhook",
      "name": "Respond to Webhook",
      "integration": "respondToWebhook",
      "kind": "action"
    },
    {
      "id": "Set fields",
      "name": "Set fields",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Embeddings OpenAI2",
      "name": "Embeddings OpenAI2",
      "integration": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "kind": "action"
    },
    {
      "id": "Default Data Loader1",
      "name": "Default Data Loader1",
      "integration": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "kind": "action"
    },
    {
      "id": "Token Splitter1",
      "name": "Token Splitter1",
      "integration": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "kind": "action"
    },
    {
      "id": "Markdown1",
      "name": "Markdown1",
      "integration": "markdown",
      "kind": "action"
    },
    {
      "id": "Postgres",
      "name": "Postgres",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Aggregate",
      "name": "Aggregate",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "Aggregate1",
      "name": "Aggregate1",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "Aggregate2",
      "name": "Aggregate2",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "Wordpress - Get all posts",
      "name": "Wordpress - Get all posts",
      "integration": "wordpress",
      "kind": "action"
    },
    {
      "id": "Wordpress - Get all pages",
      "name": "Wordpress - Get all pages",
      "integration": "wordpress",
      "kind": "action"
    },
    {
      "id": "Set fields1",
      "name": "Set fields1",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Filter - Only published & unprotected content",
      "name": "Filter - Only published & unprotected content",
      "integration": "filter",
      "kind": "logic"
    },
    {
      "id": "HTML To Markdown",
      "name": "HTML To Markdown",
      "integration": "markdown",
      "kind": "action"
    },
    {
      "id": "Supabase - Store workflow execution",
      "name": "Supabase - Store workflow execution",
      "integration": "supabase",
      "kind": "action"
    },
    {
      "id": "Every 30 seconds",
      "name": "Every 30 seconds",
      "integration": "schedule",
      "kind": "trigger"
    },
    {
      "id": "Wordpress - Get posts modified after last workflow execution",
      "name": "Wordpress - Get posts modified after last workflow execution",
      "integration": "httpRequest",
      "kind": "action"
    },
    {
      "id": "Wordpress - Get posts modified after last workflow execution1",
      "name": "Wordpress - Get posts modified after last workflow execution1",
      "integration": "httpRequest",
      "kind": "action"
    },
    {
      "id": "Set fields2",
      "name": "Set fields2",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Filter - Only published and unprotected content",
      "name": "Filter - Only published and unprotected content",
      "integration": "filter",
      "kind": "logic"
    },
    {
      "id": "Loop Over Items",
      "name": "Loop Over Items",
      "integration": "splitInBatches",
      "kind": "logic"
    },
    {
      "id": "Set fields3",
      "name": "Set fields3",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Set fields4",
      "name": "Set fields4",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Store documents on Supabase",
      "name": "Store documents on Supabase",
      "integration": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "kind": "action"
    },
    {
      "id": "Store workflow execution id and timestamptz",
      "name": "Store workflow execution id and timestamptz",
      "integration": "supabase",
      "kind": "action"
    },
    {
      "id": "Aggregate documents",
      "name": "Aggregate documents",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "Postgres - Create documents table",
      "name": "Postgres - Create documents table",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Postgres - Create workflow execution history table",
      "name": "Postgres - Create workflow execution history table",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Merge Wordpress Posts and Pages",
      "name": "Merge Wordpress Posts and Pages",
      "integration": "merge",
      "kind": "logic"
    },
    {
      "id": "Merge retrieved WordPress posts and pages",
      "name": "Merge retrieved WordPress posts and pages",
      "integration": "merge",
      "kind": "logic"
    },
    {
      "id": "Postgres - Filter on existing documents",
      "name": "Postgres - Filter on existing documents",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Supabase - Delete row if documents exists",
      "name": "Supabase - Delete row if documents exists",
      "integration": "supabase",
      "kind": "action"
    },
    {
      "id": "Switch",
      "name": "Switch",
      "integration": "switch",
      "kind": "logic"
    },
    {
      "id": "When chat message received",
      "name": "When chat message received",
      "integration": "@n8n/n8n-nodes-langchain.chat",
      "kind": "trigger"
    },
    {
      "id": "Supabase - Retrieve documents from chatinput",
      "name": "Supabase - Retrieve documents from chatinput",
      "integration": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "kind": "action"
    },
    {
      "id": "AI Agent",
      "name": "AI Agent",
      "integration": "@n8n/n8n-nodes-langchain.agent",
      "kind": "action"
    },
    {
      "id": "Supabase Vector Store",
      "name": "Supabase Vector Store",
      "integration": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "kind": "action"
    }
  ],
  "edges": [
    {
      "from": "Switch",
      "to": "Supabase - Delete row if documents exists"
    },
    {
      "from": "Switch",
      "to": "Set fields4"
    },
    {
      "from": "AI Agent",
      "to": "Respond to Webhook"
    },
    {
      "from": "Postgres",
      "to": "Wordpress - Get posts modified after last workflow execution"
    },
    {
      "from": "Postgres",
      "to": "Wordpress - Get posts modified after last workflow execution1"
    },
    {
      "from": "Aggregate",
      "to": "Supabase - Store workflow execution"
    },
    {
      "from": "Markdown1",
      "to": "Store documents on Supabase"
    },
    {
      "from": "Aggregate1",
      "to": "Store workflow execution id and timestamptz"
    },
    {
      "from": "Aggregate2",
      "to": "Set fields3"
    },
    {
      "from": "Set fields",
      "to": "AI Agent"
    },
    {
      "from": "Set fields1",
      "to": "Filter - Only published & unprotected content"
    },
    {
      "from": "Set fields2",
      "to": "Filter - Only published and unprotected content"
    },
    {
      "from": "Set fields3",
      "to": "Loop Over Items"
    },
    {
      "from": "Set fields4",
      "to": "Loop Over Items"
    },
    {
      "from": "Loop Over Items",
      "to": "Markdown1"
    },
    {
      "from": "Loop Over Items",
      "to": "Postgres - Filter on existing documents"
    },
    {
      "from": "Every 30 seconds",
      "to": "Postgres"
    },
    {
      "from": "HTML To Markdown",
      "to": "Supabase Vector Store"
    },
    {
      "from": "Aggregate documents",
      "to": "Set fields"
    },
    {
      "from": "Supabase Vector Store",
      "to": "Aggregate"
    },
    {
      "from": "Wordpress - Get all pages",
      "to": "Merge Wordpress Posts and Pages"
    },
    {
      "from": "Wordpress - Get all posts",
      "to": "Merge Wordpress Posts and Pages"
    },
    {
      "from": "When chat message received",
      "to": "Supabase - Retrieve documents from chatinput"
    },
    {
      "from": "Store documents on Supabase",
      "to": "Aggregate1"
    },
    {
      "from": "Merge Wordpress Posts and Pages",
      "to": "Set fields1"
    },
    {
      "from": "Postgres - Create documents table",
      "to": "Postgres - Create workflow execution history table"
    },
    {
      "from": "When clicking ‘Test workflow’",
      "to": "Wordpress - Get all posts"
    },
    {
      "from": "When clicking ‘Test workflow’",
      "to": "Wordpress - Get all pages"
    },
    {
      "from": "Postgres - Filter on existing documents",
      "to": "Switch"
    },
    {
      "from": "Merge retrieved WordPress posts and pages",
      "to": "Set fields2"
    },
    {
      "from": "Supabase - Delete row if documents exists",
      "to": "Aggregate2"
    },
    {
      "from": "Supabase - Retrieve documents from chatinput",
      "to": "Aggregate documents"
    },
    {
      "from": "Filter - Only published & unprotected content",
      "to": "HTML To Markdown"
    },
    {
      "from": "Filter - Only published and unprotected content",
      "to": "Loop Over Items"
    },
    {
      "from": "Wordpress - Get posts modified after last workflow execution",
      "to": "Merge retrieved WordPress posts and pages"
    },
    {
      "from": "Wordpress - Get posts modified after last workflow execution1",
      "to": "Merge retrieved WordPress posts and pages"
    }
  ]
}