# Serverless-Clawdbot: An Agentic OS and API Workflow Engine Based on Edge Functions

> An open-source project that transforms traditional resident daemon architecture into a serverless-friendly form. It leverages Vercel Edge Functions and Workflow DevKit to implement an AI agent system with persistent queues and autonomous capabilities, supporting multi-channel interactions via Telegram, WhatsApp, and SMS.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-08T22:45:20.000Z
- 最近活动: 2026-04-08T22:53:50.769Z
- 热度: 159.9
- 关键词: serverless, edge-functions, agentic-ai, workflow, telegram-bot, whatsapp-api, vercel, redis
- 页面链接: https://www.zingnex.cn/en/forum/thread/serverless-clawdbot-agenticapi
- Canonical: https://www.zingnex.cn/forum/thread/serverless-clawdbot-agenticapi
- Markdown 来源: floors_fallback

---

## Serverless-Clawdbot: Core Overview

Serverless-Clawdbot is an open-source project that transforms traditional resident daemon architecture into a serverless-friendly form. It uses Vercel Edge Functions and Workflow DevKit to build an AI agent system with persistent queues and autonomous capabilities, supporting multi-channel interactions (Telegram, WhatsApp, SMS). The project addresses limitations of traditional AI agent frameworks in deployment, scalability, and cost-effectiveness.

## Project Background & Architecture Transition

With the popularity of serverless and edge computing, traditional AI agent systems' architecture is undergoing profound changes. Most existing AI assistants rely on resident background processes (daemon) to maintain state, handle message queues, and execute scheduled tasks. This architecture has limitations in deployment, scalability, and cost-effectiveness. Serverless-Clawdbot provides an innovative solution: converting the traditional resident daemon architecture into a serverless-friendly form while maintaining original UI interaction conventions, using Vercel Edge Functions and Workflow DevKit to reconstruct the underlying execution model.

## Core Architecture & Multi-channel Support

### Single Public Gateway Route
All functions converge to a single public gateway route `app/api/claw/route.ts`, leveraging serverless advantages (on-demand startup, auto-scaling, pay-as-you-go). All external interactions (health checks, pairing authentication, message reception, Webhook calls) are processed through this entry point.

### Persistent Queue & Autonomous Capabilities
Using Workflow DevKit's `use workflow` and `use step` primitives, workflow steps are naturally persistent (auto-recovered if interrupted). The `daemonWorkflow()` function uses `sleep("1s")` to simulate the main loop of traditional daemons, with a 1-minute Cron watchdog to ensure continuous operation, overcoming Vercel Cron's 1-second scheduling limitation.

### Multi-channel Message Support
Native support for three channels:
- Telegram: Full Bot API support with Webhook verification key.
- WhatsApp Cloud API: Meta official API integration with verification token and access token configuration.
- Textbelt SMS: JSON-formatted SMS reply Webhook endpoint.
Each channel has independent endpoints but uses a unified internal mechanism.

## Security & Authentication Mechanisms

### Pairing System
By default, the system is in 'locked' mode. Unknown senders receive a 6-digit pairing code and must reply with `/pair` command to verify. Pairing codes are dynamically generated when needed, stored in Redis, and output via Vercel function logs. Admins can preset allowed identities via `ADMIN_IDENTITIES` (format: `telegram:123456789,sms:+15551234567`).

### Autonomous Mode Control
Two modes:
- **Assistive (default)**: Avoids destructive operations unless explicitly requested.
- **Full**: Allows more free actions (use with caution).
This hierarchical authorization balances security and convenience.

## Integration & Expansion Capabilities

### Composio Integration
Built-in support for Composio (third-party service integration platform), enabling access to hundreds of SaaS APIs (GitHub, Google Workspace, Slack, Notion, etc.). Integration is optional and filterable.

### SSH Tool
Optional SSH tool with strict allowlist restrictions, providing server management capabilities while maintaining security.

### Webhook API
Exposes a Webhook API for external systems to trigger agent message delivery. Requires `x-claw-secret` header verification, supporting message sending and task scheduling.

## Deployment & Operation Guidelines

### Redis Configuration
State persistence relies on Redis. Two options:
- Upstash Redis (recommended): Use `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN`.
- Vercel-injected Redis variables: Use `KV_REST_API_URL` and `KV_REST_API_TOKEN`.
Falls back to in-memory storage if no Redis variables are configured (suitable for local development, not production).

### Management Interface
Web management interface (`/ui`) for configuring Webhooks, sending test messages, and connecting Composio. Requires `ADMIN_UI_PASSWORD` environment variable.

### Workflow DevKit Debugging
Use `npm run workflow:web` to start Workflow DevKit UI for local log checking and state monitoring, helpful for debugging workflow logic.

## Technical Highlights & Innovation Value

Serverless-Clawdbot proves AI agents can run efficiently on serverless architecture, with multiple values:
- **Cost Optimization**: Pay-as-you-go model means no cost when idle, attractive for individual developers and small teams.
- **Auto-scaling**: Cloud platform auto-scaling handles sudden traffic without manual server configuration.
- **Simplified Operation**: No need to manage servers, daemons, or container orchestration, allowing focus on agent logic.
- **Architectural Demonstration**: Provides a concrete example for migrating traditional resident applications to serverless, with generalizable design patterns.

## Application Scenarios & Future Outlook

### Suitable Scenarios
- Individual developers needing to quickly deploy AI assistant prototypes.
- Applications with fluctuating message volumes and hard-to-estimate server resources.
- Small teams wanting to reduce operation and maintenance burden.
- Scenarios requiring unified multi-channel message processing.

### Usage Suggestions
1. Configure `ADMIN_IDENTITIES` carefully to avoid repeated pairing.
2. Choose autonomous mode based on actual needs; use `full` mode cautiously.
3. Must configure Redis in production (avoid in-memory storage).
4. Regularly check Vercel function logs to monitor agent status.
5. Use Workflow DevKit for development and debugging.

### Future Outlook
As edge computing and serverless technologies develop, more similar projects will emerge, pushing AI agent deployment towards lighter and more flexible models. Serverless-Clawdbot provides valuable practical references for this trend.
