BotKit Overview
BotKit extends the Platform’s conversational AI by letting you:- Implement custom business logic in conversation flows via webhooks.
- Integrate with unsupported messaging or voice channels.
- Handle conversation lifecycle events for complex workflows.
- Connect to external services not covered by the standard API node.
| Use Case | Description |
|---|---|
| Channel integrations | Add support for custom mobile SDKs or IoT devices |
| Custom NLU models | Inject external NLP models tuned on proprietary data |
| Conversation lifecycle handlers | Trigger custom logic on events like conversation start/close |
| Non-standard integrations | Connect via webhooks to on-premise or legacy systems |
| Custom analytics | Capture KPIs not available out-of-the-box; send to third-party analytics |
Deployment Steps
Step 1 — Create a Golden Image
-
Launch a new EC2 instance with one of the following base OS:
- Amazon Linux 2
- CentOS / Red Hat 7.x or above
m5.xlarge(4 vCPU, 16 GB RAM, 20 GB OS disk, 50 GB data disk) -
Update OS packages:
- Install Node.js (supported version).
- Install Nginx (latest).
-
Verify both installations:
- Create a deploy script to pull the build from your central repository and extract it to the data disk.
- Create startup scripts to bring up BotKit and Nginx services.
- Configure Nginx to listen on port 80 and proxy to the BotKit instance.
- Create the Golden Image (AMI) from this instance.
Step 2 — Set Up an Application Load Balancer
- Create an external (internet-facing) Application Load Balancer (ALB).
- Add a listener on port 443 with an SSL certificate (use ACM).
- Create a target group targeting backend instances on port 80 and assign it to the listener.
Step 3 — Configure DNS
- Create an A or CNAME record in your external domain pointing to the ALB.
Step 4 — Set Up ElastiCache for Redis (Optional)
If BotKit uses Redis for async payload storage:- Launch an AWS ElastiCache cluster for Redis with appropriate capacity.
Step 5 — Create a Launch Template
- Create a Launch Template using the Golden AMI.
- Configure VPC settings: subnets, security groups, IAM role.
- In User Data, invoke the deploy script to pull the latest build and start services.
- Set this version as the default.
Step 6 — Configure an Auto Scaling Group
- Create an Auto Scaling Group (ASG) using the Launch Template.
- Configure all required settings per your internal policies.
- Attach the target group so instances register with the ALB automatically.
- Enable SNS notifications for instance launch/termination events.
- Set a CPU utilization threshold for scale-out per your internal policies.
Step 7 — Maintain a Configuration Repository
- Store all BotKit and Nginx configuration files in a central repository (Git, S3, etc.) separate from the application code.
Step 8 — Implement a CI/CD Pipeline
Use Jenkins or equivalent automation:- Check out the BotKit codebase.
- Check out configuration files from the configuration repository.
- (Optional) Run
npm installfor dependencies. - Create an archive and push it to S3 or Artifactory.
- Invoke the deploy script using a rolling deployment:
- Remove one server from the ALB.
- Deploy the build and restart services.
- Reattach the server to the ALB.
- Repeat for remaining servers.
- (Optional) Add a vulnerability scan step and gate the pipeline on the scan result.
Security Patching
- Apply patches to the Golden Image.
- Launch a standalone server from the updated image and validate the application.
- On successful validation, launch new servers via the ASG and terminate the old ones.