Skip to main content

Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail

Workflow preview

Workflow preview
100%
Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail preview
Open on n8n.io

1. Workflow Overview

n8nClaw — Self Hosted AI Assistant A lightweight, self hosted AI assistant built entirely in n8n. Multi channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autono...

Best for

  • Personal Productivity automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.datatable, n8n-nodes-base.filter, n8n-nodes-base.set, n8n-nodes-base.switch, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Shabbir Noor.

Original n8n.io source

1.1 Workflow description

Title
Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail
Workflow name
Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail

n8nClaw — Self-Hosted AI Assistant

A lightweight, self-hosted AI assistant built entirely in n8n. Multi-channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autonomous work — all in a single visual workflow.

Inspired by OpenClaw.

What It Does

n8nClaw is a personal AI assistant that lives inside n8n. It connects to your messaging apps, remembers past conversations, manages tasks, and can work autonomously on your behalf.

Core capabilities:

  • Multi-channel messaging — talk to your assistant via Telegram, WhatsApp, or Gmail
  • Persistent memory — conversations are summarized, embedded, and stored in a Supabase vector database for long-term recall
  • Task management — create, track, and complete tasks and subtasks using n8n data tables
  • Autonomous heartbeat — an hourly trigger lets the agent check in, process pending tasks, and act on its own
  • Media handling — voice messages, images, and documents sent via Telegram are processed by Gemini models
  • Sub-agents — delegate work to specialized agents for research, email management, document management, and tiered workers

How It Works

1. Triggers & Input Processing

Four triggers feed into the agent:

  • Telegram Trigger — receives text, voice, images, and documents
  • WhatsApp Webhook — receives text messages via Evolution API
  • Gmail Trigger — polls for new emails every minute
  • Hourly Heartbeat — scheduled trigger for autonomous task processing

Each trigger filters messages (e.g., by Telegram chat ID or phone number), fetches the user profile from an Init data table, and normalizes the input into a standard format (user_message, system_prompt, last_channel).

2. Core AI Agent (n8nClaw)

The central agent uses Claude Sonnet 4.5 (via OpenRouter) with a 15-message Postgres chat memory window. It receives the normalized input and decides how to respond — using tools, delegating to sub-agents, or replying directly.

3. Tools

The agent has direct access to:

  • Task & Subtask management — CRUD operations on n8n data tables
  • User profile updates — persist learned information about the user
  • Supabase Vector Store — RAG queries against past conversation summaries

4. Sub-Agents

Specialized agents handle domain-specific work:

Agent Model Purpose
Research Agent Gemini 3 Flash Web research via Tavily + Wikipedia
Email Manager Claude Haiku 4.5 Gmail operations (read, reply, send, delete, search)
Document Manager Claude Haiku 4.5 Google Docs/Drive operations
Worker 1 Claude Haiku 4.5 Simple tasks
Worker 2 Claude Sonnet 4.5 Mid-level work
Worker 3 Claude Opus 4.6 Complex reasoning

5. Output Routing

A Switch node routes the agent's response back to the originating channel (Telegram or WhatsApp).

6. Long-Term Memory Pipeline

A separate scheduled flow runs periodically to:

  1. Pull new chat history from Postgres
  2. Aggregate and summarize conversations (Haiku 4.5)
  3. Generate embeddings (OpenAI)
  4. Store in Supabase vector database for future RAG retrieval

Setup Steps

Step 1: Import the Workflow

  1. Open n8n
  2. Go to Workflows → Import from File
  3. Select the n8nClaw.json file

Step 2: Create Data Tables

Create three n8n data tables:

Init Table (user profile):

Column Type
username string
soul string
user string
heartbeat string
last_channel string
last_vector_id number

Tasks Table:

Column Type
task_name string
task_details string
task_complete boolean
Is_recurring boolean

Subtasks Table:

Column Type
parent_task_id string
subtask_name string
subtask_details string
subtask_complete boolean

Step 3: Set Up Supabase Vector Store

Create a documents table in Supabase with the pgvector extension enabled. The table should match the schema expected by n8n's Supabase Vector Store node (include a match_documents function).

Step 4: Configure Credentials

Set up the following credentials in n8n (only configure the channels and services you plan to use):

Credential Required For
Telegram Bot API Telegram channel
OpenRouter API All AI models
Postgres Chat memory
Supabase Vector store / RAG
OpenAI API Embeddings
Gmail OAuth2 Email management
Evolution API WhatsApp
Google AI (Gemini) Media processing
Google Docs/Drive OAuth2 Document management
Tavily API Web search (Research Agent)

Step 5: Update Placeholders

Search the workflow for YOUR_ and replace with your actual values:

Placeholder Replace With
YOUR_USERNAME Your chosen username
YOUR_TELEGRAM_CHAT_ID Your Telegram chat ID
YOUR_PHONE Your phone number (WhatsApp)
YOUR_EVOLUTION_INSTANCE Your Evolution API instance name
YOUR_*_TABLE_ID IDs of the data tables from Step 2
YOUR_*_CREDENTIAL_ID Auto-populated when connecting credentials
YOUR_PROJECT_ID Your n8n project ID

Step 6: Activate

  1. Connect all credentials in the n8n UI
  2. Point data table nodes to your tables
  3. Update filter nodes with your Telegram chat ID / WhatsApp number
  4. Activate the workflow

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 3 - Get row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 4 - Filter

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.3

Block 5 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 7 - Send a text message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 8 - n8nClaw

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 9 - Get Tasks

Type / Role
n8n-nodes-base.dataTableTool - dataTableTool
Config choices
Version 1

Block 10 - Get Subtasks

Type / Role
n8n-nodes-base.dataTableTool - dataTableTool
Config choices
Version 1

Block 11 - Upsert Subtask

Type / Role
n8n-nodes-base.dataTableTool - dataTableTool
Config choices
Version 1

Block 12 - Upsert Task

Type / Role
n8n-nodes-base.dataTableTool - dataTableTool
Config choices
Version 1

Block 13 - Initialization - Update Info

Type / Role
n8n-nodes-base.dataTableTool - dataTableTool
Config choices
Version 1

Block 14 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 15 - Execute a SQL query

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 16 - Get row(s)1

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 17 - Supabase Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.3

Block 18 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 19 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 20 - Update row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 21 - Supabase Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.3

Block 22 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 23 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 24 - Get row(s)2

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Showing the first 24 of 87 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail
Complexity advanced
Nodes 87
Categories Personal Productivity, AI Chatbot
Author Shabbir Noor
Published 25 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13717/13717.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Run a self-hosted multi-channel AI assistant with Claude, Gemini and Gmail do?

n8nClaw — Self Hosted AI Assistant A lightweight, self hosted AI assistant built entirely in n8n. Multi channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autono...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Chatbot use case.