Replit Agent
Collaboration
Deployments
App Builder
Website Builder
Game Builder
Dashboard Builder
Chatbot Builder
Product Managers
Designers
Operations
Software Engineers
IT
SMB Owners
DevRel
Founders
TeamsPricingBlogCareers
Contact salesLog inSign up
  • Teams
  • Pricing
  • Blog
  • Careers
Contact salesLog in
Start building
GuidesHow to Build an AI Sales Development Representative (SDR) in Slack - Part 4: Campaign Creation

How to Build an AI Sales Development Representative (SDR) in Slack - Part 4: Campaign Creation

A guide by
Image of Horacio LopezHoracio Lopez
Cover page with title "Build an AI SDR - Part 4"
Get a demo
Try for free
Table of ContentsIntroductionGetting StartedBreaking Down the Enhanced AI Sales Assistant CodeDeploying Your AI SDRWhat's Next for Your AI Sales Assistant
Recent Posts
Slackbot Quickstart Guide
Create a virtual whiteboard with Roboflow vision models
How to Build Your Own Simple Poll Slack App
AI Support Specialist With Groq - Part I

Introduction #

In this fourth part of our AI SDR series, we'll enhance our AI sales assistant with email campaign creation capabilities. With this template and guide, your AI SDR will not only find, enrich leads with emails, and generate personalized email sequences, but also create campaigns in Smartlead, significantly boosting your sales team's efficiency and outreach effectiveness.

This guide is Part 4 of a six-part series for how to build your own AI SDR (Sales Development Representative) in Slack. This template includes the code from Parts 1-3 and the subsequent guides are linked at the bottom of this post.

Getting Started #

To begin enhancing your AI sales assistant with campaign creation and execution capabilities, fork this template by clicking "Use Template" below:

Use the template

Smartlead API

For this enhanced version of our AI for lead generation and outreach, you'll need to get a Smartlead API key in the following way:

  • Head to your Smartlead Profile Settings
  • On the Your Profile page, you'll see a section titled Smartlead API Key
  • Click the Copy button next to the key.
  • Open your Replit Project to the Secrets tool. To find it, type ⌘ + K (or Ctrl + K) and search for "secrets"
  • Paste in your key into the value for SMARTLEAD_API_KEY

Breaking Down the Enhanced AI Sales Assistant Code #

Let's explore the key components that make our AI SDR a more powerful tool for lead generation, qualification, email sequence generation, and campaign execution:

Smartlead Campaign Creation and Lead Upload

The create_smartlead_campaign and upload_leads_to_smartlead functions in utils.py handle the creation of campaigns and uploading of leads to Smartlead:

These functions create a new campaign in SmartLead and upload the enriched leads to that campaign.

Saving Email Sequences to Smartlead

The save_campaign_sequence function in utils.py saves the generated email sequence to the Smartlead campaign:

This function takes the generated email sequence and saves it to the Smartlead campaign, setting up the entire outreach sequence.

Executing the Campaign Creation Process

In main.py, we've updated the post_final_email_sequence function to handle the entire campaign creation and execution process:

This function orchestrates the entire process of creating a SmartLead campaign, uploading leads, saving the email sequence, and providing a summary of the created campaign to the user in Slack.

Deploying Your AI SDR #

In order to keep your AI SDR running 24/7 and receive requests whenever someone mentions it in Slack, you'll need to deploy it on a hosted server.

Open a new tab in the Workspace and search for “Deployments” or open the control console by typing ⌘ + K (or Ctrl + K) and type "deploy". You should find a screen like this.

Replit Deployments selection UI

For bots like this that need always need to be up listening to requests, we recommend using a Reserved VM. On the next screen, click Approve and configure build settings most internal bots work fine with the default machine settings but if you need more power later, you can always come back and change these settings later. You can monitor your usage and billing at any time at: replit.com/usage.

On the next screen, you’ll be able to set your primary domain and edit the Secrets that will be in your production deployment. Usually, we keep these settings as they are.

Finally, click Deploy and watch your bot go live!

What's Next for Your AI Sales Assistant #

With these enhancements, your AI SDR is now a comprehensive end-to-end tool for lead generation, email address enrichment, email sequence generation, and campaign creation.

In the next part of this series, we'll be adding the ability for the assistant to add your leads and into your HubSpot CRM. The other parts of the series include:

  • AI SDR - Part 1 - Lead List Creation
  • AI SDR - Part 2 - Lead Enrichment
  • AI SDR - Part 3 - Draft Email Copy
  • AI SDR - Part 4 (this guide) - Create Smartlead campaign
  • AI SDR - Part 5 - Add Leads to HubSpot
  • AI SDR - Part 6 (Final) - Agent Mode

If you'd like to discuss how to enable your team to build and implement tools like these, feel free to schedule some time with the Replit team for a quick demo of our product.

Happy coding and selling!

Replit

  • Mobile App
  • Desktop App
  • Blog
  • Careers
  • About
  • Pricing
  • Guides

Features

  • Replit Agent
  • Collaboration
  • Deployments
  • Teams

Legal

  • Terms of service
  • Teams agreement
  • Privacy
  • Subprocessors
  • DPA
  • Report abuse

Connect

  • X / Twitter
  • Tiktok
  • Facebook
  • Instagram
  • Linkedin

Languages

  • Python
  • Javascript
  • TypeScript
  • Node.js
  • Nix
  • HTML, CSS, JS
  • C++
  • Golang

Handy Links

  • Vibe Coding 101
  • Customer Showcase
  • Languages
  • Docs
  • Help
  • Status
  • Import from GitHub
  • Copilot alternative
  • Brand kit
  • Partnerships
All rights reserved. Copyright © 2025 Replit, Inc.