{
  "nodes": [
    {
      "id": "c842b3a1-106f-4754-be44-1639aa2ca093",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        128,
        1472
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "0dca07cb-6961-4001-8738-e954dfd20ef1",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2160,
        1504
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "58e26956-007d-46d3-b253-c1cd7a104206",
      "name": "Get row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1760,
        1536
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "10c194f5-355e-405b-ade2-1d9b569fca1a",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        336,
        1472
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b1b370a8-b981-43ab-b1b0-88853bad298b",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.chat.id }}",
              "rightValue": "={{ $if($('Telegram Trigger').isExecuted, $('Telegram Trigger').item.json.message.chat.id, YOUR_TELEGRAM_CHAT_ID) }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.3
    },
    {
      "id": "3c2db2c9-b01d-40da-ad8d-99d5af55a0e2",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        1136
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac8d70f0-59ba-4381-942d-18f7401a4705",
              "name": "user_message",
              "type": "string",
              "value": "={{ $if($('Transcribe a recording').isExecuted, $('Transcribe a recording').item.json.content.parts[0].text, $if($('Analyze document').isExecuted, $('Analyze document').item.json.content.parts[0].text, $if($('Analyze an image').isExecuted, $('Analyze an image').item.json.content.parts[0].text, $('Filter').item.json.message.text))) }}"
            },
            {
              "id": "4ebb8355-2aa2-4af2-8f82-a8c5bc57e0c9",
              "name": "system_prompt_details",
              "type": "string",
              "value": "=username: {{ $json.username || \"[COLLECT and use database tool to upsert] Field: username | Prompt: Ask the user to choose a username. This will be their unique identifier. | Rules: Save exactly as provided, no modifications. | Example: 'shabbir', 'nova_builder'\" }}\nsoul: {{ $json.soul || \"[COLLECT and use database tool to upsert] Field: soul | Prompt: Ask the user to define your soul - give you a name, a vibe, and a general purpose. | Rules: Combine all three elements (name, vibe, purpose) into a single concise description. | Example: 'Nova - warm and curious - helps brainstorm creative projects'\" }}\nuser: {{ $json.user || \"[COLLECT and use database tool to upsert] Field: user | Prompt: Ask the user to tell you about themselves - anything they want you to remember. | Rules: Consolidate their response into a structured profile. Include interests, goals, preferences, and any relevant context. | Example: 'AI automation consultant, prefers direct communication, focused on scaling content workflows'\" }}"
            },
            {
              "id": "f1d7c2a0-d580-4e7a-bc8b-29e1102c03bb",
              "name": "last_channel",
              "type": "string",
              "value": "=telegram"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fe8ac8fa-48a3-4b28-af31-42f4f99cb2fe",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        3392,
        832
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Telegram",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "39d05258-72cc-4266-86f1-8b2ae9fccd53",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $if($('Edit Fields').isExecuted, $('Edit Fields').item.json.last_channel, $if($('Edit Fields1').isExecuted, $('Edit Fields1').item.json.last_channel, $if($('Edit Fields2').isExecuted, $('Edit Fields2').item.json.last_channel, $('Edit Fields3').item.json.last_channel))) }}",
                    "rightValue": "telegram"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "whatsapp",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "10be5dff-f0cc-496b-aff2-225f66654597",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $if($('Edit Fields').isExecuted, $('Edit Fields').item.json.last_channel, $if($('Edit Fields1').isExecuted, $('Edit Fields1').item.json.last_channel, $if($('Edit Fields2').isExecuted, $('Edit Fields2').item.json.last_channel, $('Edit Fields3').item.json.last_channel))) }}",
                    "rightValue": "whatsapp"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "0f743b24-166b-47bd-9df7-ff6912a4f056",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3680,
        640
      ],
      "parameters": {
        "text": "={{ $('n8nClaw').item.json.output }}",
        "chatId": "={{ $if($('Telegram Trigger').isExecuted, $('Telegram Trigger').item.json.message.chat.id, YOUR_TELEGRAM_CHAT_ID) }}",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ed2e7e8f-5a41-4f22-b6e4-dc449be7b32b",
      "name": "n8nClaw",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3088,
        1232
      ],
      "parameters": {
        "text": "={{ $json.user_message }}",
        "options": {
          "systemMessage": "=You are n8nClaw, an advanced, proactive AI assistant with access to advanced tools. Your functionality is according to the below details.\n\n{{ $json.system_prompt_details }}\n\nThe User field is a living document. Any new and important information that you receive related to the user - that is worth remembering to be useful in future conversations - is to be added there using the update info tool. Any recurring tasks the user expects you to do (manage calendar, etc - should also go into the user field)\n\nYou also have access to read, create, and update tasks and subtasks through two data tables - one for tasks and one for subtasks.\n\nAnything the user asks you to do must be logged to the tasks and subtasks tables. You can then work on those tasks and subtasks, and update them with lots of detail - as necessary.\n\nTask and subtask details should be upserted with any info required. For example, if you completed a task/subtask partially, update the details with whatever you've already done so you can pick up from there in the next iteration.\n\nAdditionally, As you work on a task/subtask, it may require additional tasks/subtasks to be created - do so if needed, adding all relevant details.\n\nOnce a task or subtask is done, mark task_completed or subtask_completed as true. An entire task can only be completed once ALL subtasks are complete.\n\nYou should always search for tasks first, and then search for the subtasks by the task ID, and plan your work accordingly.\n\nIf you require more context about the user or about previous conversations, you can use query the vector store tool(it is trained on past conversations) to pull the relevant information and continue working.\n\nEMAIL\nYou have access to an AI agent tool that manages your gmail inbox. You can use it to read, reply, delete, get, and search for messages. To take any actions on existing messages, you will need to use the google api-friendly message ID (if you received an email directly).\n\nDOING WORK\nYou have access to a research agent to get any information on anything.\n\nYou also have access to multiple worker agents to break tasks up into parts and do more work concurrently. You MUST use these agents.\n\nYou also have access to a document agent for saving work. The document agent is ONLY to receive completed work for saving. You are NOT to send it instructions for what output to produce. this agent has access to google docs create, update, and drive tools. Save the Google Drive URLs to the task info for persistence.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "c483a186-2cdc-4e70-81a8-0893d52de8ab",
      "name": "Get Tasks",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        4016,
        1216
      ],
      "parameters": {
        "operation": "get",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_TASKS_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_TASKS_TABLE_ID",
          "cachedResultName": "ClawdBot Tasks"
        },
        "descriptionType": "manual",
        "toolDescription": "Get pending or completed tasks"
      },
      "typeVersion": 1
    },
    {
      "id": "f4ee32da-6163-4925-a4c0-b84a2c776824",
      "name": "Get Subtasks",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        3888,
        1216
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "parent_task_id",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "operation": "get",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SUBTASKS_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_SUBTASKS_TABLE_ID",
          "cachedResultName": "ClawdBot Subtasks"
        },
        "descriptionType": "manual",
        "toolDescription": "Get pending or completed subtasks"
      },
      "typeVersion": 1
    },
    {
      "id": "c9dfc3dc-2bb3-4b1a-b34e-a15d3f8eb037",
      "name": "Upsert Subtask",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        3760,
        1216
      ],
      "parameters": {
        "columns": {
          "value": {
            "subtask_name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('subtask_name', ``, 'string') }}",
            "parent_task_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parent_task_id', ``, 'string') }}",
            "subtask_details": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('subtask_details', ``, 'string') }}",
            "subtask_complete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('subtask_complete', ``, 'boolean') }}"
          },
          "schema": [
            {
              "id": "parent_task_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "parent_task_id",
              "defaultMatch": false
            },
            {
              "id": "subtask_name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subtask_name",
              "defaultMatch": false
            },
            {
              "id": "subtask_details",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subtask_details",
              "defaultMatch": false
            },
            {
              "id": "subtask_complete",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "subtask_complete",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "parent_task_id",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {},
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_SUBTASKS_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_SUBTASKS_TABLE_ID",
          "cachedResultName": "ClawdBot Subtasks"
        },
        "descriptionType": "manual",
        "toolDescription": "Upsert Subtask"
      },
      "typeVersion": 1
    },
    {
      "id": "a989b000-afca-450f-b068-e19d38be6ecb",
      "name": "Upsert Task",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        3616,
        1216
      ],
      "parameters": {
        "columns": {
          "value": {
            "task_name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('task_name', ``, 'string') }}",
            "Is_recurring": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Is_recurring', ``, 'boolean') }}",
            "task_details": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('task_details', ``, 'string') }}",
            "task_complete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('task_complete', ``, 'boolean') }}"
          },
          "schema": [
            {
              "id": "task_name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "task_name",
              "defaultMatch": false
            },
            {
              "id": "task_details",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "task_details",
              "defaultMatch": false
            },
            {
              "id": "task_complete",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "task_complete",
              "defaultMatch": false
            },
            {
              "id": "Is_recurring",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Is_recurring",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "task_name",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {},
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_TASKS_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_TASKS_TABLE_ID",
          "cachedResultName": "ClawdBot Tasks"
        },
        "descriptionType": "manual",
        "toolDescription": "Upsert task"
      },
      "typeVersion": 1
    },
    {
      "id": "6976bb1b-7f9f-4624-8a9a-ddceddda7db6",
      "name": "Initialization - Update Info",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        4144,
        1216
      ],
      "parameters": {
        "columns": {
          "value": {
            "soul": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('soul', ``, 'string') }}",
            "user": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('user', ``, 'string') }}",
            "username": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('username', `the \"username\" provided by the user as the first answer.`, 'string') }}",
            "heartbeat": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('heartbeat', ``, 'string') }}",
            "last_channel": "={{ $json.last_channel }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false
            },
            {
              "id": "soul",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "soul",
              "defaultMatch": false
            },
            {
              "id": "user",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "user",
              "defaultMatch": false
            },
            {
              "id": "heartbeat",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "heartbeat",
              "defaultMatch": false
            },
            {
              "id": "last_channel",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "last_channel",
              "defaultMatch": false
            },
            {
              "id": "last_vector_id",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "last_vector_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {},
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        },
        "descriptionType": "manual",
        "toolDescription": "Initialize first usage"
      },
      "typeVersion": 1
    },
    {
      "id": "7aeb2c4e-b40c-4802-a471-5f8af8d4dddc",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        2304,
        1504
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME",
        "sessionIdType": "customKey",
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "3a5344cf-8ac9-43e9-83d5-c79bdec4b542",
      "name": "Execute a SQL query",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2448,
        2640
      ],
      "parameters": {
        "query": "SELECT session_id, message, id\nFROM n8n_chat_histories \nWHERE id > '{{ $json.last_vector_id }}'\nORDER BY id ASC\n",
        "options": {},
        "operation": "executeQuery"
      },
      "typeVersion": 2.6
    },
    {
      "id": "009e03b7-35ce-4ad2-b241-e9bcc2e3a837",
      "name": "Get row(s)1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2256,
        2640
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "11e4281a-382a-4edb-827c-79729639bd71",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        3296,
        2640
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0acd04e6-c1a1-45e0-8b76-7bdbc4fb26a5",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3344,
        2848
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "50cd8966-ae8d-4672-bc33-25287125525f",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        3536,
        2848
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $json.output.summary }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1.1
    },
    {
      "id": "31c85898-a155-4d75-91c5-3bf9010b0667",
      "name": "Update row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3664,
        2640
      ],
      "parameters": {
        "columns": {
          "value": {
            "last_vector_id": "={{ $('Execute a SQL query').last().json.id }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false
            },
            {
              "id": "soul",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "soul",
              "defaultMatch": false
            },
            {
              "id": "user",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "user",
              "defaultMatch": false
            },
            {
              "id": "heartbeat",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "heartbeat",
              "defaultMatch": false
            },
            {
              "id": "last_channel",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "last_channel",
              "defaultMatch": false
            },
            {
              "id": "last_vector_id",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "last_vector_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "options": {},
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6b919529-cccf-4905-9276-2c9b27c859c2",
      "name": "Supabase Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2464,
        1504
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        },
        "toolDescription": "get info about the user as needed"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b27f5430-9f0b-4179-a515-67f12d28850e",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2592,
        1664
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "649bd16c-a195-44d4-bb6c-b578eb94cd76",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        112,
        928
      ],
      "parameters": {
        "path": "YOUR_WEBHOOK_PATH",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d909173b-1ac9-4d19-9e6f-21b9750c44b0",
      "name": "Get row(s)2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        528,
        928
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "5b0f22da-403f-4ba5-9601-10194905121f",
      "name": "Filter1",
      "type": "n8n-nodes-base.filter",
      "position": [
        320,
        928
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b1b370a8-b981-43ab-b1b0-88853bad298b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.body.data.key.remoteJid }}",
              "rightValue": "=YOUR_PHONE@s.whatsapp.net"
            },
            {
              "id": "4f0a49e8-7a0b-4bcf-8c4c-929d0596e309",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.body.data.key.fromMe }}",
              "rightValue": false
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.3
    },
    {
      "id": "4a8427cc-2d55-4cbb-904e-88f801b92244",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        928
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac8d70f0-59ba-4381-942d-18f7401a4705",
              "name": "user_message",
              "type": "string",
              "value": "={{ $('Filter1').item.json.body.data.message.conversation }}"
            },
            {
              "id": "4ebb8355-2aa2-4af2-8f82-a8c5bc57e0c9",
              "name": "system_prompt_details",
              "type": "string",
              "value": "=username: {{ $json.username || \"[COLLECT and use database tool to upsert] Field: username | Prompt: Ask the user to choose a username. This will be their unique identifier. | Rules: Save exactly as provided, no modifications. | Example: 'shabbir', 'nova_builder'\" }}\nsoul: {{ $json.soul || \"[COLLECT and use database tool to upsert] Field: soul | Prompt: Ask the user to define your soul - give you a name, a vibe, and a general purpose. | Rules: Combine all three elements (name, vibe, purpose) into a single concise description. | Example: 'Nova - warm and curious - helps brainstorm creative projects'\" }}\nuser: {{ $json.user || \"[COLLECT and use database tool to upsert] Field: user | Prompt: Ask the user to tell you about themselves - anything they want you to remember. | Rules: Consolidate their response into a structured profile. Include interests, goals, preferences, and any relevant context. | Example: 'AI automation consultant, prefers direct communication, focused on scaling content workflows'\" }}"
            },
            {
              "id": "f1d7c2a0-d580-4e7a-bc8b-29e1102c03bb",
              "name": "last_channel",
              "type": "string",
              "value": "=whatsapp"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "37334f00-a871-419b-ad10-e6cbed1b4ab9",
      "name": "Enviar texto",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        3680,
        816
      ],
      "parameters": {
        "resource": "messages-api",
        "remoteJid": "={{ $if($('Filter1').isExecuted, $('Filter1').item.json.body.data.key.remoteJid, 'YOUR_PHONE@s.whatsapp.net') }}",
        "messageText": "={{ $('n8nClaw').item.json.output }}",
        "instanceName": "YOUR_EVOLUTION_INSTANCE",
        "options_message": {}
      },
      "typeVersion": 1
    },
    {
      "id": "cc6ab49b-a741-4fd3-9789-8cfff6eb681d",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2720,
        1712
      ],
      "parameters": {
        "model": "google/gemini-3-flash-preview",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "732d9d3a-1e69-40e0-85d3-881ec08d58c9",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2864,
        1712
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-research",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "9adbbdc1-58cf-4e20-9de8-76d70147a71c",
      "name": "Search in Tavily",
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "position": [
        3120,
        1712
      ],
      "parameters": {
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "56b1a92a-19a0-4581-b22e-e22bcd4fe025",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        2992,
        1712
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4b421dc6-f916-44e1-93f4-b848e3144e17",
      "name": "Hourly heartbeat",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        112,
        752
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f394841d-a09c-465b-b196-404cf8560812",
      "name": "Get row(s)3",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        528,
        752
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "2791d2c0-1da2-4a40-a0b0-5e30c38760f8",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        752
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac8d70f0-59ba-4381-942d-18f7401a4705",
              "name": "user_message",
              "type": "string",
              "value": "=See what's pending and start working on it."
            },
            {
              "id": "4ebb8355-2aa2-4af2-8f82-a8c5bc57e0c9",
              "name": "system_prompt_details",
              "type": "string",
              "value": "=username: {{ $json.username || \"[COLLECT and use database tool to upsert] Field: username | Prompt: Ask the user to choose a username. This will be their unique identifier. | Rules: Save exactly as provided, no modifications. | Example: 'shabbir', 'nova_builder'\" }}\nsoul: {{ $json.soul || \"[COLLECT and use database tool to upsert] Field: soul | Prompt: Ask the user to define your soul - give you a name, a vibe, and a general purpose. | Rules: Combine all three elements (name, vibe, purpose) into a single concise description. | Example: 'Nova - warm and curious - helps brainstorm creative projects'\" }}\nuser: {{ $json.user || \"[COLLECT and use database tool to upsert] Field: user | Prompt: Ask the user to tell you about themselves - anything they want you to remember. | Rules: Consolidate their response into a structured profile. Include interests, goals, preferences, and any relevant context. | Example: 'AI automation consultant, prefers direct communication, focused on scaling content workflows'\" }}"
            },
            {
              "id": "f1d7c2a0-d580-4e7a-bc8b-29e1102c03bb",
              "name": "last_channel",
              "type": "string",
              "value": "={{ $json.last_channel }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6f436f5b-8ffe-401d-b2b6-a5afc21525c9",
      "name": "Research Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        2768,
        1504
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "=You are a research agent. You have access to Wikipedia and Tavily tools."
        },
        "toolDescription": "Research Agent"
      },
      "typeVersion": 2.2
    },
    {
      "id": "e4e7a7e9-9a57-44b4-816f-63066282374f",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        112,
        560
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "96a28117-f510-4a35-8f3f-6487112b223c",
      "name": "Get row(s)4",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        528,
        560
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "YOUR_USERNAME"
            }
          ]
        },
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "0fae50e8-89ea-4332-95ac-31c69a96c9c2",
      "name": "Edit Fields3",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac8d70f0-59ba-4381-942d-18f7401a4705",
              "name": "user_message",
              "type": "string",
              "value": "=You have just received an email. Determine what to do with it.\n\nQuery the databases if it's related to any task, and query the vector store to get more context.\n\nIMPORTANT - you are not to divulge ANY sensitive information in email replies. If a reply requires sensitive information, save the reply as a draft in Gmail and let me know on telegram.\n\n{{ $('Gmail Trigger').item.json.headers.from }}\n{{ $('Gmail Trigger').item.json.headers['message-id'] }}\n{{ $('Gmail Trigger').item.json.headers.subject }}\n{{ $('Gmail Trigger').item.json.text }}"
            },
            {
              "id": "4ebb8355-2aa2-4af2-8f82-a8c5bc57e0c9",
              "name": "system_prompt_details",
              "type": "string",
              "value": "=username: {{ $json.username || \"[COLLECT and use database tool to upsert] Field: username | Prompt: Ask the user to choose a username. This will be their unique identifier. | Rules: Save exactly as provided, no modifications. | Example: 'shabbir', 'nova_builder'\" }}\nsoul: {{ $json.soul || \"[COLLECT and use database tool to upsert] Field: soul | Prompt: Ask the user to define your soul - give you a name, a vibe, and a general purpose. | Rules: Combine all three elements (name, vibe, purpose) into a single concise description. | Example: 'Nova - warm and curious - helps brainstorm creative projects'\" }}\nuser: {{ $json.user || \"[COLLECT and use database tool to upsert] Field: user | Prompt: Ask the user to tell you about themselves - anything they want you to remember. | Rules: Consolidate their response into a structured profile. Include interests, goals, preferences, and any relevant context. | Example: 'AI automation consultant, prefers direct communication, focused on scaling content workflows'\" }}"
            },
            {
              "id": "f1d7c2a0-d580-4e7a-bc8b-29e1102c03bb",
              "name": "last_channel",
              "type": "string",
              "value": "={{ $json.last_channel }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5e14fe48-3bb9-46eb-81ac-200182ff34db",
      "name": "Email Manager",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        3360,
        1552
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are an email manager. You have access to a variety of tools to process emails. Keep track of the message ID (google api friendly format) - you'll need it to take any actions on any messages."
        },
        "toolDescription": "Email manager agent"
      },
      "typeVersion": 2.2
    },
    {
      "id": "a18217ab-c376-4508-8672-023f50e6bb02",
      "name": "OpenRouter Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        3312,
        1712
      ],
      "parameters": {
        "model": "anthropic/claude-haiku-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "c4261e82-a96d-45fc-b1f9-9d75aacdaa70",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        3488,
        1824
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-email",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "3007b55f-af25-4b38-b90b-2c81ba1a4a0d",
      "name": "Send a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3728,
        2032
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "39e2a9a9-834d-418c-b27b-bee9f14c920e",
      "name": "Document Manager",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        4432,
        1840
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are a document manager agent. You have access to create and update google docs, search for folders in google drive, delete files in google drive, and move files between folders. Retain the file ID in memory for any file you are working with."
        },
        "toolDescription": "call this tool to create, update, and move documents in google drive"
      },
      "typeVersion": 2.2
    },
    {
      "id": "abffd049-1ef1-4a51-b633-940aa5e41fe7",
      "name": "Simple Memory2",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        4224,
        2032
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-docs",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "82a7a9e1-72db-47b8-841b-3f7b12db59ab",
      "name": "OpenRouter Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        4080,
        2032
      ],
      "parameters": {
        "model": "anthropic/claude-haiku-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "f12b42d8-fc4c-40c4-a5f6-309f67491ff1",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        592,
        1440
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Audio message",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bbe4cbfd-d4b1-4095-b505-d97c90927250",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "59f728d1-4935-475f-b519-39643b57c99f",
                    "operator": {
                      "type": "array",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.photo }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Document",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "72c3ed90-193a-4df8-ba1b-a5de99277d87",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.document }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6453660f-4a77-4a30-a544-ee8ff394f169",
      "name": "Analyze document",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1280,
        1408
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "resource": "document",
        "inputType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "83be58ee-5bc5-49d5-8659-e69a803e69e6",
      "name": "Get a file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1072,
        1248
      ],
      "parameters": {
        "fileId": "={{ $json.message.photo[3].file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "ab499a8c-899c-480d-b346-95f8cd7de8a6",
      "name": "Get a file1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1072,
        1408
      ],
      "parameters": {
        "fileId": "={{ $json.message.document.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "ddef12ca-cbb4-4bf3-b95f-6c89cdd86a9f",
      "name": "Get a file2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1072,
        1088
      ],
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "a98c9ad4-6dd5-4768-8bca-57705e58b745",
      "name": "Transcribe a recording",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1280,
        1088
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "resource": "audio",
        "inputType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "30dfb887-dada-4e09-a6d8-041bfea1fba7",
      "name": "Analyze an image",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1280,
        1248
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/nano-banana-pro-preview",
          "cachedResultName": "models/nano-banana-pro-preview"
        },
        "options": {},
        "resource": "image",
        "inputType": "binary",
        "operation": "analyze"
      },
      "typeVersion": 1
    },
    {
      "id": "8de38208-5555-422c-ba32-1dffde0cd78a",
      "name": "Data Loader",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2048,
        2640
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3b48c09f-bc45-4ebf-92ca-30f018621f55",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2896,
        2640
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are a summarizer agent. I will provide you with the entire log of a day's worth of discussion with my AI agent. You are to summarize the conversation for storing in deep memory."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "23b9c0ad-23be-484d-af92-e896e854e9aa",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2656,
        2640
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "message"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "da51fcae-9884-4458-8830-f432c7138ca2",
      "name": "OpenRouter Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2832,
        2848
      ],
      "parameters": {
        "model": "anthropic/claude-haiku-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "c697cd80-896e-46fc-b8a8-d906197f6900",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3040,
        2848
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"summary\":\"text\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "5388522e-07ce-495a-9c45-615e3afaa34c",
      "name": "Update User and Heartbeat",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        4272,
        1216
      ],
      "parameters": {
        "columns": {
          "value": {
            "soul": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('soul', ``, 'string') }}",
            "user": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('user', ``, 'string') }}",
            "username": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('username', `the \"username\" provided by the user as the first answer.`, 'string') }}",
            "heartbeat": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('heartbeat', ``, 'string') }}",
            "last_channel": "={{ $json.last_channel }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false
            },
            {
              "id": "soul",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "soul",
              "defaultMatch": false
            },
            {
              "id": "user",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "user",
              "defaultMatch": false
            },
            {
              "id": "heartbeat",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "heartbeat",
              "defaultMatch": false
            },
            {
              "id": "last_channel",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "last_channel",
              "defaultMatch": false
            },
            {
              "id": "last_vector_id",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "last_vector_id",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "filters": {
          "conditions": [
            {
              "keyName": "username",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {},
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_INIT_TABLE_ID",
          "cachedResultUrl": "/projects/YOUR_PROJECT_ID/datatables/YOUR_INIT_TABLE_ID",
          "cachedResultName": "ClawdBot Init"
        },
        "descriptionType": "manual",
        "toolDescription": "Update user, heartbeat as needed."
      },
      "typeVersion": 1
    },
    {
      "id": "a008ac94-c5fb-47f2-b3b2-d89ebd3e3da8",
      "name": "Delete a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3568,
        2032
      ],
      "parameters": {
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}",
        "operation": "delete"
      },
      "typeVersion": 2.2
    },
    {
      "id": "710bf596-d993-40dc-add5-b964c0b8548a",
      "name": "Get a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3408,
        2032
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}",
        "operation": "get"
      },
      "typeVersion": 2.2
    },
    {
      "id": "b4d47c8a-4d72-4edb-9a8a-6afb20070be2",
      "name": "Get many messages in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3888,
        2032
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', ``, 'string') }}",
          "sender": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Sender', ``, 'string') }}"
        },
        "options": {},
        "operation": "getAll",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "88a874df-0f69-406c-a990-99b8daf1f6cf",
      "name": "Reply to a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3248,
        2032
      ],
      "parameters": {
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}",
        "operation": "reply"
      },
      "typeVersion": 2.2
    },
    {
      "id": "23ff5463-3704-4c95-ad96-9077342320d1",
      "name": "Create a document in Google Docs",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        4784,
        2144
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "folderId": "default"
      },
      "typeVersion": 2
    },
    {
      "id": "279f220e-51a5-4371-84a0-7570e5f225a5",
      "name": "Get a document in Google Docs",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        4624,
        2144
      ],
      "parameters": {
        "operation": "get",
        "documentURL": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Doc_ID_or_URL', ``, 'string') }}"
      },
      "typeVersion": 2
    },
    {
      "id": "879ec8a9-6385-4d15-b4a2-4c1390d08d5e",
      "name": "Update a document in Google Docs",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        4464,
        2144
      ],
      "parameters": {
        "actionsUi": {
          "actionFields": [
            {
              "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('actionFields0_Text', ``, 'string') }}",
              "action": "insert"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Doc_ID_or_URL', ``, 'string') }}"
      },
      "typeVersion": 2
    },
    {
      "id": "609dc0ba-2cd0-45b3-aa03-7d405b430a45",
      "name": "Delete a file in Google Drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        4944,
        2144
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('File', ``, 'string') }}"
        },
        "options": {},
        "operation": "deleteFile"
      },
      "typeVersion": 3
    },
    {
      "id": "f9003879-27f9-449c-a383-8e21b4a29c53",
      "name": "Create folder in Google Drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        5088,
        2144
      ],
      "parameters": {
        "name": "={{ $fromAI(\"folder_name\") }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "8bbf1c3b-0baf-4d62-a847-5ca250a0e527",
      "name": "Move file in Google Drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        5264,
        2144
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('File', ``, 'string') }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Parent_Folder', ``, 'string') }}"
        },
        "operation": "move"
      },
      "typeVersion": 3
    },
    {
      "id": "74f61a79-c2a5-4bf3-85f0-63c851addcbe",
      "name": "Search files and folders in Google Drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        5440,
        2144
      ],
      "parameters": {
        "limit": 50,
        "filter": {},
        "options": {},
        "resource": "fileFolder",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "queryString": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search_Query', ``, 'string') }}"
      },
      "typeVersion": 3
    },
    {
      "id": "7e457b6c-9455-43e5-a845-c9472a159fae",
      "name": "OpenRouter Chat Model5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        4064,
        1664
      ],
      "parameters": {
        "model": "anthropic/claude-haiku-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "45dbfa88-b054-4e7a-8368-d5678ea8efc1",
      "name": "Worker Agent 1",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        4160,
        1504
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('System_Message', ``, 'string') }}"
        },
        "toolDescription": "Worker Agent 1 - use this for simple work"
      },
      "typeVersion": 2.2
    },
    {
      "id": "3ab33fbd-a02e-4a1c-9d32-7807c0bd3fbf",
      "name": "Simple Memory3",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        4208,
        1664
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-worker1",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "74a661ba-a400-4a31-8bdd-4520b98053bc",
      "name": "OpenRouter Chat Model6",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        4448,
        1664
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.5",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "84af193b-5afb-40c6-856f-2945f13ec4f2",
      "name": "Simple Memory4",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        4592,
        1664
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-worker2",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "b852c292-b39f-4f38-a9bb-dd3ebc9be770",
      "name": "OpenRouter Chat Model7",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        4816,
        1664
      ],
      "parameters": {
        "model": "anthropic/claude-opus-4.6",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "e9f6018b-cbce-4bdf-91e8-ccdf80b42685",
      "name": "Simple Memory5",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        4960,
        1664
      ],
      "parameters": {
        "sessionKey": "YOUR_USERNAME-worker3",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "4a6569f6-5526-49d7-9b37-049386660b56",
      "name": "Worker Agent 3",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        4912,
        1440
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('System_Message', ``, 'string') }}"
        },
        "toolDescription": "Worker Agent 3 - use for higher-order thinking work"
      },
      "typeVersion": 2.2
    },
    {
      "id": "3dbd37c3-4afe-4e24-a655-92dff3b9ee91",
      "name": "Worker Agent 2",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        4544,
        1472
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('System_Message', ``, 'string') }}"
        },
        "toolDescription": "Worker Agent 2 - use for mid-level work"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d8ba95ab-a46d-417c-a776-610d155684d0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        2448
      ],
      "parameters": {
        "width": 2096,
        "height": 576,
        "content": "## \ud83d\udcbe Long-Term Memory Pipeline\nA scheduled flow that runs periodically to build persistent memory:\n1. **Pull** new chat history from Postgres\n2. **Aggregate** messages into conversation chunks\n3. **Summarize** with Haiku 4.5 (via OpenRouter)\n4. **Embed** summaries with OpenAI embeddings\n5. **Store** in Supabase vector database for future RAG retrieval"
      },
      "typeVersion": 1
    },
    {
      "id": "80c4f5b3-5635-4837-9186-c5de9f7dd842",
      "name": "Sticky Note - Video",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2224,
        -160
      ],
      "parameters": {
        "color": 5,
        "width": 1262,
        "height": 774,
        "content": "## \ud83d\udcfa Video Walkthrough\n@[youtube](Yfo34yco5Oo)"
      },
      "typeVersion": 1
    },
    {
      "id": "1171aefa-fc1a-4ca8-9b7d-be76c5d29b7d",
      "name": "Sticky Note - Triggers",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        480
      ],
      "parameters": {
        "color": 4,
        "width": 1172,
        "height": 660,
        "content": "## \ud83d\udd0c Triggers & Input Processing\nFour input channels feed into the agent:\n- **Telegram Trigger** \u2014 text, voice, images, documents\n- **WhatsApp Webhook** \u2014 text messages via Evolution API\n- **Gmail Trigger** \u2014 polls for new emails\n- **Hourly Heartbeat** \u2014 autonomous task processing\n\nEach trigger filters messages, fetches the user profile from the **Init data table**, \nand normalizes input into a standard format \n(`user_message`, `system_prompt`, `last_channel`)."
      },
      "typeVersion": 1
    },
    {
      "id": "23a1d81e-5887-47b3-ad71-36c4c90e9697",
      "name": "Sticky Note - Core Agent",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2688,
        944
      ],
      "parameters": {
        "color": 6,
        "width": 680,
        "height": 500,
        "content": "## \ud83e\udde0 Core AI Agent \u2014 n8nClaw\nThe central orchestrator. Uses **Claude Sonnet 4.5** (via OpenRouter) with a **15-message Postgres chat memory** window.\n\nReceives normalized input from all channels and decides how to respond \u2014 calling tools, delegating to sub-agents, or replying directly.\n\nThe agent's personality and behavior are configured via the **soul** and **user** fields in the Init table."
      },
      "typeVersion": 1
    },
    {
      "id": "f4ecd899-fa2b-4438-bff1-ed2059b6a511",
      "name": "Sticky Note - Tools",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3504,
        992
      ],
      "parameters": {
        "color": 3,
        "width": 972,
        "height": 420,
        "content": "## \ud83d\udee0\ufe0f Tools (Data Tables & Vector Store)\nDirect tools available to the n8nClaw agent:\n- **Get/Upsert Tasks** \u2014 task management via n8n data tables\n- **Get/Upsert Subtasks** \u2014 subtask tracking linked by parent_task_id\n- **Update User & Heartbeat** \u2014 persist user profile and heartbeat state\n- **Supabase Vector Store** \u2014 RAG queries against past conversation summaries"
      },
      "typeVersion": 1
    },
    {
      "id": "c12d203c-4486-4c68-b75e-0a9f1f5c0d40",
      "name": "Sticky Note - Sub-Agents",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5120,
        1696
      ],
      "parameters": {
        "color": 2,
        "width": 588,
        "height": 264,
        "content": "## \ud83e\udd16 Sub-Agents\nSpecialized agents that the core n8nClaw agent can delegate to:\n\n- **Research Agent** (Gemini 3 Flash) \u2014 web research via Tavily + Wikipedia\n- **Email Manager** (Haiku 4.5) \u2014 Gmail CRUD (read, reply, send, delete, search)\n- **Document Manager** (Haiku 4.5) \u2014 Google Docs/Drive operations\n- **Worker 1** (Haiku 4.5) \u2014 simple tasks\n- **Worker 2** (Sonnet 4.5) \u2014 mid-level work\n- **Worker 3** (Opus 4.6) \u2014 complex reasoning"
      },
      "typeVersion": 1
    },
    {
      "id": "3aeb1ccb-3fba-4355-a55d-cf9663604a8e",
      "name": "Sticky Note - Output",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        400
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 568,
        "content": "## \ud83d\udce4 Output Routing\nA **Switch** node routes the agent's response back to the originating channel:\n- **Telegram** \u2014 Send text message via Telegram Bot API\n- **WhatsApp** \u2014 Send text via Evolution API"
      },
      "typeVersion": 1
    },
    {
      "id": "aceda5d2-e970-4d18-bcae-5af526311f5d",
      "name": "Sticky Note - Media",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        1632
      ],
      "parameters": {
        "width": 800,
        "height": 212,
        "content": "## \ud83c\udf99\ufe0f Media Handling (Telegram)\nVoice, images, and documents sent via Telegram are routed through a **Switch** node and processed by Gemini models:\n- **Voice** \u2192 Gemini 2.5 Flash transcription\n- **Images** \u2192 Gemini image analysis\n- **Documents** \u2192 Gemini 2.5 Flash document analysis\n\nThe processed content is then forwarded to the core agent as text."
      },
      "typeVersion": 1
    },
    {
      "id": "dbf13767-2e89-47e2-8875-837039e45cf2",
      "name": "Mark a message as read in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3088,
        2032
      ],
      "parameters": {
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}",
        "operation": "markAsRead"
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Enviar texto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter1": {
      "main": [
        [
          {
            "node": "Get row(s)2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Get a file2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a file1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8nClaw": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tasks": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "Research Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Analyze an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Loader": {
      "main": [
        [
          {
            "node": "Get row(s)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "n8nClaw",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file1": {
      "main": [
        [
          {
            "node": "Analyze document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file2": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)1": {
      "main": [
        [
          {
            "node": "Execute a SQL query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)2": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)3": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)4": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert Task": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "n8nClaw",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "n8nClaw",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "n8nClaw",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Subtasks": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Email Manager": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Get row(s)4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Research Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Research Agent": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Email Manager",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory2": {
      "ai_memory": [
        [
          {
            "node": "Document Manager",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory3": {
      "ai_memory": [
        [
          {
            "node": "Worker Agent 1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory4": {
      "ai_memory": [
        [
          {
            "node": "Worker Agent 2",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory5": {
      "ai_memory": [
        [
          {
            "node": "Worker Agent 3",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Upsert Subtask": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Worker Agent 1": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Worker Agent 2": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Worker Agent 3": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze an image": {
      "main": [
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze document": {
      "main": [
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Manager": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Worker Agent 1",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Worker Agent 2",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Worker Agent 3",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Hourly heartbeat": {
      "main": [
        [
          {
            "node": "Get row(s)3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search in Tavily": {
      "ai_tool": [
        [
          {
            "node": "Research Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Execute a SQL query": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "main": [
        [
          {
            "node": "Update row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Research Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Email Manager",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Document Manager",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Worker Agent 1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Worker Agent 2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "Worker Agent 3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Delete a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Move file in Google Drive": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update User and Heartbeat": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get many messages in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Reply to a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Initialization - Update Info": {
      "ai_tool": [
        [
          {
            "node": "n8nClaw",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create folder in Google Drive": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete a file in Google Drive": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get a document in Google Docs": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Mark a message as read in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create a document in Google Docs": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update a document in Google Docs": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders in Google Drive": {
      "ai_tool": [
        [
          {
            "node": "Document Manager",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}