This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.
n8n + Kling AI: Build Your Automated Video Pipeline in 20 Minutes
AI video generation has crossed a threshold. The quality is good enough to publish, and the APIs are stable enough to automate. What has been missing for most creators and marketers is the glue — a reliable workflow that triggers video creation, waits for rendering, and delivers the finished file without anyone clicking a button. That is exactly what this guide builds.
You will connect n8n — open-source workflow automation with 400+ integrations, free to self-host or available as n8n Cloud — to Kling AI to generate AI videos from text prompts on a fully automated schedule. The whole setup takes about 20 minutes.
What You Need Before You Start
- n8n instance — self-hosted or n8n Cloud account
- Kling AI API key — available from the Kling AI developer portal
- A trigger source — a Google Sheet, an Airtable base, a webhook, or a simple schedule node
- A delivery destination — Google Drive, Dropbox, S3, or a Slack channel
No coding experience is required. Every step uses n8n's visual node editor.
Step 1 — Set Up Your Trigger
Open n8n and create a new workflow. Add your first node. Choose the trigger that fits your use case:
- Schedule Trigger — runs the pipeline daily, hourly, or on any cron schedule
- Webhook Trigger — fires when an external tool (CMS, form, Zapier) sends a POST request
- Google Sheets Trigger — watches for new rows containing video prompts
For this walkthrough, use a Google Sheets Trigger. Each new row in a sheet called Video Queue contains three columns: prompt, aspect_ratio, and duration. When a row is added, the workflow fires.
Step 2 — Call the Kling AI API
Add an HTTP Request node directly after your trigger. Configure it as follows:
- Method: POST
- URL:
https://api.klingai.com/v1/videos/text2video - Authentication: Header Auth — key
Authorization, valueBearer YOUR_API_KEY - Body (JSON):
{
"model": "kling-v1",
"prompt": "{{ $json.prompt }}",
"aspect_ratio": "{{ $json.aspect_ratio }}",
"duration": {{ $json.duration }}
}
This node submits the generation job. Kling AI returns a task_id immediately. The video is not ready yet — it renders asynchronously, typically in 2–4 minutes.
Tip: Map Sheet Columns Cleanly
Use the Set node between your trigger and the HTTP Request to rename and validate fields. This keeps your JSON body predictable and makes debugging much easier later.
Step 3 — Poll for Completion
Because Kling AI renders asynchronously, you need a polling loop. Here is the pattern:
- Add a Wait node set to 60 seconds.
- Add a second HTTP Request node to check job status:
- Method: GET
- URL:
https://api.klingai.com/v1/videos/text2video/{{ $json.task_id }}
The response includes a status field. Add an IF node that checks whether status equals succeed. If yes, the workflow continues. If no, it loops back to the Wait node. Add a counter using a Set node to avoid infinite loops — stop after 10 attempts and send yourself a Slack alert.
Step 4 — Download and Deliver the Video
When the IF node passes, the response contains a video_url. Add a third HTTP Request node in binary mode to download the file:
- Method: GET
- URL:
{{ $json.video_url }} - Response Format: File
Then add your delivery node. Common options:
- Google Drive — upload to a shared folder for review
- Amazon S3 — store for CDN delivery
- Slack — post a message with the download link to a team channel
- Email (Gmail / SMTP) — notify a client automatically
Step 5 — Update Your Queue and Close the Loop
Add a final Google Sheets node to write the video URL and a done status back into the row that triggered the workflow. This prevents duplicate processing on the next run and gives you a live log of every video generated.
Full Workflow Overview
Here is the complete node sequence at a glance:
- Google Sheets Trigger → Set (clean fields) → HTTP Request (submit job)
- → Wait (60 s) → HTTP Request (poll status) → IF (done?)
- → HTTP Request (download file) → Google Drive (upload)
- → Google Sheets (update row) → Slack (notify team)
Every node is configurable without writing a single line of code. The workflow handles error states, retries, and delivery automatically.
Tips to Get Better Results from Kling AI
- Be specific in prompts. Include camera movement, lighting mood, and subject action. Example: "Aerial drone shot over a sunlit city skyline at golden hour, slow pan left, cinematic."
- Use 16:9 for YouTube, 9:16 for Reels and Shorts. Set
aspect_ratioin your sheet accordingly. - 5-second clips are fastest. Use 10-second clips only when motion complexity requires it.
- Batch at night. Queue 20 prompts before bed; wake up to 20 finished videos in your Drive folder.
Where to Take This Next
Once the base pipeline works, there are several natural extensions:
- Add AI voiceover — pipe the finished video through ElevenLabs to add a narration track automatically.
- Add image-to-video — swap the
text2videoendpoint for Kling AI'simage2videoendpoint and feed product images from your sheet. - Add auto-captioning — call a transcription API and burn in subtitles before delivery.
- Add social scheduling — connect a social media management tool at the end to publish clips directly.
Each extension is just one more node in the same workflow. That is the power of building on n8n: the pipeline grows with your needs, and you never have to rebuild from scratch.
If you want to automate your entire video production workflow, you can get started via n8n — including 400+ integrations and a free self-hosting option — to generate, deliver, and log AI videos without touching a single button.