Production-ready examples for integrating ClawTick with popular AI frameworks.
1. LangChain
Complete LangChain agent with custom tools and FastAPI webhook endpoint.
Features:
- OpenAI Functions Agent
- Custom tools (time, search, calculator)
- Production-ready error handling
- Comprehensive logging
Use Cases:
- Task automation
- Information retrieval
- Multi-step workflows
2. CrewAI
Multi-agent CrewAI workflow with configurable crew types.
Features:
- Multiple agent types (Research, Write, Edit, Analyze)
- Sequential and hierarchical workflows
- Three pre-built crew configurations
Use Cases:
- Content creation
- Research and analysis
- Report generation
3. Custom Agent
Minimal example using OpenAI API directly.
Features:
- Simple and lightweight
- Easy to understand and modify
- Great starting point for custom implementations
Use Cases:
- Simple Q&A bots
- Text generation
- Quick prototypes
4. Docker
Docker and docker-compose configuration for easy deployment.
Features:
- Multi-service deployment
- Health checks
- Auto-restart
- Environment variable configuration
# Choose an example
cd langchain # or crewai, custom-agent
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your credentials
# Run the server
python *.py# Set environment variables
export OPENAI_API_KEY="sk-..."
export AGENT_API_KEY="your-secret-key"
# Run all services
cd docker
docker-compose up -d
# Check status
docker-compose ps
# View logs
docker-compose logs -f# Build
docker build -t my-agent -f docker/Dockerfile langchain/
# Run
docker run -d \
-p 8000:8000 \
-e OPENAI_API_KEY="sk-..." \
-e AGENT_API_KEY="your-key" \
my-agentAll examples use the same environment variables:
# Required
OPENAI_API_KEY=sk-your-openai-api-key
AGENT_API_KEY=your-secret-api-key-for-clawtick
# Optional
PORT=8000 # Server port (default: 8000)cd langchain # or crewai, custom-agent
heroku create my-clawtick-agent
heroku config:set OPENAI_API_KEY=sk-...
heroku config:set AGENT_API_KEY=your-key
git push heroku mainrailway login
railway init
railway up- Connect GitHub repository
- Select example directory
- Add environment variables
- Deploy
fly launch
fly secrets set OPENAI_API_KEY=sk-...
fly secrets set AGENT_API_KEY=your-key
fly deployAfter deploying your agent, configure ClawTick:
- Go to clawtick.com/dashboard/jobs
- Click "Create Job"
- Select "Webhook" integration
- Fill in:
- Webhook URL: Your deployed endpoint
- HTTP Method: POST
- Headers:
{"Authorization": "Bearer your-secret-api-key"}
- Click "Test Webhook" to verify
- Create job
# Install ClawTick CLI
npm install -g clawtick
# Login
clawtick login --key cp_your_api_key
# Create job
clawtick job create \
--integration webhook \
--cron "0 9 * * *" \
--message "Your task description" \
--webhook-url "https://your-agent.com/trigger" \
--webhook-method POST \
--webhook-headers '{"Authorization": "Bearer your-key"}' \
--name "my-scheduled-job"curl -X POST http://localhost:8000/trigger \
-H "Authorization: Bearer your-secret-key" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, world!",
"jobId": "test-123",
"jobName": "test-job",
"runId": "run-456",
"timestamp": "2025-02-14T10:00:00Z"
}'# Start your server
python langchain/fastapi-agent.py
# In another terminal
ngrok http 8000
# Use the ngrok URL in ClawTickAll examples expect this request format:
{
"message": "Your task or question",
"jobId": "unique-job-identifier",
"jobName": "human-readable-job-name",
"runId": "unique-execution-identifier",
"timestamp": "2025-02-14T10:00:00.000Z"
}ClawTick automatically populates these fields using template variables:
{
"message": "{{message}}",
"jobId": "{{jobId}}",
"jobName": "{{jobName}}",
"runId": "{{runId}}",
"timestamp": "{{timestamp}}"
}Expected response format:
{
"success": true,
"result": "Agent response or output",
"jobId": "job-123",
"runId": "run-456",
"timestamp": "2025-02-14T10:00:00Z"
}- Always use HTTPS in production
- Use strong API keys (32+ random characters)
- Store secrets in environment variables (never commit to git)
- Implement rate limiting for production endpoints
- Log security events (failed auth attempts, etc.)
- Use webhook signatures for additional security
- Validate all inputs before processing
- Check if server is running:
curl http://localhost:8000/health - Verify port is correct
- Check firewall rules
- Verify API key matches between ClawTick and server
- Check Authorization header format:
Bearer your-key - Ensure key is set in environment variables
- Check server logs for detailed error
- Verify OpenAI API key is valid
- Ensure all dependencies are installed
- Optimize agent execution time
- Increase timeout (ClawTick timeout: 30s)
- Consider async processing for long tasks
- GitHub Issues: clawtick/examples/issues
- Discord: ClawTick Community
- Email: support@clawtick.com
MIT License - see individual example directories for details.
Need help? Check out our detailed guide or reach out on Discord!