Reference · Tools
Grok Video Gen
Generate videos using xAI Grok.
Grok Video Gen produces video from a text prompt using the xAI API, with configurable duration and the option of several videos per request, delivered as binary files on the output. Use it to generate short clips inside a content pipeline — turning each approved script line into a draft video without leaving the workflow.
- Node type
- Action (binary)
- Parameters
- 5
- Outputs
- Output, Error
- Credentials
- xAI
Grok Video Gen
Generate videos using xAI Grok.
Overview
Grok Video Gen submits a video generation job to xAI Grok Imagine from a text prompt, with an optional starting image for image-to-video. By default it then polls until the job is done and downloads the finished video, storing it on the output item as binary data. Set Wait For Completion off to return the job ID straight away and pick the result up later.
Category: AI
Tool Name: grok_video_gen
Version: 1
Appearance: Icon: brain | Color: #000000
Node Type
Action (Binary) — handles file/binary data operations
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires xAI credentials. See the Credentials Guide for setup instructions.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Model | options | No | Platform default | The video generation model to use. |
| Options: the Grok Imagine video models currently available — the dropdown tracks the model catalog, so it changes as xAI’s line-up changes. | ||||
| Prompt | string | Yes | — | Text prompt describing the video to generate. Supports expressions like {{ $json.description }}. Falls back to the input item’s “prompt”, “text” or “description” field when left empty. |
| Options | collection | No | {} | Optional generation, polling and output settings — add only the fields you want to override. |
| — Input Image URL (image-to-video) | string | No | — | Optional. A still image URL (or base64 data URL) to use as the video’s starting frame (image-to-video). Supports expressions. Required for grok-imagine-video-1.5-preview (image-to-video only). Leave empty for text-to-video on grok-imagine-video. |
| — Input Image Binary Property (image-to-video) | string | No | — | Optional. Name of an upstream binary property holding an image to use as the starting frame. Used only when Input Image URL is empty. Check the upstream node’s Binary Data panel for the exact name (often “data”). |
| — Duration | options | No | 5 | Duration of the generated video in seconds (xAI accepts an integer, max 15). |
Options: 5, 10, 15 | ||||
| — Wait For Completion | boolean | No | true | Whether to poll until the video generation is complete. If false, returns the job ID immediately. |
| — Poll Interval (ms) | number | No | 10000 | Milliseconds between poll requests when waiting for completion. |
| — Max Poll Duration (ms) | number | No | 600000 | Maximum total time to spend polling before timing out (default: 10 minutes). |
| — Binary Property Name | string | No | data | Property name for the primary video binary output. Additional videos use video_1, video_2, etc. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. |
| — Response Field Name | string | No | video | Output field name for the API response data. |
| Include Input | boolean | No | false | Whether to include the original input item fields in the output. |
| Max Concurrency | number | No | 3 | Maximum number of items to process concurrently. Keep low for video generation due to heavy resource usage. |
Output Data
One output item per input item. The rest of the input JSON is carried over only when Include Input is on.
jobId— the generation job’s ID, whether or not the node waited for it.model— the model the job was submitted to.status— the job status.pendingwhen Wait For Completion is off; otherwise the terminal status the job reached.video— the job record, under whatever name Response Field Name is set to. When the node waited, this is the full job response; when it did not, it is{ "id": "<jobId>", "status": "pending" }.
When the node waits and the job finishes successfully, the finished video is downloaded and attached to the output item as binary data under the name given by Binary Property Name (data by default). If the job returns more than one video, the extras land under video_1, video_2, and so on. Any binary the input item already carried is preserved.
Reference the result downstream by expression, e.g. {{ $json.jobId }} or {{ $json.status }}.
Usage Examples
- Generate a video of a space scene using Grok
- Create a portrait-format video for a social media story
- Generate a video from a text description
- Create a landscape video with a cinematic prompt
- Generate a short social-media clip by describing the framing in the prompt
Example Configuration
Generate a short video and wait for it:
{
"type": "grok_video_gen",
"parameters": {
"prompt": "A timelapse of a city skyline at sunset with dramatic clouds"
}
}
Portrait video from an item field, with a longer polling budget:
{
"type": "grok_video_gen",
"parameters": {
"prompt": "{{ $json.description }}",
"includeInput": true,
"maxConcurrency": 1,
"options": {
"duration": 10,
"waitForCompletion": true,
"pollIntervalMs": 15000,
"maxPollDurationMs": 1200000,
"binaryPropertyName": "videoFile"
}
}
}
Animate an upstream image (image-to-video):
{
"type": "grok_video_gen",
"parameters": {
"prompt": "Slow push-in with gentle camera drift",
"options": {
"inputBinaryPropertyName": "data",
"duration": 5
}
}
}
Submit without waiting and capture the job ID for a later step:
{
"type": "grok_video_gen",
"parameters": {
"prompt": "An abstract swirling galaxy forming from stardust",
"maxConcurrency": 3,
"options": {
"duration": 10,
"waitForCompletion": false,
"responseFieldName": "jobInfo"
}
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Grok Video Gen generates videos from text prompts via the xAI API, with configurable duration and multiple video outputs per request. Orientation and dimensions are not configurable — the API takes no size parameter, so describe the framing you want in the prompt. Use this tool when a workflow needs AI-generated video content produced directly from natural language descriptions. It outputs completed video files stored as binary data on the main channel, with generation failures routed to the error output.
Frequently asked questions
Can I set the orientation or dimensions?
No. The API takes no size parameter, so orientation and dimensions are not configurable on the node. Describe the framing you want in the prompt instead — for example asking for a vertical composition.
How do the videos arrive?
As completed video files stored as binary data on the main output, so they can be uploaded, attached or transcoded by later nodes without extra handling.
Can one request produce several videos?
Yes — multiple video outputs per request are supported, which is useful when you want options from a single prompt.
What happens when generation fails?
The failure routes to the Error output rather than stopping the workflow, so a single unsuccessful prompt does not halt a batch of generations.
Build with the Grok Video Gen node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need xAI credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.