AI Video Agent Workflow: Plan and Run a Multi-Step Canvas

12 min · Aggiornato 2026-09-12 · Dal team NamiFusion

Use a canvas workflow and its MCP tools to organize assets, prompts, dependencies, execution, and review for a video project.

An AI video agent workflow is useful when a deliverable has dependencies: a brief informs a key image, that image becomes a video input, and the output must be reviewed before a later shot runs. NamiFusion's canvas represents work as text, image, video, and asset nodes connected by explicit edges. An agent can inspect and mutate the same saved canvas through Workflow MCP, then execute selected targets and read completed outputs. The canvas does not remove editorial judgment. It makes inputs, lineage, and reruns easier to see, while you remain responsible for rights, factual review, cost, and the decision to publish.

Design the graph before executing it

Start with a shot list, not with model calls. For each shot, record purpose, duration target, aspect ratio, source assets, prompt, must-preserve details, and approval condition. Break the canvas into stages: a text brief node; durable asset nodes for approved references; image nodes for key frames; video nodes for motion; and text nodes for review notes. Connect only real dependencies. A review note does not need to feed a render unless its text is actually intended as an input. Keep experimental branches separate from the approved path so a rerun does not silently replace a trusted asset.

Prepare local media as durable workflow assets before asking an agent to edit the graph. Upload each file through the interactive canvas, confirm that its asset node is saved, and give the workflow and asset context to the agent. The agent can then call workflow_get_canvas, inspect the existing asset nodes and their IDs, and connect those nodes to image or video steps. This keeps file transfer in the supported canvas interface while Workflow MCP handles saved topology, execution, and run inspection.

Agent execution sequence

  1. Upload required local files through the interactive canvas and confirm that the asset nodes are saved.
  2. Create an API key on the API Keys page and configure the Workflow MCP endpoint at https://www.namifusion.com/api/v1/workflow/mcp/. Keep the key in an environment variable or secret store.
  3. Call workflow_list and choose the intended workflow.
  4. Call workflow_get_canvas to read nodes, edges, existing asset-node IDs, and the current revision token.
  5. Add or update one node at a time with workflow_upsert_node, always passing the latest revision.
  6. Refresh the canvas after mutations; stale revisions fail by design.
  7. Use workflow_patch_topology to connect the existing asset nodes or change other explicit edges.
  8. Call workflow_execute with only the target_node_ids needed for this run. Use rerun_node_ids only for nodes deliberately selected for regeneration.
  9. Save the run_id and call workflow_wait_run or workflow_get_run until terminal.
  10. Review completed node outputs before executing dependent editorial branches.
Workflow MCP task outline
1. workflow_list()
2. workflow_get_canvas(workflow_id)
3. workflow_upsert_node(workflow_id, revision, data, node_type, ...)
4. workflow_get_canvas(workflow_id)  # refresh revision
5. workflow_patch_topology(workflow_id, revision, add_edges=[...])
6. workflow_execute(workflow_id, target_node_ids=[...])
7. workflow_wait_run(run_id, timeout_seconds=30, poll_interval_seconds=2)

Give the agent an editorial contract

A useful agent instruction names the deliverable, allowed assets, node targets, preserved details, stop conditions, and approval boundary. For example: “In workflow WORKFLOW_ID, inspect the current canvas. Add a text brief for a six-second landscape product reveal, connect the existing approved bottle asset to a new video node, and prepare the node without executing it. Preserve label text and bottle geometry. Do not delete nodes or alter the approved branch. Return the new node ID, latest revision, and a concise input summary.” This exercise deliberately stops before paid execution. When execution is authorized, say exactly which target nodes may run and whether any may be rerun.

Example agent brief
Inspect workflow WORKFLOW_ID and its current revision.
Add a brief for a six-second landscape product reveal.
Connect the existing approved bottle asset to a new video node.
Preserve label text and bottle geometry.
Do not execute, delete nodes, or change the approved branch.
Return the new node ID, latest revision, and input summary.

Review runs and recover safely

Inspect every completed node against its input and approval condition. For images, check identity, layout, text, and artifacts. For video, check first-frame fidelity, geometry over time, motion, cuts, and audio. Record an approval note on the canvas before downstream execution. A stale revision means another writer changed the canvas: fetch it again, reconcile the difference, and retry the intended mutation with the new token. If workflow_execute returns an ambiguous transport failure, inspect canvas and run state before retrying because execution may already have started. Blind retries can duplicate paid work. If a run times out in workflow_wait_run, keep its run_id and query it later; a client timeout does not by itself mean the generation failed.

Limits and cost controls

Workflow MCP calls organize the canvas, but paid generation still follows normal workflow execution and credit rules. Model availability, supported inputs, duration, output quality, and generation time can change by model. API keys with an expired credential or exhausted non-zero monthly quota are rejected. The HTTP surface also has request limits; handle HTTP 429 using Retry-After rather than tight polling. Execute only the targets needed, avoid rerunning approved ancestors, and keep a run ledger with run_id, target IDs, prompt version, asset IDs, and review result. For a new graph, validate one short branch before launching all shots.

Domande frequenti

Can an agent edit a workflow while I use the canvas?+

It can, but each mutation uses a revision token. When another writer changes the canvas, stale mutations fail; fetch the latest canvas and reconcile before continuing.

Does workflow_wait_run guarantee completion?+

No. It returns when the run becomes terminal or when its wait timeout is reached. If timed out, retain run_id and query again later.

Should I retry workflow_execute after a network error?+

First inspect the workflow and run state. The request may have started paid work even if the response was lost, so a blind retry can duplicate execution.