{
    "name": "Idea to IG Carousel",
    "nodes": [
        {
            "parameters": {
                "content": "Automated workflow: Idea to IG Carousel",
                "height": 530,
                "width": 1100,
                "color": 5
            },
            "id": "54134b2f-ee07-4ee3-8934-091e0cc39c6d",
            "name": "Sticky Note",
            "type": "n8n-nodes-base.stickyNote",
            "typeVersion": 1,
            "position": [
                -480,
                -240
            ]
        },
        {
            "parameters": {
                "httpMethod": "POST",
                "path": "idea-to-ig-carousel"
            },
            "id": "0557fff1-0a8e-4013-b7ec-ac586a69ab59",
            "name": "Webhook Trigger",
            "type": "n8n-nodes-base.webhook",
            "typeVersion": 1,
            "position": [
                -300,
                0
            ]
        },
        {
            "parameters": {
                "chunkSize": 400,
                "chunkOverlap": 40
            },
            "id": "dd6a352a-89f3-4456-b938-f407c2702e16",
            "name": "Text Splitter",
            "type": "@n8n\/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
            "typeVersion": 1,
            "position": [
                -130,
                0
            ]
        },
        {
            "parameters": {
                "model": "text-embedding-3-small",
                "options": []
            },
            "id": "b20d9054-64c5-4e92-9e49-5c7f5808590a",
            "name": "Embeddings",
            "type": "@n8n\/n8n-nodes-langchain.embeddingsOpenAi",
            "typeVersion": 1,
            "position": [
                70,
                0
            ],
            "credentials": {
                "openAiApi": {
                    "id": "OPENAI_API",
                    "name": "OpenAI"
                }
            }
        },
        {
            "parameters": {
                "mode": "insert",
                "options": [],
                "indexName": "idea_to_ig_carousel"
            },
            "id": "1a52a5a3-2ce3-406f-9ad1-98b30266be23",
            "name": "Weaviate Insert",
            "type": "@n8n\/n8n-nodes-langchain.vectorStoreWeaviate",
            "typeVersion": 1,
            "position": [
                270,
                0
            ],
            "credentials": {
                "weaviateApi": {
                    "id": "WEAVIATE_API",
                    "name": "Weaviate account"
                }
            }
        },
        {
            "parameters": {
                "indexName": "idea_to_ig_carousel"
            },
            "id": "72a71b2d-bb5d-4545-9482-a524dda1e1b0",
            "name": "Weaviate Query",
            "type": "@n8n\/n8n-nodes-langchain.vectorStoreWeaviate",
            "typeVersion": 1,
            "position": [
                270,
                -180
            ],
            "credentials": {
                "weaviateApi": {
                    "id": "WEAVIATE_API",
                    "name": "Weaviate account"
                }
            }
        },
        {
            "parameters": {
                "name": "Weaviate",
                "description": "Vector context"
            },
            "id": "64a8d0c4-6d19-4726-a74c-7220105d0ce9",
            "name": "Vector Tool",
            "type": "@n8n\/n8n-nodes-langchain.toolVectorStore",
            "typeVersion": 1,
            "position": [
                450,
                -180
            ]
        },
        {
            "parameters": [],
            "id": "fb391d71-831a-4785-a6f8-fcb394893cd3",
            "name": "Window Memory",
            "type": "@n8n\/n8n-nodes-langchain.memoryBufferWindow",
            "typeVersion": 1.3,
            "position": [
                450,
                -40
            ]
        },
        {
            "parameters": {
                "options": []
            },
            "id": "a37dc046-d17e-44b1-b0af-3d40f8a7cd3a",
            "name": "Chat Model",
            "type": "@n8n\/n8n-nodes-langchain.lmChatAnthropic",
            "typeVersion": 1,
            "position": [
                450,
                -340
            ],
            "credentials": {
                "anthropicApi": {
                    "id": "ANTHROPIC_API",
                    "name": "Anthropic"
                }
            }
        },
        {
            "parameters": {
                "promptType": "define",
                "text": "Process the following data for task 'Idea to IG Carousel':\n\n{{ $json }}",
                "options": {
                    "systemMessage": "You are an assistant for Idea to IG Carousel"
                }
            },
            "id": "20b5f76e-141a-412b-9b8d-9d2e2ec88641",
            "name": "RAG Agent",
            "type": "@n8n\/n8n-nodes-langchain.agent",
            "typeVersion": 1,
            "position": [
                720,
                -40
            ]
        },
        {
            "parameters": {
                "operation": "append",
                "documentId": {
                    "__rl": true,
                    "value": "SHEET_ID",
                    "mode": "list",
                    "cachedResultName": "Idea to IG Carousel"
                },
                "sheetName": {
                    "__rl": true,
                    "value": "Log",
                    "mode": "list",
                    "cachedResultName": "Log"
                },
                "columns": {
                    "mappingMode": "defineBelow",
                    "value": {
                        "Status": "={{$json[\"RAG Agent\"].text}}"
                    },
                    "schema": []
                }
            },
            "id": "f4779a50-0a27-4916-889c-b4164139db72",
            "name": "Append Sheet",
            "type": "n8n-nodes-base.googleSheets",
            "typeVersion": 4,
            "position": [
                930,
                -40
            ],
            "credentials": {
                "googleSheetsOAuth2Api": {
                    "id": "SHEETS_API",
                    "name": "Google Sheets account"
                }
            }
        },
        {
            "parameters": {
                "channel": "#alerts",
                "text": "Idea to IG Carousel error: {$json.error.message}"
            },
            "id": "5d1c9252-8f74-40d5-aae1-b1ad869d16d1",
            "name": "Slack Alert",
            "type": "n8n-nodes-base.slack",
            "typeVersion": 1,
            "position": [
                930,
                120
            ],
            "credentials": {
                "slackApi": {
                    "id": "SLACK_API",
                    "name": "Slack"
                }
            }
        }
    ],
    "connections": {
        "Webhook Trigger": {
            "main": [
                [
                    {
                        "node": "Text Splitter",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Window Memory",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Text Splitter": {
            "main": [
                [
                    {
                        "node": "Embeddings",
                        "type": "main",
                        "index": 0
                    }
                ]
            ],
            "ai_textSplitter": [
                [
                    {
                        "node": "Weaviate Insert",
                        "type": "ai_textSplitter",
                        "index": 0
                    }
                ]
            ]
        },
        "Embeddings": {
            "ai_embedding": [
                [
                    {
                        "node": "Weaviate Insert",
                        "type": "ai_embedding",
                        "index": 0
                    },
                    {
                        "node": "Weaviate Query",
                        "type": "ai_embedding",
                        "index": 0
                    }
                ]
            ]
        },
        "Weaviate Insert": {
            "ai_document": [
                []
            ]
        },
        "Weaviate Query": {
            "ai_vectorStore": [
                [
                    {
                        "node": "Vector Tool",
                        "type": "ai_vectorStore",
                        "index": 0
                    }
                ]
            ]
        },
        "Vector Tool": {
            "ai_tool": [
                [
                    {
                        "node": "RAG Agent",
                        "type": "ai_tool",
                        "index": 0
                    }
                ]
            ]
        },
        "Window Memory": {
            "ai_memory": [
                [
                    {
                        "node": "RAG Agent",
                        "type": "ai_memory",
                        "index": 0
                    }
                ]
            ]
        },
        "Chat Model": {
            "ai_languageModel": [
                [
                    {
                        "node": "RAG Agent",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        },
        "RAG Agent": {
            "main": [
                [
                    {
                        "node": "Append Sheet",
                        "type": "main",
                        "index": 0
                    }
                ]
            ],
            "onError": [
                [
                    {
                        "node": "Slack Alert",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "settings": {
        "executionOrder": "v1"
    },
    "triggerCount": 1
}