This workflow implements an advanced AI automation agent (OpenClaw Agent) that interacts with users through Telegram and integrates multiple AI models, external tools, and cloud services to automate complex tasks.
I've described my basic idea in this video.
VERY IMPORTANT:
By adapting the system prompt, inserting subworkflows or mcp servers and adjusting with webhooks many of the workflows I have developed on this page it is possible to potentially extend the template infinitely.
The agent can autonomously decide which tools to use to complete the request. It has access to multiple integrations, including:
The system also includes persistent chat memory stored in PostgreSQL, allowing the AI to remember previous interactions and maintain conversation context.
Finally, the workflow generates a response and sends it back to the user via Telegram. If the input was voice-based, the response can also be converted into audio and returned as a voice message.
An escalation mechanism allows the system to transfer the conversation to a human operator when needed.
The workflow supports text, voice, and image inputs, allowing users to interact with the system naturally.
The integrated AI agent can autonomously decide which tools to use to solve tasks, reducing manual intervention and enabling intelligent automation.
The workflow can manage emails, documents, spreadsheets, presentations, and calendar events directly through AI commands.
The system can access external knowledge sources through a vector database, improving response accuracy and enabling knowledge-based answers.
Conversation history is stored in PostgreSQL, allowing the agent to maintain context and provide more relevant responses over time.
Built-in web search and scraping capabilities allow the agent to gather real-time information from the internet.
The system can generate audio responses, creating a more natural conversational experience.
The workflow is highly modular, allowing new tools, agents, and services to be added easily.
When automation is not sufficient, the system can escalate the conversation to a human operator.
Overall, the workflow acts as a fully autonomous AI assistant capable of performing complex operational tasks across multiple platforms.
This workflow is a comprehensive Telegram-based AI orchestrator that simulates an OpenClaw-style multi-agent architecture. When a user sends a message to the Telegram bot, the workflow:
Receives and authorizes the message through a Telegram trigger, checking if the user ID matches an authorized user (configured in the Code node)
Routes different content types using a Switch node that detects whether the incoming message contains text, voice, or images:
Feeds the processed input (text, transcribed voice, or image URL with caption) into the "OpenClaw Agents" node - an AI agent configured with Gemini as the language model and Postgres for chat memory
Orchestrates specialized sub-agents through the main AI agent, which can delegate tasks to multiple tools:
Handles response delivery based on the original message type:
Includes escalation capabilities through a human-in-the-loop tool for situations requiring human intervention
Configure Telegram Bot
XXX in the Code node with your authorized Telegram user IDSet up API Keys and Credentials
Configure External Services
/XXX/ in Upload image node with actual path and domain in Set Image Url node)Configure Webhooks and Endpoints
Review and Adjust Parameters
XXX)Test and Activate
👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n.
Contact me for consulting and support or add me on Linkedin.