Summarize YouTube videos in Slack with /ytsummary.
User → Slack → n8n webhook → transcript-service → Ollama → Slack response
↓
immediate "processing" ack
- User types
/ytsummaryin any Slack channel - n8n receives webhook, immediately acknowledges with "Summarizing video..."
- Transcript service fetches video metadata and transcript from YouTube
- Ollama runs 2-stage summarization (extract key info → format for Slack)
- Summary posted back to the channel
/ytsummary # Short summary of most recent YouTube video in channel
/ytsummary <https://youtube.com/...> # Short summary of specific video
/ytsummary <https://youtube.com/...> medium # Medium-detail summary
/ytsummary <https://youtube.com/...> long # Comprehensive section-by-section breakdown
/ytsummary medium # Medium summary of most recent video in channel
/ytsummary long # Long summary of most recent video in channel
| Level | Output | Details |
|---|---|---|
short (default) |
TLDR + 3-4 bullets | Under 300 words |
medium |
TLDR + 5-8 detailed bullets | 300-800 words |
long |
TLDR + sectioned breakdown | 500-1500 words |
All levels use the full transcript. The 2-stage Ollama pipeline compresses the full video into key notes (Stage 1), then formats for Slack at the requested detail level (Stage 2).
Note: Slack unfurls (expands) URLs automatically. To pass a URL directly, wrap it in angle brackets <url> to prevent unfurling.
| File | Purpose |
|---|---|
app.py |
Flask API - fetches transcripts/metadata from YouTube |
Dockerfile |
Python container with youtube_transcript_api |
docker-compose.yml |
Container config |
n8n-workflow.json |
n8n workflow to import |
slack-app-manifest.yml |
Slack app configuration template |
- Docker and docker-compose
- n8n instance (self-hosted or cloud)
- Ollama with a model installed (default:
gpt-oss:20b-128k) - Slack workspace admin access
cd slack-bot
# If using Docker networking, ensure your n8n network exists
# Edit docker-compose.yml to match your network name
# Start the service
docker-compose up -d
# Verify it's running
curl http://localhost:5001/health
# Should return: {"status":"ok"}Network configuration:
The docker-compose.yml connects to an external Docker network so n8n can reach it. Update the network name to match your setup:
networks:
your-n8n-network:
external: true- Open your n8n instance
- Go to Workflows → Import from File
- Select
n8n-workflow.json
Configure the workflow:
-
Ollama nodes - Update the URL if Ollama is on a different host:
http://localhost:11434- Ollama on same hosthttp://172.17.0.1:11434- Ollama on Docker host (from container)http://host.docker.internal:11434- Docker Desktop
-
Transcript service - Update URL if using different hostname:
- Default:
http://ytn-transcript:5001(Docker network name)
- Default:
-
Create Slack credential:
- Go to n8n Credentials → Add → Header Auth
- Name:
Slack YTN Bot Token - Header Name:
Authorization - Header Value:
Bearer xoxb-your-slack-bot-token
-
Activate the workflow
Option A: Use manifest (recommended)
- Go to https://api.slack.com/apps
- Click Create New App → From an app manifest
- Select your workspace
- Paste contents of
slack-app-manifest.yml - Update the webhook URL to your n8n host
- Click Create
- Go to Install App → Install to Workspace
- Copy the Bot User OAuth Token (starts with
xoxb-) for the n8n credential
Option B: Manual setup
- Create app at https://api.slack.com/apps → From scratch
- Add slash command
/ytsummarypointing tohttps://YOUR-N8N-HOST/webhook/slack-ytn - Add bot scopes:
commands,chat:write,channels:history - Install to workspace
In any Slack channel:
/ytsummary
(With a YouTube URL posted recently in the channel)
- Post a YouTube URL in the channel first, then run
/ytsummary - Or use angle brackets:
/ytsummary <https://youtube.com/watch?v=...>
- Check n8n execution history for errors
- Verify transcript service is reachable from n8n
- Check Ollama is running:
curl http://localhost:11434/api/tags
docker logs ytn-transcriptEdit the "Prepare Stage 1 Request" and "Prepare Stage 2 Request" nodes in n8n:
model: "your-model-name"Edit the prompt text in the same nodes to customize:
- What information is extracted (Stage 1)
- How the Slack message is formatted (Stage 2)
| Param | Description |
|---|---|
v |
Video ID or full URL (required) |
timestamps |
true for [M:SS] format (optional) |
| Param | Description |
|---|---|
v |
Video ID or full URL (required) |
Returns {"status":"ok"} if service is running.