Run Agent
Agent Runs
Run Agent
Execute an agent workflow on videos or run generation-only workflows.
POST
Run Agent
Execute an agent workflow. Supports standard video-input workflows and generation-only workflows such as AI Avatar, Video Generation, Audio Generation, and Image Generation.Documentation Index
Fetch the complete documentation index at: https://docs.mosaic.so/llms.txt
Use this file to discover all available pages before exploring further.
Canonical input model
Treatvideo_inputs as the canonical run input shape:
video_inputs[]entries map assets to a specificVideo Inputtile (agent_node_id)- each entry accepts one or more sources:
video_ids,node_render_ids,video_urls - optional
input_clip_start_ms/input_clip_end_msfields can limit the source range used for a run
video_ids, node_render_ids, video_urls) are shorthand for single-input runs.
Single-input shorthand
If your runnable graph has oneVideo Input tile, you can send top-level input arrays without specifying agent_node_id.
video_ids (from the Uploads API):
node_render_ids (from previous run outputs):
Multi-input workflows
If your agent has multiple runnableVideo Input tiles, you must use video_inputs and provide an entry for each runnable input tile.
In that mode, do not also send top-level input arrays.
You can get each agent_node_id from GET /agent/[agent_id] or from the Mosaic editor’s API info panel for that tile.
Generation-Only Workflows
For workflows starting with generation nodes and no Video Input node, no video inputs should be provided. These agents generate media based on the parameters configured in the agent, or onupdate_params you pass at run time.
Generation node type IDs:
| Node | Node type ID | Docs |
|---|---|---|
| AI Avatar | b3b4c9e2-2a47-4fa9-8ce8-0c1fa1d7b6ef | AI Avatar |
| Video Generation | a2eb3ec2-da7a-4f97-94d2-a9a537548522 | Video Generation |
| Audio Generation | 14687f30-5fd0-468f-8239-2784d83df95b | Audio Generation |
| Image Generation | 18b998a0-2ea7-4676-a5d3-3ae6c8ac0b72 | Image Generation |
video_inputs, video_ids, video_urls, or node_render_ids.
POST /avatar-profiles/create, then pass the avatar ID into the avatar node:
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
video_inputs | object[] | Conditional | Canonical per-tile input mapping. Each entry must include agent_node_id plus at least one of video_ids, node_render_ids, video_urls, or mimir_assets. Required for multi-input runs. |
video_ids | string[] | Conditional | Top-level shorthand for single-input runs. Video UUIDs from the Uploads API (or existing workspace video assets). |
node_render_ids | string[] | Conditional | Top-level shorthand for single-input runs. Render IDs from prior run outputs (GET /agent_run/{run_id} -> outputs[].id) or run webhooks. |
video_urls | string[] | Conditional | Top-level shorthand for single-input runs. Video URLs to ingest (YouTube and signed URLs). |
input_clip_start_ms | integer | Optional start offset applied to all top-level input arrays. Can be sent by itself (trim from this offset to the end) or with input_clip_end_ms. | |
input_clip_end_ms | integer | Optional end offset applied to all top-level input arrays. Can be sent by itself (trim from 0 to this offset) or with input_clip_start_ms. For URL inputs, Mosaic cuts the downloaded asset before uploading it to the run. | |
video_id_inputs | object[] | Conditional | Per-item form for existing uploaded videos. Each object accepts id, input_clip_start_ms, and input_clip_end_ms. |
node_render_inputs | object[] | Conditional | Per-item form for previous render outputs. Each object accepts id, input_clip_start_ms, and input_clip_end_ms. |
video_url_inputs | object[] | Conditional | Per-item form for external/signed URLs. Each object accepts url, input_clip_start_ms, and input_clip_end_ms. |
youtube_url_inputs | object[] | Conditional | Per-item form for YouTube URLs. Each object accepts url, input_clip_start_ms, and input_clip_end_ms. |
mimir_assets | object[] | Conditional | Mimir assets to ingest. Each object has id (Mimir item UUID), optional artifact (highres, proxy, or auto; defaults to highres), and optional input_clip_start_ms / input_clip_end_ms. Requires a Mimir connection. |
callback_url | string | Optional webhook URL for status updates | |
update_params | object | Optional parameters to override node parameters in the agent workflow. Keys must be valid agent_node_id values from the runnable graph. | |
ignore_nodes | string[] | Optional list of agent_node_id values to bypass for this run. Mosaic removes each ignored node from the runtime graph and rewires incoming edges directly to its downstream nodes. |
- Use either top-level input arrays or
video_inputs(not both in the same request). - If the runnable graph has multiple
Video Inputtiles, provide onevideo_inputsentry for each runnable input tile. node_render_idsare valid video inputs (top-level shorthand for single-input runs, or per-entry invideo_inputs).mimir_assetscan be combined with other input types in the same entry.- If you need different start/end ranges for different inputs, use
video_id_inputs,node_render_inputs,video_url_inputs, oryoutube_url_inputsinstead of the plain string arrays. input_clip_start_msandinput_clip_end_msare independent optional fields; if both are provided,input_clip_end_msmust be greater thaninput_clip_start_ms.
video_idscome from the Uploads API.node_render_idscome from previous run outputs (GET /agent_run/{run_id}->outputs[].id) or run webhooks.
Input Clipping
You can run an agent on a segment of a source video by passing millisecond offsets. This is useful when you only want the first part of a long video or when billing should match the portion actually processed. Top-level clipping applies the same range to every top-level input:video_ids and node_render_ids, Mosaic creates a clipped timeline/render input for the requested range.
You can also send only one side of the range:
input_clip_start_ms only (trim from start offset to end of source):
input_clip_end_ms only (trim from 0 to end offset):
Video URL Requirements & Limits
Thevideo_urls field supports two types of URLs:
YouTube URLs:
- Supports standard YouTube video URLs (e.g.,
https://www.youtube.com/watch?v=VIDEO_ID) - Maximum duration: 5 hours per video
- The system automatically validates the video exists and checks duration before processing
- Must be HTTP or HTTPS URLs pointing to video files
- Maximum file size: 5 GB per video
- Maximum duration: 5 hours per video
Modifying Node Parameters
You can override specific parameters for any node in your agent workflow using theupdate_params field. This allows you to dynamically change behavior (like clip duration, prompt text, or number of clips) at runtime.
To find the correct parameters:
- Open your agent in the Mosaic Dashboard
- Click the settings menu on the node you want to modify
- Scroll down to the API info dropdown
- Open the dropdown to find the
Agent node ID - Click Copy params to get the JSON structure
update_params value in your API request.
update_params validation behavior
Mosaic validates update_params before creating the run:
- Unknown
agent_node_idkeys return400 - Invalid parameter types/values return
400 - Protected/system nodes (for example Video Input/Destination/trigger nodes) cannot be overridden with
update_params
Bypassing Nodes at Runtime
Useignore_nodes to skip one or more nodes for a single run without editing the saved agent template.
For each ignored node:
- Incoming connections to the node are rewired to its downstream nodes
- The ignored node is removed from the runtime DAG for that run only
- The template itself is unchanged
Uploading Media for Node Parameters
Some nodes accept images, audio, or videos as parameters. To set these programmatically, use the Uploads API to upload your files and get their UUIDs:Chaining Runs with node_render_ids
You can feed outputs from a previous run directly into another run by passing render IDs returned in webhooks or from GET /agent_run/[run_id] (outputs[].id).
Single-input shorthand:
video_inputs form:
Mimir Integration
Mosaic can ingest video directly from Mimir usingmimir_assets. This downloads the video from your Mimir instance, stores Mimir metadata (item ID, artifact type, connection details) as source_info on the video record, and makes it available for Premiere Pro linking in downstream tiles.
Prerequisites
- Go to Settings > Integrations in the Mosaic dashboard.
- Add your Mimir instance URL (e.g.
https://mimir.mjoll.no) and an API key generated from your Mimir user settings. - Mosaic verifies the connection on save. If verification fails, check that the URL and API key are correct.
Single Mimir asset
Multiple Mimir assets with different artifacts
Mimir assets in multi-input workflows
mimir_assets entry schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | Mimir item ID. |
artifact | string | No | Which artifact variant to download (see table below). Defaults to highres. |
input_clip_start_ms | integer | No | Optional start offset for this Mimir asset. |
input_clip_end_ms | integer | No | Optional end offset for this Mimir asset. |
Artifact options
| Value | Behavior |
|---|---|
highres | Downloads the high-resolution source file. Default when artifact is omitted. Returns 400 if the item has no highres available. |
proxy | Downloads the lower-resolution proxy. Returns 400 if the item has no proxy available. |
auto | Prefers highres if available, falls back to proxy. Returns 400 only if neither is available. |
source_info so Premiere Pro exports can link back to the original asset in Mimir.
mimir_assets require an organization-scoped API key (mk_ prefix). The Mimir connection itself is workspace-scoped — configure it per workspace in Settings → Integrations. If no Mimir connection is configured for the agent’s workspace, the API returns a 400 error explaining how to set one up.How Mimir metadata flows
When a Mimir asset is ingested:- Mosaic fetches the item details from your Mimir instance.
- The selected artifact URL (highres or proxy) is downloaded.
- Mimir metadata (item ID, artifact type, connection details) is stored in
videos.source_info. - Downstream tiles (e.g. News UK, Sun) that generate Premiere Pro projects use this metadata to link clips back to Mimir.
Agent graph best practices
- For “shorter/tighter” edits, place
Rough Cutand/orClipsbefore style-heavy nodes. - Place
ReframebeforeCaptions,Cinematic Captions,Motion Graphics, andWatermarkso overlays are composed against final framing. - Keep
update_paramsminimal and explicit (only send fields you want to override).
Publish to social after render
After run completion, retrieveoutputs[].video_url from GET /agent_run/[run_id] and send that URL in media_urls to POST /social/post.
Response
run_id is used to track the progress of your agent run.