{
    "name": "Daily Student Motivation",
    "nodes": [
        {
            "parameters": {
                "content": "Automated workflow: Daily Student Motivation",
                "height": 530,
                "width": 1100,
                "color": 5
            },
            "id": "26995548-761c-41fa-9727-9c1538208723",
            "name": "Sticky Note",
            "type": "n8n-nodes-base.stickyNote",
            "typeVersion": 1,
            "position": [
                -480,
                -240
            ]
        },
        {
            "parameters": {
                "httpMethod": "POST",
                "path": "daily-student-motivation"
            },
            "id": "b4ee6923-9695-4d25-879e-d51682b416d6",
            "name": "Webhook Trigger",
            "type": "n8n-nodes-base.webhook",
            "typeVersion": 1,
            "position": [
                -300,
                0
            ]
        },
        {
            "parameters": {
                "chunkSize": 400,
                "chunkOverlap": 40
            },
            "id": "950769fc-8534-4ffa-9fad-8c9cee196dea",
            "name": "Text Splitter",
            "type": "@n8n\/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
            "typeVersion": 1,
            "position": [
                -130,
                0
            ]
        },
        {
            "parameters": {
                "model": "text-embedding-3-small",
                "options": []
            },
            "id": "ce4e7e23-937e-4177-8f1e-14263defeac1",
            "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": "daily_student_motivation"
            },
            "id": "1a53eb05-9c9d-482a-8333-71b326df96cf",
            "name": "Weaviate Insert",
            "type": "@n8n\/n8n-nodes-langchain.vectorStoreWeaviate",
            "typeVersion": 1,
            "position": [
                270,
                0
            ],
            "credentials": {
                "weaviateApi": {
                    "id": "WEAVIATE_API",
                    "name": "Weaviate account"
                }
            }
        },
        {
            "parameters": {
                "indexName": "daily_student_motivation"
            },
            "id": "6f0f012d-1cd7-42e8-902f-7f8cf0072089",
            "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": "5d7acfa3-f322-4676-a6d4-5ac645b1e2ee",
            "name": "Vector Tool",
            "type": "@n8n\/n8n-nodes-langchain.toolVectorStore",
            "typeVersion": 1,
            "position": [
                450,
                -180
            ]
        },
        {
            "parameters": [],
            "id": "ec33fdb2-eb3a-4e01-8489-6a592afc834f",
            "name": "Window Memory",
            "type": "@n8n\/n8n-nodes-langchain.memoryBufferWindow",
            "typeVersion": 1.3,
            "position": [
                450,
                -40
            ]
        },
        {
            "parameters": {
                "options": []
            },
            "id": "020dfb0b-5272-4ff5-8ea0-10363909cd28",
            "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 'Daily Student Motivation':\n\n{{ $json }}",
                "options": {
                    "systemMessage": "You are an assistant for Daily Student Motivation"
                }
            },
            "id": "32e3b5c4-c532-420c-b350-51def592d5a4",
            "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": "Daily Student Motivation"
                },
                "sheetName": {
                    "__rl": true,
                    "value": "Log",
                    "mode": "list",
                    "cachedResultName": "Log"
                },
                "columns": {
                    "mappingMode": "defineBelow",
                    "value": {
                        "Status": "={{$json[\"RAG Agent\"].text}}"
                    },
                    "schema": []
                }
            },
            "id": "d25ae892-f0e7-4d93-b488-b7c62c9da5b9",
            "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": "Daily Student Motivation error: {$json.error.message}"
            },
            "id": "18b62a7a-11c2-48b3-a7cf-cd2d11a95496",
            "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
}