Templates

Templates are pre-built workflows that generate complete video compositions. Instead of building scene by scene, you configure a template with your inputs and let it handle the rest.


How templates work

A template is a sequence of steps that run in order. Each step performs a specific action: planning a scene, generating speech, adding content to the composition. Steps can pass data to each other, creating automated pipelines.

Example flow for a product launch template:

1. Generate a script based on your product description 2. Plan individual scenes (intro, features, call-to-action) 3. Generate voiceover from the script 4. Create code scenes with animations 5. Assemble everything into a finished composition

You provide the inputs (product name, key features, tone), and the template handles execution.

Using templates

From the dashboard

Browse available templates on your dashboard under "Community Templates." Each template card shows:

  • Name and description
  • Preview thumbnail (if available)
  • Run button to start a new project
Click a template to open its configuration page. Fill in the required inputs, then run it. A new project is created and the template workflow executes in the background.

From the editor

In the chat panel, ask the AI to run a template:

Use the tutorial video template with the topic "Getting started with our API"

The assistant will execute the template and populate your current project with the generated scenes.

Via CLI

For automation, run templates from the command line:

program workflow run <template-id> \
  --project <project-id> \
  --input '{"topic": "API overview", "tone": "friendly"}'

Check execution status:

program workflow status <execution-id> --watch

Template anatomy

Templates are composed of steps. Each step has:

  • A type: what action it performs (generateScript, addScene, etc.)
  • Inputs: configuration values or references to previous step outputs
  • Outputs: data passed to subsequent steps

Available step types

Planning
  • generateScript: create a video script from context
  • planScene: design an individual scene's structure
  • assessComposition: evaluate the current composition
Composition
  • addScene: add a new scene with code
  • updateScene: modify an existing scene
  • deleteScene: remove a scene
  • setMetadata: update title, duration, dimensions
Generation
  • generateSpeech: convert text to audio
  • generateSceneContent: create React code for a scene
Control flow
  • forEach: iterate over a list with nested steps
  • if: conditional execution

Step references

Steps can reference outputs from previous steps:

{{@reference:0:script}}

This pulls the script output from step index 0. This allows data to flow through your workflow: generate a script, then pass it to speech generation.

Creating templates

Visual editor

Navigate to Settings → Templates or /dashboard/templates. Click "New Template" to open the visual editor.

The canvas displays steps as connected nodes. Drag from the toolbar to add new steps, then connect them with edges to define the execution order. The config panel (right side) shows settings for the selected step. Configure inputs with:
  • Static values (text, numbers)
  • References to other steps' outputs
  • Template input variables (${inputName})
Testing before publishing is crucial. Click "Test" to run your template with sample inputs. Watch the execution log to verify each step works correctly.

Template inputs

Define inputs that users must provide when running your template:

${productName}: the name of the product
${keyFeatures}: comma-separated list of features
${tone}: desired voice (professional, casual, energetic)

These appear as form fields when someone runs your template.

Best practices

Keep steps focused. Each step should do one thing well. It's easier to debug and reuse. Test incrementally. Run your template after adding each step. Catching issues early saves time. Document your inputs. Clear descriptions help users (and future you) understand what each input expects. Use meaningful names. Step and template names should describe what they do.

Execution

Templates run asynchronously. When you trigger a template:

1. An execution record is created 2. Steps run in sequence 3. Each step's status updates in real-time 4. Results populate your composition as steps complete

Track progress in the Activity tab of the editor timeline, or poll via CLI with --watch.

Sharing templates

Templates can be private (organization only) or public (visible to everyone).

Private templates work well for internal workflows: your team's standard intro sequence, branded outros, etc.

Public templates appear in the community section. Share templates you think others would find useful.


Ready to build reusable visual elements? Learn about Components next.