How To Build An N8N Workflow For Automated AI Video Creation
Why automate AI video creation in n8n?
If your team is publishing ads, UGC, explainers, or reels at scale, manually editing every clip is the bottleneck. With Scrptly’s AI Video Agent inside an n8n workflow, you can turn prompts and optional product images into fully edited videos—consistently, on schedule, and programmatically.
Scrptly’s swarm of AI sub-agents handles research, screenplay, character design, environments, narration, and editing to produce long-form, consistent scenes that keep characters and visuals coherent across shots. That makes it perfect for eCommerce ads, faceless channels, explainers, and mini-docs.

What you’ll build
A reusable n8n workflow that:
- Accepts a prompt and optional context images
- Generates a complete video via Scrptly’s AI Video Agent
- Stores it (e.g., S3/Drive) and notifies your team or posts to social
Who is this for?
- Ecommerce marketers and agencies automating product/UGC ads
- Creators running faceless YouTube or TikTok channels
- Devs and AI enthusiasts building programmatic video systems
- Educators and comms teams producing explainers or mini-docs
Prerequisites
- n8n (self-hosted or cloud) with Community Nodes enabled
- A Scrptly account and API key: https://scrptly.com/
- Optional: storage (S3/Drive), Slack/Email, or YouTube/TikTok nodes for distribution
Step-by-step: Build the n8n workflow
1) Install the Scrptly node
2) Add credentials
- In the editor, open the Credentials tab → New Credential → Scrptly API
- Paste your Scrptly API key (from your Scrptly account page)
- Save credentials
3) Design the workflow
We’ll create a simple, reliable path you can later expand.
Nodes overview:
- Trigger: Schedule (daily or hourly) or Webhook for on-demand video requests
- Optional: HTTP Request to fetch product images and attach as binary
- Scrptly: Generate video from prompt and context images
- Storage: Upload (S3/Drive) or Publish (YouTube) + Notify (Slack/Email)
A) Trigger
- Use Schedule for recurring creation or Webhook for real-time, API-triggered requests.
B) Prepare the prompt (Set node)
Create a reusable template with variables you can pass from the trigger or Webhook:
Title: {{ $json.title || "Fall Capsule Sneaker Launch" }}
Goal: 45-second vertical UGC ad driving clicks.
Audience: Urban, eco-conscious, 18–35.
Style: Natural handheld, warm daylight, soft background music.
Scenes: Hook (5s), Problem (7s), Demo (12s), Social Proof (10s), Offer + CTA (11s).
Narration: Friendly, clear, gender-neutral.
On-screen text: Big captions, high contrast, brand color accents.
Include b-roll cues and tight product beauty shots.
If context images are provided, maintain character and product consistency.
Output: 1080x1920, captions burned-in, light color grade.
Pass this as the Scrptly prompt field or assemble it dynamically via expressions.
C) Optional: Fetch context images
If your Trigger/Webhook includes image URLs, add an HTTP Request node (Binary mode) to download them. Use multiple requests or a Function node to map an array of URLs to separate binary items. Feed these as Context Images to the Scrptly node to achieve visual consistency across scenes.
D) Scrptly node configuration
- Prompt: Your structured text prompt (above)
- Context Images: Binary inputs from previous node (optional but recommended for consistency)
- Aspect Ratio: 9:16 for TikTok/Reels/Shorts or 16:9 for YouTube
- Length: e.g., 45s (or specify "1:30" for 90s)
- Approve Up To (budget): e.g., 15000 tokens (tune based on complexity)
- Wait For Completion: On (simplest). The node returns when the video is ready.
Output typically includes a video URL and metadata. Map it to subsequent nodes.
E) Store and distribute
- Storage: Upload the file to S3/Spaces/Drive with a clear path convention, e.g.,
videos/{{$json.date}}/{{ $json.slug }}.mp4 - Notify: Post the link to Slack or Email with key stats (length, CTA, upload URL)
- Optional: Publish to YouTube with title/description/hashtags from your Set node

Async pattern (advanced)
Need ultra-fast responses? Turn off "Wait For Completion" in the Scrptly node. You’ll immediately receive a task ID; store it, then:
- Option A: Use a scheduled workflow to poll for completion by task ID
- Option B: Add a delay (Wait node), then re-check and proceed when the video is ready
This pattern lets you fan out many requests while keeping your main flow snappy.
Prompt templates you can copy
- 30s eCommerce UGC Ad (9:16):
"Create a 30s vertical UGC-style ad introducing [PRODUCT]. Tone: genuine, first-person. Structure: Hook (pattern interrupt), Problem, Demo with 3 benefits, Social Proof (quick quotes), CTA. Natural ambient audio + soft lo-fi beat. Include close-ups of texture and use context images to keep product consistent. Burn-in captions in bold sans-serif. End with on-screen CTA: 'Tap to learn more.'" - 3-min YouTube Explainer (16:9):
"Produce a 3-minute cinematic explainer about [TOPIC]. Include clear chaptering, animated diagrams, narrative voiceover, friendly educational tone, and a concise recap. Maintain visual consistency for the main presenter character. Add tasteful lower thirds and a calm background score." - 90s Mini-Doc (16:9):
"Create a 90-second documentary-style short on [SUBJECT], mixing archival-style cuts, panning infographics, and a grounded narrator. Emphasize continuity in environments. Subtle film grain and warm grade."
Example: Minimal n8n workflow export (conceptual)
Use this as a starting point and adapt node names/credentials as needed.
{
"name": "Automated AI Video with Scrptly",
"nodes": [
{"parameters": {"triggerTimes": {"item": [{"mode": "everyHour"}]}}, "id": "Schedule", "name": "Schedule", "type": "n8n-nodes-base.cron"},
{"parameters": {"values": {"string": [{"name": "title", "value": "Eco Sneaker Launch"}, {"name": "slug", "value": "eco-sneaker-launch"}]}, "options": {}}, "id": "SetPromptVars", "name": "Set Prompt Vars", "type": "n8n-nodes-base.set"},
{"parameters": {"operation": "generate", "prompt": "{{$json[\"prompt\"] || \"45s UGC ad for eco sneakers...\"}}", "waitForCompletion": true, "approveUpTo": 15000}, "id": "Scrptly", "name": "Scrptly AI Video-Agent", "type": "n8n-nodes-scrptly.scrptly"},
{"parameters": {"operation": "upload", "bucket": "marketing-videos", "fileName": "videos/{{$now}}/{{$json.slug}}.mp4", "binaryPropertyName": "data"}, "id": "S3Upload", "name": "S3 Upload", "type": "n8n-nodes-base.s3"},
{"parameters": {"channel": "#video-releases", "text": "New video ready: {{$json.url}}"}, "id": "Slack", "name": "Slack Notify", "type": "n8n-nodes-base.slack"}
],
"connections": {"Set Prompt Vars": {"main": [[{"node": "Scrptly", "type": "main", "index": 0}]]}, "Schedule": {"main": [[{"node": "Set Prompt Vars", "type": "main", "index": 0}]]}, "Scrptly": {"main": [[{"node": "S3 Upload", "type": "main", "index": 0}, {"node": "Slack Notify", "type": "main", "index": 0}]]}}
}
Pro tips for reliability and quality
- Provide 2–5 high-quality context images for character/product consistency
- Start with "Wait For Completion" on while testing; switch to async once stable
- Tune "Approve Up To" to match complexity; raise it for multi-scene shorts
- Store your best prompts as n8n environment variables for versioning
- Use the Error Trigger in n8n to route failures to an alerting channel
- Keep a naming convention for outputs and add UTM tags in your CTAs for attribution
Developers: extend with Scrptly’s API and MCP
Prefer to orchestrate via code? Scrptly also exposes a Video Development Kit and APIs you can call directly, plus an MCP server to connect with your favorite LLM tooling. Learn more at
https://scrptly.com/Example (Node.js):
import Scrptly from 'scrptly';
Scrptly.setApiSettings({ apiKey: process.env.SCRPTLY_API_KEY });
const res = await Scrptly.videoAgent.create({
prompt: `Create a 60s 9:16 UGC ad for our ceramic pour-over set...`,
contextImages: [/* image buffers or URLs */],
approveUpTo: 15000
});
console.log(res.videoUrl);
Launch your automated video pipeline
With one Scrptly node, you can go from prompt to polished video on autopilot—perfect for daily ad variations, faceless channel uploads, or explainer series. Start building your workflow today:
Automate the busywork, keep the creativity.