๐ Integrate OpenClaw AI agent with Dify AI workflow platform
English | ไธญๆๆๆกฃ
This project enables seamless integration between OpenClaw (Telegram AI agent) and Dify (AI application development platform), allowing you to:
- ๐ฑ Chat with Dify AI workflows via Telegram
- ๐ค Build powerful AI agents with visual workflow editor
- ๐ Connect multiple AI models and services
- ๐ Create knowledge bases for Q&A systems
- ๐จ Design custom AI applications without coding
Inspired by openclaw-n8n-starter, this project replaces n8n with Dify for AI-first workflow automation.
- OpenClaw - AI agent accessible via Telegram
- Dify - Visual AI workflow builder
- Chat applications
- Text completion
- Workflow orchestration
- Knowledge base integration
- Multi-model support (OpenAI, Claude, local LLMs)
- Caddy - Automatic HTTPS reverse proxy
- PostgreSQL - Data persistence
- Redis - Caching and task queue
- ๐ Three-tier network isolation (frontend/backend/egress)
- ๐ OpenClaw not exposed to internet
- ๐ API key authentication
- ๐ Automatic HTTPS certificates
- ๐ Container security hardening
- Ubuntu 24.04 server (4GB+ RAM recommended)
- Telegram Bot Token (get from @BotFather)
- Telegram User ID (get from @userinfobot)
- OpenAI API Key (get from OpenAI)
# SSH into your server
ssh root@your-server
# Download and run setup script
curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/openclaw-dify-starter/main/setup.sh | bashThe script will:
- โ Install Docker and Docker Compose
- โ Configure firewall (ufw)
- โ Build OpenClaw from source
- โ Generate secure random keys
- โ Set up Caddy for HTTPS
- โ Start all services
# Clone the repository
git clone https://github.com/YOUR_USERNAME/openclaw-dify-starter.git
cd openclaw-dify-starter
# Run setup script
chmod +x setup.sh
./setup.shInternet
โ
โโโโ Telegram โโโโโโโโโโโบ OpenClaw (internal only)
โ โ
โ โผ
โโโโ HTTPS โโโบ Caddy โโโบ Dify โโโ
โ
โผ
PostgreSQL + Redis (internal)
- Frontend Network: Public-facing services (Caddy, Dify Web)
- Backend Network: Internal services (PostgreSQL, Redis)
- Egress Network: Outbound connections only
- README.md - Quick start guide
- CONTRIBUTING.md - Contribution guidelines
- LICENSE - MIT License
- ไฝฟ็จๆๅ.md - Comprehensive user guide
- ้กน็ฎ่ฏดๆ.md - Detailed project overview
- ๅฏนๆฏ่ฏดๆ.md - Comparison with n8n version
- ๅทฅไฝๆต็คบไพ.md - 7 practical workflow examples
- ๅฟซ้ๅ่.md - Command reference
- Upload documents to Dify knowledge base
- Query via Telegram through OpenClaw
- Get AI-powered intelligent answers
- Build company knowledge base
- Employees query through Telegram
- 24/7 automated support
- Configure multiple AI models
- Compare responses
- Optimize prompts and workflows
- Text summarization
- Translation
- Creative writing
- Code generation
We provide 7 ready-to-use examples (view in Chinese):
- ๐ฐ Daily News Summary Bot
- ๐ Intelligent Document Q&A
- ๐ Multi-language Translation
- ๐ป Code Review Assistant
- ๐ Personal Diary Analyzer
- ๐ก RSS Monitor & Notifier
- ๐ Meeting Notes Summarizer
See .env.example for all configuration options:
# Required
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_USER_ID=your_telegram_user_id
OPENAI_API_KEY=your_openai_api_key
# Auto-generated during setup
OPENCLAW_GATEWAY_TOKEN=auto_generated
DIFY_SECRET_KEY=auto_generated
POSTGRES_PASSWORD=auto_generatedAfter deployment (replace 123.45.67.89 with your server IP):
- Dify Web UI:
https://123.45.67.89.nip.io - OpenClaw Gateway: Internal only (port 18789)
- Telegram Bot: Search for your bot in Telegram
| Feature | n8n-starter | dify-starter |
|---|---|---|
| Focus | General automation | AI applications |
| AI Capabilities | Via integration | Built-in |
| Knowledge Base | Plugin required | Native support |
| Learning Curve | Medium | Lower |
| RAM Required | 2GB | 4GB |
| Best For | Integrations | AI agents |
See ๅฏนๆฏ่ฏดๆ.md for detailed comparison.
OpenClaw skills for Dify integration (in skills/ directory):
- dify-api - General Dify API integration (Docker internal network)
- dify-api/SKILL_ไบ็ซฏ็.md - Cloud Dify setup guide
- dify-cloud-ready - Ready-to-use cloud configuration
Each skill includes:
- Complete API documentation
- Usage examples
- Error handling
- Best practices
-
"Workflow not published"
- Publish your application in Dify Web UI first
-
Port conflicts
- Stop conflicting services:
docker compose down
- Stop conflicting services:
-
Skill not found
- Ensure skill is in correct OpenClaw workspace path
-
API errors
- Check API key is correct
- Verify application is published
- Check logs:
docker compose logs -f dify-api
# View all logs
docker compose logs -f
# View specific service
docker compose logs -f dify-api
docker compose logs -f openclaw-gateway
# Check service status
docker compose ps
# Resource usage
docker statsWe welcome contributions! See CONTRIBUTING.md for guidelines.
Areas we need help:
- ๐ Documentation improvements
- ๐ง New workflow examples
- ๐ Translations
- ๐ Bug reports and fixes
- โจ Feature requests
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenClaw - AI agent framework
- Dify - AI application platform
- openclaw-n8n-starter - Original inspiration
- ๐ Documentation
- ๐ฌ GitHub Discussions
- ๐ Issues
If you find this project helpful, please give it a star! It helps others discover the project.
Built with โค๏ธ for the OpenClaw and Dify communities