Back to .md Directory

AI Bot Deployment Guide

Integration of acreprofit-marketing AI agents with acreprofit-web serverless infrastructure.

May 2, 2026
0 downloads
0 views
ai agent workflow
View source

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:

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:

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

# 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:

{
  "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:

# .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

# 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

# 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

# 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

# Check deployment history
aws dynamodb scan \
  --table-name acreprofit-bots \
  --limit 10 \
  --scan-index-forward false

API History Endpoint

# 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:

# 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:

# In workflow
env:
  BOT_WEBHOOK: ${{ secrets.BOT_WEBHOOK_URL }}

Webhook Signature Validation

Verify webhook came from Zapier:

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
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

Related Documents