Loading...
Loading...
Loading...
Integration of acreprofit-marketing AI agents with acreprofit-web serverless infrastructure.
# AI Bot Deployment Guide
Integration of acreprofit-marketing AI agents with acreprofit-web serverless infrastructure.
---
## ๐ฏ Overview
The deployment system automatically triggers your 8 AI marketing bots from GitHub Actions workflows. Bots execute through Zapier webhooks, interacting with your marketing tools.
**Architecture:**
```
GitHub Push
โ
GitHub Actions (deploy-ai-bots.yml)
โ
AWS Lambda (bot_orchestrator.py)
โ
Zapier Webhooks
โ
AI Bots (8 agents)
โ
Marketing Tools (Buffer, Klaviyo, etc.)
```
---
## ๐ Prerequisites
1. **Both repos connected:**
- โ
acreprofit-web (infrastructure)
- โ
acreprofit-marketing (AI bots)
2. **GitHub secrets configured:**
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `SLACK_WEBHOOK` (notifications)
3. **Lambda environment variables:**
- `DYNAMODB_TABLE` - Bot deployment tracking table
- `GITHUB_TOKEN` - For accessing marketing repo
- `BRAND_BUILDER_WEBHOOK` - Zapier webhook URL
- `CONTENT_CREATOR_WEBHOOK`
- `SOCIAL_MANAGER_WEBHOOK`
- `EMAIL_STRATEGIST_WEBHOOK`
- `MEDIA_BUYER_WEBHOOK`
- `SEO_STRATEGIST_WEBHOOK`
- `EVENT_COORDINATOR_WEBHOOK`
- `DATA_ANALYST_WEBHOOK`
---
## ๐ Quick Start
### Deploy All Bots (Default)
**From GitHub:**
```
Actions โ Deploy AI Bots to Infrastructure
Run workflow โ campaign_name: "week-1-launch"
Leave "bots" empty โ All 8 bots deploy
```
**From API:**
```bash
curl -X POST https://api.acreprofit.io/bots/deploy \
-H "Content-Type: application/json" \
-d '{
"action": "trigger_campaign",
"campaign_name": "week-1-launch"
}'
```
### Deploy Specific Bots
**From GitHub:**
```
Actions โ Deploy AI Bots
campaign_name: "ads-test"
bots: "media-buyer, data-analyst"
```
**From API:**
```bash
curl -X POST https://api.acreprofit.io/bots/deploy \
-H "Content-Type: application/json" \
-d '{
"action": "trigger_campaign",
"campaign_name": "ads-test",
"bots": ["media-buyer", "data-analyst"]
}'
```
---
## ๐ง Configuration
### Set Lambda Environment Variables
```bash
# Get function name
FUNCTION_NAME=$(aws lambda list-functions --query 'Functions[?FunctionName==`acreprofit-api`].FunctionName' --output text)
# Update environment variables
aws lambda update-function-configuration \
--function-name $FUNCTION_NAME \
--environment Variables={
DYNAMODB_TABLE=acreprofit-bots,
GITHUB_TOKEN=your_github_token,
BRAND_BUILDER_WEBHOOK=https://hooks.zapier.com/hooks/catch/...,
CONTENT_CREATOR_WEBHOOK=https://hooks.zapier.com/hooks/catch/...,
...
}
```
### Add Zapier Webhooks
For each bot, create a Zapier webhook:
1. **Zapier Dashboard** โ Create Zap
2. **Trigger**: Webhooks by Zapier โ Catch Raw Hook
3. **Action**: Connect to your marketing tools
4. **Webhook URL**: Copy to Lambda environment
5. **Test**: Send sample payload
Example payload structure:
```json
{
"bot": "content-creator",
"campaign": "week-1-launch",
"instructions": "Create 5 blog posts about...",
"timestamp": "2026-01-24T15:30:00Z"
}
```
---
## ๐ Bot Descriptions
### 1. Brand Builder
- **Role**: Website design, brand identity
- **Tools**: Midjourney, Webflow, Figma
- **Output**: Brand guidelines, website layouts
- **Webhook**: Triggers brand asset creation
### 2. Content Creator
- **Role**: Blog posts, email copy, webinar scripts
- **Tools**: Claude, Jasper, Grammarly
- **Output**: Content calendar, written materials
- **Webhook**: Generates weekly content
### 3. Social Manager
- **Role**: Facebook, Instagram, LinkedIn, TikTok
- **Tools**: Buffer, Later, Canva
- **Output**: Social posts, graphics, scheduling
- **Webhook**: Posts to all platforms
### 4. Email Strategist
- **Role**: Email sequences, automation, list building
- **Tools**: Klaviyo, Privy
- **Output**: Email campaigns, automations
- **Webhook**: Launches email sequences
### 5. Media Buyer
- **Role**: Facebook & Google ads optimization
- **Tools**: Facebook Ads Manager, Google Ads, Hyros
- **Output**: Ad campaigns, bid strategies
- **Webhook**: Launches ad campaigns
### 6. SEO Strategist
- **Role**: Keywords, content optimization, backlinks
- **Tools**: SE Ranking, Surfer, Ahrefs
- **Output**: SEO recommendations, content briefs
- **Webhook**: Generates SEO content
### 7. Event Coordinator
- **Role**: Webinars, conferences, trade shows
- **Tools**: Eventbrite, Zoom, StreamYard
- **Output**: Event pages, promotions
- **Webhook**: Launches events
### 8. Data Analyst
- **Role**: KPIs, reporting, optimization
- **Tools**: Mixpanel, Tableau, GA4
- **Output**: Dashboards, reports
- **Webhook**: Generates analytics reports
---
## ๐ Workflow Examples
### Weekly Campaign Launch (Automated)
**Triggered by GitHub Actions schedule:**
```yaml
# .github/workflows/campaign-launch.yml
schedule:
- cron: '0 6 * * 1' # Every Monday 6am
```
Automatically:
1. Reads campaign config from marketing repo
2. Triggers all bots via API
3. Logs deployment status
4. Sends Slack notification
### Manual Ad Testing Campaign
```bash
# Deploy only media buyer to test ads
curl -X POST https://api.acreprofit.io/bots/deploy \
-d '{
"campaign_name": "ad-test-jan24",
"bots": ["media-buyer"]
}'
```
### Emergency Content Creation
```bash
# When trending topic appears, deploy content bots
curl -X POST https://api.acreprofit.io/bots/deploy \
-d '{
"campaign_name": "trending-topic-$(date +%s)",
"bots": ["content-creator", "social-manager"]
}'
```
---
## ๐ Monitor Deployments
### GitHub Actions
```
GitHub โ Actions โ Deploy AI Bots to Infrastructure
View deployment logs in real-time
```
### CloudWatch Logs
```bash
# View Lambda logs
aws logs tail /aws/lambda/acreprofit-api --follow
# Check specific campaign
aws logs filter-log-events \
--log-group-name /aws/lambda/acreprofit-api \
--filter-pattern "week-1-launch"
```
### DynamoDB Deployments
```bash
# Check deployment history
aws dynamodb scan \
--table-name acreprofit-bots \
--limit 10 \
--scan-index-forward false
```
### API History Endpoint
```bash
# Get last 10 deployments
curl https://api.acreprofit.io/bots/history?limit=10
# Get specific bot history
curl https://api.acreprofit.io/bots/history?bot_name=content-creator
```
---
## ๐ Troubleshooting
### "Lambda function not found"
- Check function name in workflow
- Verify IAM permissions
- Confirm function was deployed
### "Webhook failed"
- Verify Zapier webhook URL in Lambda environment
- Test webhook with `curl`
- Check Zapier logs for errors
- Ensure webhook is enabled
### "DynamoDB table not found"
- Create table: `acreprofit-bots`
- Add partition key: `bot_id`
- Enable TTL (optional, 90 days)
### "GitHub token invalid"
- Generate new token at github.com/settings/tokens
- Ensure `repo` and `contents` scopes
- Update Lambda environment variable
### "Deployment hangs"
- Check CloudWatch logs
- Verify webhook endpoints are responsive
- Check for timeout issues (increase Lambda timeout)
- Monitor Zapier execution history
---
## ๐ Security
### API Key Protection (Optional)
Add API key authentication to endpoints:
```yaml
# In API Gateway, add authorizer
type: REQUEST
identity_source: method.request.header.Authorization
validation_expression: ^Bearer [-0-9a-zA-z\.]*$
```
### Environment Variables
Never commit API keys or webhook URLs. Use GitHub secrets:
```yaml
# In workflow
env:
BOT_WEBHOOK: ${{ secrets.BOT_WEBHOOK_URL }}
```
### Webhook Signature Validation
Verify webhook came from Zapier:
```python
import hmac
import hashlib
def verify_zapier_signature(request):
signature = request.headers.get('X-Zapier-Signature')
body = request.body
secret = os.getenv('ZAPIER_SECRET')
expected = hmac.new(
secret.encode(),
body.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected)
```
---
## ๐ Success Metrics
After first campaign deployment:
**Expected Results (Week 1):**
- โ
5+ blog posts published
- โ
20+ social posts scheduled
- โ
3+ email sequences active
- โ
Ad campaigns running
- โ
Analytics dashboard updated
**Deployment Efficiency:**
- Deployment time: < 5 minutes
- Bot success rate: 95%+
- Webhook reliability: 99%+
- Error handling: Automatic retries
---
## ๐ฏ Next Steps
1. **Configure Zapier webhooks** for all 8 bots
2. **Set Lambda environment variables** with webhook URLs
3. **Test single bot deployment** (start with content-creator)
4. **Create campaign configs** in marketing repo
5. **Schedule weekly deployments** via GitHub Actions
6. **Monitor dashboards** for bot execution
7. **Optimize based on results**
---
## ๐ Support
- **Logs**: CloudWatch `/aws/lambda/acreprofit-api`
- **Status**: GitHub Actions workflow runs
- **Webhooks**: Zapier execution history
- **API**: cURL test commands
- **Issues**: GitHub Issues
---
## ๐ Advanced: Custom Bot Deployment
To add a custom bot outside the 8 standard ones:
1. **Add to `agents/` in marketing repo**
2. **Create Zapier webhook for new bot**
3. **Update Lambda environment:** `CUSTOM_BOT_WEBHOOK=...`
4. **Deploy:** Include bot name in API call
```bash
curl -X POST https://api.acreprofit.io/bots/deploy \
-d '{
"campaign_name": "custom-test",
"bots": ["custom-bot", "content-creator"]
}'
```
---
**Status**: โ
Ready to Deploy AI Bots
**Bots**: 8 configured
**Integration**: Serverless Infrastructure + Marketing Automation
**Cost**: Included in $11-18/month infrastructure budget
A standalone type stub package for spotipy using Pydantic models generated from the official Spotify Web API OpenAPI schema.
**Generated**: 2026-03-22
This project provides a comprehensive LLM pricing comparison website with:
<laravel-boost-guidelines>