Sora2 Pro AI video generation to YouTube
High-Level Summary
This workflow automates the entire process of creating AI-generated videos using OpenAI's Sora2 Pro, saving them to Google Drive, generating optimized YouTube titles with GPT-5, and automatically uploading them to YouTube. It uses a Google Sheet as the central interface for input (prompts and durations) and output (video URLs and YouTube links). This is ideal for content creators, marketers, or anyone looking to scale video production without manual intervention.
Node-by-Node Walkthrough
-
Schedule Trigger (No auth) — Runs the workflow at a configured interval (default: every 5 minutes). This allows the workflow to periodically check for new rows in the Google Sheet.
-
When clicking 'Test workflow' (No auth) — A manual trigger for testing the workflow on demand. It bypasses the schedule and starts the process immediately.
-
Get new video (Google Sheets OAuth2) — Reads rows from the Google Sheet where the "VIDEO" column is empty (unprocessed rows). It retrieves the prompt and duration for each new video to be created.
-
Set data (No auth) — Combines the prompt and duration from the sheet into a single string formatted as:
{PROMPT}\n\nDuration of the video: {DURATION}. This prepared text is sent to the AI video generation API. -
Create Video (Header Auth — Authorization: Key YOURAPIKEY) — Sends a POST request to the Sora2 Pro API (
https://queue.fal.run/fal-ai/sora-2/text-to-video/pro) with the prompt as JSON body. This initiates the video generation process and returns arequest_idfor polling. -
Wait 60 sec. (No auth) — Pauses execution for 60 seconds to allow the Sora2 Pro API to process the video generation request.
-
Get status (Header Auth — Authorization: Key YOURAPIKEY) — Polls the Sora2 Pro API status endpoint (
https://queue.fal.run/fal-ai/sora-2/requests/{request_id}/status) to check if the video generation is complete. -
Completed? (No auth) — An IF node that checks if the status returned is "COMPLETED". If yes, the workflow proceeds to retrieve the video URL. If not, it loops back to wait another 60 seconds and check again.
-
Get Url Video (Header Auth — Authorization: Key YOURAPIKEY) — Once the video is completed, this node fetches the final video metadata from
https://queue.fal.run/fal-ai/sora-2/requests/{request_id}, including the video URL and file name. -
Generate title (OpenAI API Key auth) — Sends the original prompt to OpenAI's GPT-5 model with a system prompt that instructs it to generate an SEO-optimized YouTube title (max 60 characters, catchy, keyword-rich, in the same language as the input).
-
Get File Video (No auth) — Downloads the actual video file from the URL returned by the Sora2 Pro API. This binary data is used for uploading to Google Drive and YouTube.
-
Upload Video (Google Drive OAuth2) — Uploads the downloaded video file to a specific Google Drive folder ("Fal.run") with a timestamped filename.
-
Update result (Google Sheets OAuth2) — Updates the original Google Sheet row with the video URL from Sora2 Pro, using the row number to match the correct row.
-
HTTP Request (Header Auth — Authorization: Apikey YOUR_API_KEY_HERE) — Uploads the video to YouTube via the Upload-Post API (
https://api.upload-post.com/api/upload). It sends the video binary data along with the generated title, username, and platform (YouTube) as multipart form data. -
Update Youtube URL (Google Sheets OAuth2) — Updates the Google Sheet row with the final YouTube URL (constructed as
https://youtu.be/{video_id}) after successful upload.
Setup Instructions
To use this workflow, you'll need accounts and credentials for the following services:
-
Google Cloud Platform — Enable the Google Sheets and Google Drive APIs. Create OAuth2 credentials and configure them in n8n for Google Sheets and Google Drive nodes.
-
Fal.ai (Sora2 Pro) — Create an account at fal.ai and obtain an API key. This key is used in the Header Auth nodes (Create Video, Get status, Get Url Video) with the format
Key YOURAPIKEY. -
OpenAI — Create an account at OpenAI and generate an API key. This is used for the GPT-5 title generation node.
-
Upload-Post — Sign up at Upload-Post to get an API key (10 free uploads per month). Create a profile for your YouTube channel. The profile name becomes your username in the HTTP Request node.
-
Google Sheet — Create a copy of this template sheet with columns: PROMPT, DURATION, VIDEO, YOUTUBE_URL, row_number. Fill in prompts and durations; leave VIDEO and YOUTUBE_URL empty.
Use Cases and Variations
- Content Marketing: Automate daily video creation for social media campaigns, product demos, or educational content.
- Multilingual Content: The GPT-5 prompt generates titles in the same language as the input, making it easy to create videos in multiple languages.
- Batch Processing: Modify the Google Sheet query to process multiple rows at once, creating a queue of videos.
- Alternative AI Models: Replace the Sora2 Pro endpoint with other video generation APIs (e.g., RunwayML, Pika Labs) by changing the URL and request format.
- Platform Expansion: Add additional HTTP Request nodes to upload the same video to TikTok, Instagram, or Facebook using their respective APIs.
- Scheduling: Adjust the Schedule Trigger to run hourly or daily instead of every 5 minutes for less frequent video creation.
Workflow JSON
{
"id": "IIQhSqMWv4u6e0Jh",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462"
},
"name": "Create Video with Sora2 Pro and Upload to Youtube",
"tags": [],
"nodes": [
{
"id": "937d8d50-60e9-4ebe-a1b2-83e4e7179318",
"name": "When clicking ‘Test workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-528,
976
],
"parameters": {},
"typeVersion": 1
},
{
"id": "ef6db75d-f9d9-459d-9d3f-5d77547efa36",
"name": "Get status",
"type": "n8n-nodes-base.httpRequest",
"position": [
544,
976
],
"parameters": {
"url": "=https://queue.fal.run/fal-ai/sora-2/requests/{{ $('Create Video').item.json.request_id }}/status ",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "credential-id",
"name": "httpHeaderAuth Credential"
}
},
"typeVersion": 4.2
},
{
"id": "63bd7d00-8a53-4bc3-bc8d-c09b6ecc335e",
"name": "Wait 60 sec.",
"type": "n8n-nodes-base.wait",
"position": [
352,
976
],
"webhookId": "490facb8-d0ae-402e-ab59-a87720cf0bdd",
// ... truncated (copy to see full JSON)How to Import This Workflow
- 1Copy the workflow JSON above using the Copy Workflow JSON button.
- 2Open your n8n instance and go to Workflows.
- 3Click Import from JSON and paste the copied workflow.
Don't have an n8n instance? Start your free trial at n8nautomation.cloud
Related Templates
AI-Powered Unsplash to Pinterest Workflow with RAG
Overview This workflow provides an intelligent pipeline for processing and storing data related to Unsplash images for Pinterest. It uses a Retrieval-Augmented Generation (RAG) architecture to automatically ingest content, generate embeddings, store them in a vector database (Supabase), and then process queries using an AI agent. The workflow is triggered via a webhook, making it suitable for integration with external applications or manual testing. Node-by-Node Breakdown Sticky Note — A visual note for documentation purposes. It displays the title "Automated workflow: Unsplash to Pinterest" on the canvas. No authentication required. Webhook Trigger — Listens for incoming HTTP POST requests at the path . This is the entry point for the workflow. When triggered, it passes the incoming data to the next nodes. (No auth) Text Splitter — Splits incoming text into chunks of 400 characters with a 40-character overlap. This prepares the data for embedding by breaking it into manageable pieces. (No auth) Embeddings (Cohere) — Generates vector embeddings for each text chunk using the model from Cohere. These embeddings represent the semantic meaning of the text. (API Key auth — requires a Cohere API key) Supabase Insert — Inserts the generated embeddings into a Supabase vector store named . This stores the data for later retrieval. (API Key auth — requires Supabase credentials) Supabase Query — Queries the same Supabase vector store () to retrieve relevant vectors based on similarity search. This is used by the RAG agent to find context. (API Key auth — requires Supabase credentials) Vector Tool — Wraps the Supabase vector store as a tool that the AI agent can use to retrieve context. It's labeled "Vector context" for clarity. (No auth — uses the Supabase connection from the previous nodes) Window Memory — Provides a buffer window memory for the AI agent, allowing it to maintain conversation context across multiple interactions. (No auth) Chat Model (OpenAI) — The language model that powers the AI agent. It uses OpenAI's chat model to process queries and generate responses. (API Key auth — requires an OpenAI API key) RAG Agent — The core AI agent that combines the chat model, vector tool, and memory. It processes incoming data with the prompt: "Process the following data for task 'Unsplash to Pinterest':" and includes a system message: "You are an assistant for Unsplash to Pinterest". (No auth — uses connections to other nodes) Append Sheet (Google Sheets) — Appends the AI agent's output to a Google Sheet. It writes to a sheet named "Log" in a document identified by . The column "Status" is populated with the agent's response text. (OAuth2 — requires Google Sheets API credentials) Slack Alert — Sends an error notification to the Slack channel if the RAG Agent encounters an error. The message includes the error details. (OAuth2 — requires Slack API credentials) Setup Instructions To use this workflow, you'll need accounts and API keys for the following services: Cohere: Sign up at cohere.com and generate an API key for the embeddings model. Supabase: Create a project at supabase.com and set up a vector store with the name . You'll need your Supabase URL and service role key. OpenAI: Get an API key from platform.openai.com for the chat model. Google Sheets: Create a Google Sheet with a sheet named "Log" and note the Sheet ID from the URL. Set up OAuth2 credentials in the Google Cloud Console. Slack: Create a Slack app, add it to your workspace, and obtain OAuth tokens. Create a channel named for error notifications. Configure each node's credentials in n8n by clicking on the node and selecting "Add Credential" or selecting existing ones. Use Cases and Variations This workflow is ideal for: Content Curation: Automatically process and store descriptions of Unsplash images for later retrieval and Pinterest posting. Knowledge Base: Build a searchable database of image metadata with semantic search capabilities. Automated Content Moderation: Use the AI agent to analyze image descriptions and flag inappropriate content before posting. Possible Adaptations: Replace the webhook trigger with a Schedule Trigger to run the workflow at regular intervals. Swap the Cohere embeddings with OpenAI embeddings or Hugging Face embeddings. Instead of Google Sheets, output to Airtable, Notion, or PostgreSQL. Add an HTTP Request node after the RAG Agent to post processed data directly to Pinterest's API. Use a different vector store like Pinecone or Qdrant instead of Supabase.
Telegram RAG Chatbot with File Upload and Groq LLM
This workflow creates a Telegram chatbot that uses Retrieval-Augmented Generation (RAG) to answer questions based on documents you upload. Users can send PDF or CSV files to a Telegram chat, and the workflow processes them into a vector database. When a user then sends a text message, the AI agent retrieves relevant chunks from the stored documents and generates an answer using the Groq Llama 3.1 model. It's like having a personal assistant that learns from your files and responds via Telegram. Node-by-Node Walkthrough Telegram Message Trigger (Telegram Trigger, no authentication required on the node itself — authentication is handled via the Telegram Bot API credentials configured in the n8n credentials store). This trigger listens for all types of updates (messages, commands, etc.) from a Telegram bot. When a new update arrives, it starts the workflow. Get a chat1 (Telegram node, Telegram Bot API token auth). It extracts the from the incoming message and passes it to the next node, ensuring the AI agent knows which chat to reply to. AI Agent1 (LangChain Agent, no auth). This is the core of the workflow. It uses a system message that instructs the AI to answer only from the knowledge base. The agent has access to the Groq Chat Model as its language model and the Retrieve documents tool to fetch relevant document chunks. It also uses Simple Memory to keep conversation context within a session (keyed by the Telegram chat ID). Groq Chat Model (Groq LLM, Groq API key auth). Uses the model. This provides fast, coherent answers. Simple Memory (Memory Buffer Window, no auth). Stores the last few turns of conversation to give the agent context. The session key is set to the Telegram chat ID from the trigger. Retrieve documents (Vector Store as Tool, no auth). This tool allows the agent to query the in-memory vector store. It returns the top 10 most similar document chunks. Embeddings HuggingFace Inference1 (Hugging Face Inference, Hugging Face API key auth). Generates embeddings for the user's query so the vector store can find relevant documents. Upload your file here (Form Trigger, no auth). This form trigger provides a web form where users can upload or files. The uploaded file(s) are passed to the Default Data Loader1. Default Data Loader1 (Document Default Data Loader, no auth). Converts the uploaded binary file into a LangChain document object. Recursive Character Text Splitter (Text Splitter, no auth). Splits the document into chunks of up to 3,000 characters with 200 character overlap. This ensures the vector store indexes manageable pieces. Simple Vector Store (In-Memory Vector Store, no auth). Stores the document chunks along with their embeddings. The embedding model used is Embeddings HuggingFace Inference. Embeddings HuggingFace Inference (Hugging Face Inference, Hugging Face API key auth). Generates embeddings for each document chunk before storing them. Reply in Telegram1 (Telegram node, Telegram Bot API token auth). Sends the AI agent's output back to the same Telegram chat. Setup Instructions Telegram Bot: Create a bot via @BotFather and get its API token. In n8n, add a Telegram credential using this token. Groq: Sign up at GroqCloud to get an API key. Add a Groq credential in n8n. Hugging Face: Create a free account at Hugging Face and generate an Inference API token. Add a Hugging Face Inference credential in n8n. n8n Form Trigger: This node is built-in. Ensure your n8n instance is publicly accessible (or use a tunnel like ngrok) so the form can be accessed by users. Deploy: Activate the workflow. Share the Telegram bot username with users. They can upload files by visiting the form URL (the one generated by the Upload your file here node) and then send text messages to the bot. Use Cases and Variations Personal knowledge base: Upload company policies, technical documentation, or study materials and ask questions about them via Telegram. Customer support bot: Replace the file upload with an HTTP node that fetches FAQs from a database, and use the same RAG architecture to answer customer queries. Multi-user support: The session memory is already scoped by Telegram chat ID, so multiple users can use the bot simultaneously without interfering. Switch LLM: Replace Groq with OpenAI, Anthropic, or any other supported LLM provider by changing the model node. Persistent vector store: Swap the in-memory vector store for Pinecone, Weaviate, or Qdrant to retain documents across restarts.
Telegram AI Chatbot with OpenAI GPT
Overview This workflow turns your Telegram bot into a smart AI assistant powered by OpenAI's GPT models. Every time someone sends a message to your bot, the workflow forwards it to GPT, generates a context-aware reply, and sends it back — all in a few seconds. It's a cost-effective alternative to paid chatbot platforms, giving you full control over the personality and rules via a system prompt. How It Works The workflow is triggered by an incoming Telegram message, processes it through an AI model, and replies to the same chat. Here are the nodes and their roles: Telegram Message In (Telegram Bot Token auth) — Watches for new messages in your bot's chat. Configured to listen for updates only. No additional parameters. AI Reply (OpenAI API Key auth) — Sends the user's message to OpenAI's GPT model (here as a placeholder – you can choose any available model). The request includes a system prompt that defines the bot's behavior (e.g., "You are a helpful, concise assistant...") and the user message from the Telegram trigger. This node has retry on fail enabled (3 retries, 5 seconds apart) to handle transient errors. Send Reply (Telegram Bot Token auth) — Takes the AI's response (from ) and sends it back to the original chat, using the from the trigger. No retry is configured to avoid duplicate messages. Setup Instructions Create a Telegram Bot: Open Telegram, search for , and send . Follow the prompts to get a bot token (e.g., ). Get an OpenAI API Key: Sign up at platform.openai.com, create an API key, and ensure it has access to the GPT model you want to use. Configure Credentials in n8n: - For the Telegram nodes (Trigger and Send), create a new credential of type "Telegram API" and paste your bot token. - For the AI Reply node, create a credential of type "OpenAI" and paste your API key. Edit the System Prompt: Open the AI Reply node and modify the system message to change the bot's personality, tone, or knowledge constraints. For example, you can make it a support agent, a tutor, or a sarcastic friend. Activate the Workflow: Once saved, toggle the workflow to "Active". Send a message to your bot on Telegram to test it. Use Cases & Variations Customer Support: Replace the system prompt with your FAQ and company policies to create a 24/7 support bot. Personal Assistant: Add a directive to remember context (requires additional memory nodes like Window Buffer Memory) or integrate with calendars/tasks. Multi‑language Translator: Change the system prompt to "Translate the user's message to Spanish" and use the AI reply as a translation service. Content Generator: Have the bot generate blog posts, jokes, or summaries based on user requests. Error Handling: The workflow includes retries on the AI node only. If you want to be notified of failures, add an Error Trigger workflow that sends alerts to Slack or email.