Skip to main content

AI Workflow Generation

Let AI help you build workflows by describing what you want to create.

Overview​

DUTO's AI Flow Generator (V2) creates complete workflows from natural language descriptions. Instead of manually placing and connecting nodes, describe your goal and the AI builds a validated, ready-to-run workflow.

The system uses a Plan-Based architecture:

  1. An LLM generates an abstract FlowPlan (logical steps, not raw nodes/edges)
  2. A TypeScript graphBuilder converts the plan into actual React Flow nodes and edges
  3. This ensures deterministic graph structure with no LLM-induced wiring errors

How to Access​

The AI generator is integrated directly into the Bottom Node Menu at the bottom of the canvas:

  1. Click the text input area in the Bottom Node Menu
  2. Type your prompt describing what you want the workflow to do
  3. Press Enter or click the send button

There is also a standalone AI Flow Generator dialog available for more advanced options.

Quick Actions​

The Bottom Node Menu provides one-click quick action suggestions:

Create mode:

  • Create image
  • Image to video
  • Style variations
  • Analyze and create

Extend mode (when adding to existing workflows):

  • Upscale output
  • Add watermark
  • Create variants
  • Convert to video
  • Save to library

Generation Modes​

Create Mode​

Builds a new workflow from scratch. The generated workflow includes a Start node, input nodes, processing nodes, and output/preview nodes.

Extend Mode​

Adds new nodes to an existing workflow. The AI:

  • Analyzes your current workflow structure (nodes, edges, endpoints)
  • Identifies endpoint nodes (nodes with no outgoing connections)
  • Generates new steps that connect to the existing graph
  • Preserves all existing nodes and connections

You can also extend from a specific node by right-clicking it and choosing a quick action from the context menu.

Generation Settings​

Click the settings icon in the Bottom Node Menu to configure generation behavior:

SettingDescriptionDefault
Image-FirstStart with image generation before videoOn
Upscale ImagesAutomatically add image upscale nodesOn
Upscale VideosAutomatically add video upscale nodesOn
Reference SearchSearch for reference images via TavilyOn
Cinematic ModeEnable cinematography-aware generationOff
Cinematography StyleAuto, commercial, cinematic, documentary, or animeAuto
Story BibleGenerate story bible for cinematic workflowsOff
Require AudioInclude audio generation nodesOff
Prefer Kling (No Audio)Use Kling models when audio is not neededOn
Preview NodesAttach Preview Media nodes to outputsOn
API EndpointAdd API Endpoint node (when API mode enabled)Off
Factual ResearchEnable web research via Tavily before generationOff
Research DepthBasic, advanced, or news-focused researchBasic

Generation Pipeline​

When you submit a prompt, the generation goes through these phases:

1. Research (optional)​

If factual research is enabled, the system queries Tavily for relevant information before generating the workflow. This grounds the generation in real-world data.

2. LLM Planning​

The prompt and settings are sent to the generate-flow edge function. The LLM produces a FlowPlan -- an abstract description of workflow steps using logical step kinds like media.image.generate, media.video.generate, logic.merge, etc.

The LLM also returns:

  • Thinking - The AI's reasoning process
  • Search results - Any reference searches performed
  • Token usage - LLM token consumption

3. Validation​

The FlowPlan is validated for:

  • Valid step kinds and configurations
  • Correct input/output references between steps
  • No orphaned or circular references

4. Graph Building​

The validated FlowPlan is converted to actual React Flow nodes and edges by the graphBuilder. This deterministic step:

  • Maps abstract step kinds to concrete node types (e.g., media.image.generate becomes textToImageNode)
  • Calculates node positions for a clean layout
  • Creates properly typed edges with correct handles
  • Handles special cases like Sync Gate chaining for merge points with more than 3 inputs

5. Flow Validation​

The generated graph is validated against the node connection schema to ensure all edges connect compatible handle types.

6. Auto-Correction​

If validation fails, the system automatically attempts one correction cycle:

  • Previous errors are sent back to the LLM
  • A corrected FlowPlan is generated
  • The correction is re-validated
  • If correction also fails, an error is shown

7. Animation​

Valid nodes and edges are animated onto the canvas one at a time for a smooth visual experience. A progress indicator shows generation status.

Supported Step Kinds​

The AI can generate workflows using these abstract operations:

CategorySteps
SourcesUpload, remote URL, library
PromptsCompose, expand, characteristics
ImageGenerate, upscale, background removal
VideoGenerate, upscale, edit, extend, erase, face swap, transform, watermark remove, translate, motion control
AudioGenerate (TTS), foley, lip sync, audio extraction
LogicMerge (Sync Gate), conditional switch, analyze, compare, retry, batch process
IntelligenceBrain node
CreativeProduct concept, camera angles
DataData feed, variant generator
BrandBrand kit
OutputPreview media, text preview, API endpoint

Writing Good Prompts​

Be Specific​

More detail leads to better results:

Instead of: Generate a product image

Write: Generate a product photography image for an
e-commerce site. The product is a coffee mug. Use
a clean white background with soft lighting.
Photorealistic style, 1:1 aspect ratio. Upscale
to 4K and add a Preview node.

Mention Batch Processing​

For multiple items:

Process all 10 product descriptions from a data feed
and generate images for each one using batch processing.

Specify Models When Needed​

Use Flux Pro for image generation and Kling 2.6 Pro
for video generation.

Include Output Requirements​

Save results to the library and attach Preview Media
nodes so I can see the results inline.

Avoid Vague Descriptions​

Bad:  Make something cool
Bad: Generate images
Good: Generate a fantasy landscape in cinematic style,
upscale to 4K, then convert to a 5-second video
with slow zoom

Extend from Node​

Right-click any node in the canvas to see context-sensitive quick actions:

  • Image output nodes: Upscale, To Video, Variants, Save
  • Video output nodes: Upscale, Extend, Save
  • Text output nodes: Generate Image, Analyze

Selecting a quick action triggers AI generation in extend mode, anchored to that specific node.

Error Handling​

If generation fails, you will see a failure card with options to:

  • Retry - Try the generation again
  • Dismiss - Close the error and try a different prompt

Common failure reasons:

  • Invalid FlowPlan from the LLM (auto-correction attempted first)
  • Validation errors that could not be auto-corrected
  • Network or service errors

Next Steps​