{
    "name": "GA Report Email",
    "nodes": [
        {
            "parameters": {
                "content": "Automated workflow: GA Report Email",
                "height": 530,
                "width": 1100,
                "color": 5
            },
            "id": "4f1aab57-9308-4e86-9152-61fbfa3365a9",
            "name": "Sticky Note",
            "type": "n8n-nodes-base.stickyNote",
            "typeVersion": 1,
            "position": [
                -480,
                -240
            ]
        },
        {
            "parameters": {
                "httpMethod": "POST",
                "path": "ga-report-email"
            },
            "id": "65695649-dfc5-4677-af78-567051da6234",
            "name": "Webhook Trigger",
            "type": "n8n-nodes-base.webhook",
            "typeVersion": 1,
            "position": [
                -300,
                0
            ]
        },
        {
            "parameters": {
                "chunkSize": 400,
                "chunkOverlap": 40
            },
            "id": "22d39ff9-e8dd-4313-acb9-acdcd9f182b5",
            "name": "Text Splitter",
            "type": "@n8n\/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
            "typeVersion": 1,
            "position": [
                -130,
                0
            ]
        },
        {
            "parameters": {
                "model": "text-embedding-3-small",
                "options": []
            },
            "id": "72155732-71f4-430d-bac5-57a8842ddf00",
            "name": "Embeddings",
            "type": "@n8n\/n8n-nodes-langchain.embeddingsOpenAi",
            "typeVersion": 1,
            "position": [
                70,
                0
            ],
            "credentials": {
                "openAiApi": {
                    "id": "OPENAI_API",
                    "name": "OpenAI"
                }
            }
        },
        {
            "parameters": {
                "mode": "insert",
                "options": [],
                "pineconeIndex": {
                    "__rl": true,
                    "value": "ga_report_email",
                    "mode": "list",
                    "cachedResultName": "ga_report_email"
                }
            },
            "id": "e8c7d48f-3e97-43fd-84bb-4dcb616db2a2",
            "name": "Pinecone Insert",
            "type": "@n8n\/n8n-nodes-langchain.vectorStorePinecone",
            "typeVersion": 1,
            "position": [
                270,
                0
            ],
            "credentials": {
                "pineconeApi": {
                    "id": "PINECONE_API",
                    "name": "Pinecone account"
                }
            }
        },
        {
            "parameters": {
                "pineconeIndex": {
                    "__rl": true,
                    "value": "ga_report_email",
                    "mode": "list",
                    "cachedResultName": "ga_report_email"
                }
            },
            "id": "7970719b-0019-46eb-a2db-84a2b521bd2c",
            "name": "Pinecone Query",
            "type": "@n8n\/n8n-nodes-langchain.vectorStorePinecone",
            "typeVersion": 1,
            "position": [
                270,
                -180
            ],
            "credentials": {
                "pineconeApi": {
                    "id": "PINECONE_API",
                    "name": "Pinecone account"
                }
            }
        },
        {
            "parameters": {
                "name": "Pinecone",
                "description": "Vector context"
            },
            "id": "f9dc8e53-1929-4110-af74-421e6cdafd5e",
            "name": "Vector Tool",
            "type": "@n8n\/n8n-nodes-langchain.toolVectorStore",
            "typeVersion": 1,
            "position": [
                450,
                -180
            ]
        },
        {
            "parameters": [],
            "id": "a1d434ec-e2cc-4e88-b7c0-e4d697bb6833",
            "name": "Window Memory",
            "type": "@n8n\/n8n-nodes-langchain.memoryBufferWindow",
            "typeVersion": 1.3,
            "position": [
                450,
                -40
            ]
        },
        {
            "parameters": {
                "options": []
            },
            "id": "47f73715-e5ee-4f85-a7ae-99b049c4ad90",
            "name": "Chat Model",
            "type": "@n8n\/n8n-nodes-langchain.lmChatOpenAi",
            "typeVersion": 1,
            "position": [
                450,
                -340
            ],
            "credentials": {
                "openAiApi": {
                    "id": "OPENAI_API",
                    "name": "OpenAI"
                }
            }
        },
        {
            "parameters": {
                "promptType": "define",
                "text": "Process the following data for task 'GA Report Email':\n\n{{ $json }}",
                "options": {
                    "systemMessage": "You are an assistant for GA Report Email"
                }
            },
            "id": "d90712e6-0d32-4474-9bd5-665e46dab37f",
            "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": "GA Report Email"
                },
                "sheetName": {
                    "__rl": true,
                    "value": "Log",
                    "mode": "list",
                    "cachedResultName": "Log"
                },
                "columns": {
                    "mappingMode": "defineBelow",
                    "value": {
                        "Status": "={{$json[\"RAG Agent\"].text}}"
                    },
                    "schema": []
                }
            },
            "id": "97fb2a42-c618-4a3e-b35b-18123b46da9a",
            "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": "GA Report Email error: {$json.error.message}"
            },
            "id": "84e064b7-1ad4-4cbc-97aa-a65eb5a8d6e9",
            "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": "Pinecone Insert",
                        "type": "ai_textSplitter",
                        "index": 0
                    }
                ]
            ]
        },
        "Embeddings": {
            "ai_embedding": [
                [
                    {
                        "node": "Pinecone Insert",
                        "type": "ai_embedding",
                        "index": 0
                    },
                    {
                        "node": "Pinecone Query",
                        "type": "ai_embedding",
                        "index": 0
                    }
                ]
            ]
        },
        "Pinecone Insert": {
            "ai_document": [
                []
            ]
        },
        "Pinecone 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
}