What This Workflow Does
This workflow helps you get a neat text transcript from a YouTube video URL.
It solves the problem of spending too much time watching videos and writing notes.
You get a clean, corrected text version of the video content fast.
The system checks your YouTube link, asks an API to get the transcript, then uses AI to fix grammar and format it.
You save hours rewriting stuff yourself or rewatching parts of videos.
Who Should Use This Workflow
This is for people who often learn from YouTube videos but need quick text summaries.
Students, researchers, teachers, and content makers will find it really useful.
If you want faster study notes or ready-to-read video scripts, this workflow works well.
It is easy to use and saves a lot of time.
Tools and Services Used
- n8n: Automation platform to connect all parts.
- LangChain Chat Trigger Node: Gets YouTube URL input from chat.
- Python Code Node: Checks if the input is a valid YouTube URL.
- HTTP Request Node: Calls Supadata API to get video transcript.
- OpenAI Node: Fixes grammar and formats transcript text.
- Respond to Webhook Node: Sends final text or error messages back.
Workflow Process: Input → Processing → Output
Input
User sends a YouTube video URL via chat interface.
Processing
- The LangChain Chat Trigger node receives the URL.
- The Python Code node checks if the URL looks like a proper YouTube link.
- An If node sees if the URL was valid and chooses the next step.
- If valid, the HTTP Request node calls the Supadata API with the video URL to get the transcript.
- The OpenAI node takes that transcript and fixes punctuation, grammar, and structures it nicely in Portuguese.
- A Set node prepares the polished text for replying.
- The Respond to Webhook node sends back the clean transcript text.
- If invalid URL, a different Respond to Webhook node sends an error message.
Output
User receives a corrected, formatted transcript string ready to read or save.
Errors prompt easy messages explaining what went wrong.
Beginner Step-by-Step: How to Use This Workflow in n8n
Import Workflow File
- Download the workflow file using the Download button on this page.
- Open your n8n editor.
- Click on “Import from File” and select the downloaded workflow file.
Configure Credentials and Keys
- Go to each API node and add your API Keys:
- Supadata API Key in the HTTP Request node header.
- OpenAI API Key in the OpenAI node credentials.
- Add any needed settings like emails, IDs, or URLs if present.
Test and Activate
- Run the workflow once with a sample YouTube URL to check if it responds with a transcript.
- If it works, activate the workflow by toggling it on.
- If self-hosting n8n, make sure the server and webhook URL are accessible from the internet. self-host n8n can help with this.
Inputs and Outputs Explained
- Input: A chat message containing a YouTube video URL.
- Output: Clean, corrected transcript text from that video.
- Error Output: Clear messages about invalid URLs or transcription failures.
Common Issues and Failures
- If API keys are missing or wrong, the workflows stops with an error.
Check keys carefully in the HTTP Request and OpenAI nodes. - If the video has no captions, Supadata API returns empty transcript.
Try another video with subtitles. - Incorrect mapping from HTTP Request to OpenAI node causes partial or no transcript.
Ensure proper data pass between nodes. - Webhook not public makes LangChain Chat Trigger unreachable.
Check your webhook settings.
Customization Ideas
- Change transcription language by editing the
langparameter in the HTTP Request URL. - Modify the OpenAI prompt to create summaries, bullet lists, or change text language.
- Upgrade the Python Code Node’s validation if supporting URLs from other video platforms.
- Add extra security on the LangChain Chat Trigger webhook to limit who can send URLs.
Code Snippet: YouTube URL Validation
This Python code checks if the input is a valid YouTube link.
Use it inside the Python Code node after chat input.
import re
def youtube_video_url_validatior(video_url) -> str:
try:
if not video_url:
return {"text": 'URL from the video is required.', "is_valid": False}
video_url: str = re.sub(r"\s{2,}", " ", video_url.strip())
if not video_url:
return {"text": 'URL from the video is required.', "is_valid": False}
if len(video_url) < 25:
return {"text": 'URL is too short to be a valid YouTube URL.', "is_valid": False}
is_valid: bool = False
for pattern in [
r'^https?://(?:www\.)?youtube\.com/watch\?v=[\w-]{11}',
r'^https?://youtu\.be/[\w-]{11}',
r'^https?://(?:www\.)?youtube\.com/embed/[\w-]{11}',
r'^https?://(?:www\.)?youtube\.com/v/[\w-]{11}',
]:
if re.match(pattern, video_url):
is_valid = True
break
if not is_valid:
return {"text": 'Invalid YouTube URL format.', "is_valid": False}
video_url_id: str | None = re.search(r'(?:v=|youtu\.be/|embed/|v/)([\w-]{11})', video_url).group(1)
if not video_url_id or not re.match(r'^[\w-]{11}$', video_url_id):
return {"text": 'Invalid YouTube video ID.', "is_valid": False}
return {"text": video_url, "is_valid": True}
except Exception as ex:
raise ex
return youtube_video_url_validatior(_input.first().json.chatInput)Summary: What Happens When You Use This Workflow
✓ You give a YouTube URL.
✓ The workflow checks if the link is right.
✓ It gets the video transcript from a special API.
✓ AI fixes grammar and adds punctuation.
✓ You get a neat, readable transcript text.
