Joining a new Slack channel often feels like walking into a room after the conversation has already started. You’re met with a wall of text, a backlog of discussions, and a generic, system-generated message: “John Doe has joined the channel.” It’s a cold, impersonal entry into what should be a vibrant, collaborative space. New members are left to fend for themselves, scrolling endlessly to find context, and the initial excitement of joining a new team or project quickly fades into a feeling of being lost in the digital noise. The human touch is completely absent. Imagine, instead, a welcome that feels personal, immediate, and genuinely engaging. Within moments of joining a channel, a video appears, featuring a team lead or community manager. The video greets you by name, offers a brief, dynamic overview of the channel’s purpose, and points you to key resources. This isn’t a pre-recorded, one-size-fits-all video; it’s a unique, AI-generated message created just for you.
This level of hyper-personalization at scale seems like a major technical challenge. Manually recording a video for every new member is impossible, and traditional automation tools lack the sophistication to create dynamic, human-like content. The core problem lies in bridging the gap between a system event—a user joining a channel—and a deeply personal engagement output. While Retrieval-Augmented Generation (RAG) has transformed how we interact with knowledge bases by personalizing data retrieval, the same principles of dynamic content generation can be applied to human-facing communications. How can we build a system that not only recognizes a new member but also crafts a rich, multimedia welcome that reflects our brand and culture?
The solution lies in orchestrating a set of powerful, API-driven AI tools. By creating a workflow that connects Slack’s event system with the generative capabilities of HeyGen for video and ElevenLabs for voice, we can automate this entire process. This isn’t just about sending a notification; it’s about manufacturing a personalized moment that fosters connection from the very beginning. This workflow can parse data from a user’s Slack profile, use it to generate a custom voiceover, and then map that audio to a video avatar, delivering a bespoke welcome video in minutes.
In this technical walkthrough, we will guide you step-by-step through building this exact system. We will cover everything from setting up your Slack application and its permissions to scripting the API calls that orchestrate HeyGen and ElevenLabs. You will learn how to capture a Slack event, process the data, generate a personalized AI video, and post it back into the channel to create a memorable onboarding experience. Get ready to transform your silent welcomes into dynamic conversations.
The Architecture of an Automated Video Onboarding System
Before diving into code and configurations, it’s crucial to understand the high-level architecture of this workflow. At its heart, this is an event-driven system where one action (a user joining a channel) triggers a sequence of automated tasks across multiple platforms. Each component plays a specialized role, and the magic happens when they are orchestrated seamlessly.
Core Components of the Workflow
The process flows in a logical sequence:
1. Trigger (Slack): The entire workflow begins when a new user joins a specific Slack channel. We subscribe to Slack’s member_joined_channel event, which acts as our trigger.
2. Webhook Listener (Middleware): When the event occurs, Slack sends a JSON payload to a pre-defined URL. This URL points to our middleware—a small application or serverless function (e.g., Python Flask app, AWS Lambda, or a Zapier workflow) that listens for these incoming requests.
3. Data Processing & Enrichment: The middleware receives the payload, which contains the new user’s ID and the channel ID. The middleware then makes a call back to the Slack API (users.info) to fetch the user’s full name for personalization.
4. Audio Generation (ElevenLabs): With the user’s name, the middleware constructs a welcome script (e.g., “Hey, Jane! Welcome to the #project-alpha channel.”). It sends this text to the ElevenLabs API, which returns a high-quality, lifelike audio file.
5. Video Generation (HeyGen): The middleware then calls the HeyGen API. It passes the audio file generated by ElevenLabs and any other dynamic text (like the user’s name to be displayed on-screen) to a pre-designed video template. HeyGen renders the final video.
6. Delivery (Slack): Once HeyGen finishes processing the video, our middleware retrieves the video URL. It then calls the Slack chat.postMessage API to post a message in the channel, tagging the new user and embedding the link to their personalized welcome video.
Why HeyGen and ElevenLabs Are the Perfect Pair
Building this system relies on selecting best-in-class tools for each part of the generative process. While some platforms offer all-in-one solutions, combining specialized tools provides superior quality and flexibility.
→ ElevenLabs for Voice: ElevenLabs is a leader in voice AI, renowned for its ability to generate incredibly realistic and emotionally nuanced speech. Its API is fast and reliable, which is critical for delivering a timely welcome message. The ability to clone a specific voice (e.g., a team lead’s) adds a layer of authenticity that generic text-to-speech engines can’t match. Research shows that audio-visual content vastly improves information retention, and a familiar, high-quality voice is key to that.
→ HeyGen for Video: HeyGen specializes in API-driven AI video generation with talking avatars. You can create a reusable template with your branding, background, and avatar, and then programmatically insert a custom audio track and on-screen text. This template-based approach ensures brand consistency while allowing for infinite personalization at scale. By offloading the complex video rendering process to HeyGen, our middleware remains lightweight and focused solely on orchestration.
Step 1: Configuring Your Slack Environment
The foundation of this workflow is a properly configured Slack app that can listen for events and post messages. This involves creating the app, defining its permissions, and telling Slack where to send event notifications.
Creating a Slack App
First, navigate to the Slack API dashboard and click “Create New App.” Choose “From scratch,” give your app a name (e.g., “Personalized Welcome Bot”), and select the workspace where you want to install it.
Setting Scopes and Permissions
Your app needs permission to perform specific actions. In the sidebar of your app’s dashboard, go to “OAuth & Permissions.” Scroll down to the “Scopes” section and add the following Bot Token Scopes:
* channels:read: To get information about public channels.
* groups:read: To get information about private channels.
* users:read: To fetch user profile details like their name.
* chat:write: To post messages in channels.
* chat:write.public: To post messages in public channels the bot isn’t a member of (optional, but useful).
After adding these scopes, install the app to your workspace. This will generate a “Bot User OAuth Token,” which you must copy and save. You will need it to make authenticated API calls.
Enabling Event Subscriptions
Now, you need to tell Slack which events to monitor. Go to the “Event Subscriptions” page and toggle the switch to “On.”
- Request URL: You will need to enter a Request URL where Slack will send the event data via HTTP POST. This will be the public URL of your middleware webhook listener, which we will build in the next step. Slack will send a challenge request to this URL to verify it’s active.
- Subscribe to Bot Events: Expand the “Subscribe to bot events” section and add the
member_joined_channelevent. This tells Slack to notify your app every time someone joins a channel where your bot is present.
Save your changes. Your Slack app is now configured to act as the trigger for our automation.
Step 2: Building the Middleware Logic to Orchestrate the APIs
The middleware is the brain of our operation. For this guide, we’ll use Python with the Flask framework to create a simple web server that acts as our webhook listener. This approach offers more control and flexibility than no-code platforms.
Setting Up Your Webhook Listener
First, create a basic Flask application that can receive and parse the event data from Slack. The code below sets up an endpoint (/slack/events) that listens for POST requests.
from flask import Flask, request, jsonify
import os
app = Flask(__name__)
@app.route('/slack/events', methods=['POST'])
def slack_events():
data = request.json
# Handle Slack's URL verification challenge
if 'challenge' in data:
return jsonify({'challenge': data['challenge']})
# Check if it's the event we care about
if data.get('event', {}).get('type') == 'member_joined_channel':
user_id = data['event']['user']
channel_id = data['event']['channel']
# In a real app, you would trigger the full workflow here
print(f"User {user_id} joined channel {channel_id}")
# Trigger video generation...
return jsonify({'status': 'ok'}), 200
if __name__ == '__main__':
app.run(port=3000)
This script handles Slack’s initial verification and identifies the member_joined_channel event, extracting the user_id and channel_id.
Fetching User Details
Next, use the user_id to get the new member’s name. You’ll need to make an authenticated call to Slack’s users.info endpoint.
import requests
def get_user_name(user_id):
SLACK_BOT_TOKEN = os.environ.get('SLACK_BOT_TOKEN')
url = 'https://slack.com/api/users.info'
headers = {'Authorization': f'Bearer {SLACK_BOT_TOKEN}'}
params = {'user': user_id}
response = requests.get(url, headers=headers, params=params)
user_data = response.json()
if user_data.get('ok'):
return user_data['user']['profile']['first_name']
return 'there'
Scripting the ElevenLabs API Call
With the user’s name, you can generate the custom audio. To do this, send a POST request to the ElevenLabs API with your welcome text. This is an excellent opportunity to inject personality and brand voice directly into your onboarding. To begin creating your own custom audio, click here to sign up for ElevenLabs.
def generate_audio(text):
ELEVENLABS_API_KEY = os.environ.get('ELEVENLABS_API_KEY')
voice_id = 'YOUR_CHOSEN_VOICE_ID' # Get this from your ElevenLabs Voice Lab
url = f'https://api.elevenlabs.io/v1/text-to-speech/{voice_id}'
headers = {
'xi-api-key': ELEVENLABS_API_KEY,
'Content-Type': 'application/json'
}
payload = {
'text': text,
'model_id': 'eleven_multilingual_v2',
'voice_settings': {'stability': 0.5, 'similarity_boost': 0.75}
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
# The response body is the audio file data
return response.content
return None
Scripting the HeyGen API Call
Now, take the audio file and send it to HeyGen to create the video. First, you must create a video template in your HeyGen account, featuring your chosen avatar and background. Then, you can use the API to start a new video generation job based on that template. To start building powerful video automations, try for free now at HeyGen.
def generate_video(audio_data, user_name):
HEYGEN_API_KEY = os.environ.get('HEYGEN_API_KEY')
template_id = 'YOUR_TEMPLATE_ID' # Get this from your HeyGen template
# 1. First, upload the audio file to a public URL or use a service
# AWS S3, etc. Let's assume you get a public_audio_url.
# 2. Call HeyGen API
url = 'https://api.heygen.com/v2/video/generate'
headers = {
'X-Api-Key': HEYGEN_API_KEY,
'Content-Type': 'application/json'
}
payload = {
'video_inputs': [
{
'character': {
'type': 'avatar',
'avatar_id': 'YOUR_AVATAR_ID',
},
'voice': {
'type': 'audio',
'audio_url': public_audio_url
}
}
],
'test': False,
'caption': False,
'template_id': template_id
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
# This returns a video_id, which you use to check status
return response.json()['data']['video_id']
return None
Step 3: Closing the Loop: Delivering the Personalized Video to Slack
The process isn’t complete until the video is delivered back to the new user in the Slack channel. Since video generation can take a minute or two, you cannot post the reply immediately.
Handling the HeyGen Callback/Polling
HeyGen’s video generation is an asynchronous process. You have two options:
1. Polling: Periodically call HeyGen’s video status endpoint (/v2/video/status/{video_id}) until the status is completed.
2. Webhook (Recommended): Provide a callback URL in your initial API call. HeyGen will send a POST request to this URL once the video is ready, including the final video URL.
Using a webhook is more efficient as it avoids unnecessary API calls. Once you receive the completed status, you can extract the video_url from the response.
Posting the Video Back to the Channel
With the final video URL, you can now post the welcome message to Slack. The message should tag the new user to ensure they are notified and provide a friendly context for the video.
def post_video_to_slack(channel_id, user_id, video_url):
SLACK_BOT_TOKEN = os.environ.get('SLACK_BOT_TOKEN')
url = 'https://slack.com/api/chat.postMessage'
headers = {'Authorization': f'Bearer {SLACK_BOT_TOKEN}'}
message_text = f"Hey <@{user_id}>, welcome to the team! We made this short video just for you:"
payload = {
'channel': channel_id,
'text': message_text,
'attachments': [
{
'fallback': 'Personalized Welcome Video',
'title': 'Your Personalized Welcome!',
'title_link': video_url,
'text': 'Click the link above to watch your welcome video.'
}
]
}
requests.post(url, headers=headers, json=payload)
What the New User Sees
When done correctly, the result is magical. Moments after joining, the new member is greeted by name with a personal message and a link to a video created just for them. This single automated action transforms a cold, systemic process into a warm, human-centric welcome. You have not just added a user to a channel; you have initiated a relationship.
No more silent welcomes or getting lost in the backlog. By creating this powerful integration, every new team member is now greeted with a personal, dynamic video message that sets the tone for collaboration and engagement from the very first minute. This is just one example of how generative AI and smart automation can fundamentally improve internal communications and community building. The same architectural principles can be used to automate project status updates, celebrate milestones, or deliver company-wide announcements in a more personal and engaging format. Ready to revolutionize your team’s onboarding experience? Explore the powerful APIs that make this possible. To create your video templates, try for free now at HeyGen. For the lifelike audio, click here to sign up for ElevenLabs. Start building your own automated video workflows today and redefine what a welcome message can be.




