# useapi/google-flow-api architecture

> Architecture diagram of the GitHub repository useapi/google-flow-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/useapi/google-flow-api
- Repository: https://github.com/useapi/google-flow-api

## Overview

This repository is a collection of runnable Google Flow API examples, automation templates, an agent skill, and a browser chat demo—not a shared application with one runtime pipeline. Users supply prompts or story configuration and credentials, then run a generator or workflow to obtain images, videos, or a composed UGC video. README documentation establishes the major capabilities; source excerpts show selected generator behavior. Unexcerpted demo, n8n, and skill wiring is represented only where the README documents it.

Main entry points: [`ugc-product-video/ugc-product-video.mjs`](https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.mjs) (UGC orchestrator), [`ugc-product-video/ugc-product-video.py`](https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.py) (UGC orchestrator Python), [`demo/app.js`](https://github.com/useapi/google-flow-api/blob/main/demo/app.js) (Browser chat), [`n8n`](https://github.com/useapi/google-flow-api/tree/main/n8n) (n8n workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Media generation"]
  node_veo["Veo batch<br/>[google-flow.mjs]"]
  node_veo_py["Veo batch Python<br/>[google-flow.py]"]
  node_images["Image batch"]
  node_images_py["Image batch Python"]
  node_compare["Model comparison"]
  node_compare_py["Model comparison Python"]
  node_omni["Omni batch<br/>[omni-flash.mjs]"]
  node_omni_py["Omni batch Python<br/>[omni-flash.py]"]
  node_extend["Omni extensions<br/>[omni-extend.py]"]
end

subgraph group_ugc["UGC pipeline"]
  node_ugc_runner["UGC orchestrator"]
  node_ugc_py["UGC orchestrator Python"]
  node_ugc_config["Product story config<br/>[prompts.json]"]
  node_ugc_result["Joined video"]
end

subgraph group_demo["Agent chat demo"]
  node_chat["Browser chat<br/>[app.js]"]
  node_chat_render["Media rendering<br/>[render.js]"]
  node_chat_api["Demo API client<br/>[api.js]"]
  node_chat_stream["Event streaming<br/>[sse.js]"]
end

subgraph group_automation["Workflow automation"]
  node_n8n["n8n workflows"]
end

subgraph group_skill["Agent skill"]
  node_skill["Video skill<br/>[SKILL.md]"]
  node_skill_scripts["Skill scripts"]
end

node_user(("User"))
node_api{{"useapi Flow API"}}
node_flow{{"Google Flow account"}}
node_media["Generated media"]
node_agent{{"Google Flow agent"}}

node_user -->|"runs prompts"| node_veo
node_user -->|"runs prompts"| node_veo_py
node_user -->|"runs prompts"| node_images
node_user -->|"runs prompts"| node_images_py
node_user -->|"compares models"| node_compare
node_user -->|"compares models"| node_compare_py
node_user -->|"runs prompts"| node_omni
node_user -->|"runs prompts"| node_omni_py
node_user -->|"provides story"| node_extend
node_veo -->|"submits video jobs"| node_api
node_veo_py -->|"submits video jobs"| node_api
node_images -->|"requests images"| node_api
node_images_py -->|"requests images"| node_api
node_compare -->|"requests model images"| node_api
node_compare_py -->|"requests model images"| node_api
node_omni -->|"submits video jobs"| node_api
node_omni_py -->|"submits video jobs"| node_api
node_extend -->|"extends video jobs"| node_api
node_api -->|"returns media"| node_media
node_user -->|"edits configuration"| node_ugc_config
node_user -->|"runs pipeline"| node_ugc_runner
node_user -->|"runs pipeline"| node_ugc_py
node_ugc_runner -->|"reads settings"| node_ugc_config
node_ugc_py -->|"reads settings"| node_ugc_config
node_ugc_runner -->|"creates assets and clips"| node_api
node_ugc_py -->|"creates assets and clips"| node_api
node_ugc_runner -->|"joins clips"| node_ugc_result
node_ugc_py -->|"joins clips"| node_ugc_result
node_user -->|"chats in browser"| node_chat
node_chat -->|"sends agent requests"| node_chat_api
node_chat -->|"renders media"| node_chat_render
node_chat -->|"streams answers"| node_chat_stream
node_chat_api -->|"uses API"| node_api
node_api -->|"routes agent chat"| node_agent
node_user -->|"runs workflow"| node_n8n
node_n8n -->|"generates media"| node_api
node_n8n -->|"saves to Drive"| node_flow
node_user -->|"requests a clip"| node_skill
node_skill -->|"invokes scripts"| node_skill_scripts
node_skill_scripts -->|"generates video"| node_api
node_skill_scripts -->|"downloads MP4"| node_media

click node_veo "https://github.com/useapi/google-flow-api/blob/main/veo-video/google-flow.mjs"
click node_veo_py "https://github.com/useapi/google-flow-api/blob/main/veo-video/google-flow.py"
click node_images "https://github.com/useapi/google-flow-api/blob/main/images/google-flow-images.mjs"
click node_images_py "https://github.com/useapi/google-flow-api/blob/main/images/google-flow-images.py"
click node_compare "https://github.com/useapi/google-flow-api/blob/main/nano-banana-compare/google-flow-nano-banana-compare.mjs"
click node_compare_py "https://github.com/useapi/google-flow-api/blob/main/nano-banana-compare/google-flow-nano-banana-compare.py"
click node_omni "https://github.com/useapi/google-flow-api/blob/main/omni-flash/omni-flash.mjs"
click node_omni_py "https://github.com/useapi/google-flow-api/blob/main/omni-flash/omni-flash.py"
click node_extend "https://github.com/useapi/google-flow-api/blob/main/omni-extend/omni-extend.py"
click node_ugc_runner "https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.mjs"
click node_ugc_py "https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.py"
click node_ugc_config "https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/prompts.json"
click node_chat "https://github.com/useapi/google-flow-api/blob/main/demo/app.js"
click node_chat_render "https://github.com/useapi/google-flow-api/blob/main/demo/render.js"
click node_chat_api "https://github.com/useapi/google-flow-api/blob/main/demo/api.js"
click node_chat_stream "https://github.com/useapi/google-flow-api/blob/main/demo/sse.js"
click node_n8n "https://github.com/useapi/google-flow-api/tree/main/n8n"
click node_skill "https://github.com/useapi/google-flow-api/blob/main/skills/omni-flash-video/SKILL.md"
click node_skill_scripts "https://github.com/useapi/google-flow-api/tree/main/skills/omni-flash-video/scripts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_veo,node_veo_py,node_images,node_images_py,node_compare,node_compare_py,node_omni,node_omni_py,node_extend,node_user toneBlue
class node_ugc_runner,node_ugc_py,node_ugc_config,node_ugc_result toneAmber
class node_chat,node_chat_render,node_chat_api,node_chat_stream,node_api toneMint
class node_n8n toneRose
class node_skill,node_skill_scripts,node_flow,node_media,node_agent toneIndigo
```

## Components

### Media generation

- [Veo batch](https://github.com/useapi/google-flow-api/blob/main/veo-video/google-flow.mjs): `veo-video/google-flow.mjs`
- [Veo batch Python](https://github.com/useapi/google-flow-api/blob/main/veo-video/google-flow.py): `veo-video/google-flow.py`
- [Image batch](https://github.com/useapi/google-flow-api/blob/main/images/google-flow-images.mjs): `images/google-flow-images.mjs`
- [Image batch Python](https://github.com/useapi/google-flow-api/blob/main/images/google-flow-images.py): `images/google-flow-images.py`
- [Model comparison](https://github.com/useapi/google-flow-api/blob/main/nano-banana-compare/google-flow-nano-banana-compare.mjs): `nano-banana-compare/google-flow-nano-banana-compare.mjs`
- [Model comparison Python](https://github.com/useapi/google-flow-api/blob/main/nano-banana-compare/google-flow-nano-banana-compare.py): `nano-banana-compare/google-flow-nano-banana-compare.py`
- [Omni batch](https://github.com/useapi/google-flow-api/blob/main/omni-flash/omni-flash.mjs): `omni-flash/omni-flash.mjs`
- [Omni batch Python](https://github.com/useapi/google-flow-api/blob/main/omni-flash/omni-flash.py): `omni-flash/omni-flash.py`
- [Omni extensions](https://github.com/useapi/google-flow-api/blob/main/omni-extend/omni-extend.py): `omni-extend/omni-extend.py`

### UGC pipeline

- [UGC orchestrator](https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.mjs): `ugc-product-video/ugc-product-video.mjs`
- [UGC orchestrator Python](https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/ugc-product-video.py): `ugc-product-video/ugc-product-video.py`
- [Product story config](https://github.com/useapi/google-flow-api/blob/main/ugc-product-video/prompts.json): `ugc-product-video/prompts.json`
- **Joined video**

### Agent chat demo

- [Browser chat](https://github.com/useapi/google-flow-api/blob/main/demo/app.js): `demo/app.js`
- [Media rendering](https://github.com/useapi/google-flow-api/blob/main/demo/render.js): `demo/render.js`
- [Demo API client](https://github.com/useapi/google-flow-api/blob/main/demo/api.js): `demo/api.js`
- [Event streaming](https://github.com/useapi/google-flow-api/blob/main/demo/sse.js): `demo/sse.js`

### Workflow automation

- [n8n workflows](https://github.com/useapi/google-flow-api/tree/main/n8n): `n8n`

### Agent skill

- [Video skill](https://github.com/useapi/google-flow-api/blob/main/skills/omni-flash-video/SKILL.md): `skills/omni-flash-video/SKILL.md`
- [Skill scripts](https://github.com/useapi/google-flow-api/tree/main/skills/omni-flash-video/scripts): `skills/omni-flash-video/scripts`

### Other components

- **User**
- **useapi Flow API**
- **Google Flow account**
- **Generated media**
- **Google Flow agent**

## Connections

- User → Veo batch: runs prompts (evidence: `README.md`)
- User → Veo batch Python: runs prompts (evidence: `README.md`)
- User → Image batch: runs prompts (evidence: `README.md`)
- User → Image batch Python: runs prompts (evidence: `README.md`)
- User → Model comparison: compares models (evidence: `README.md`)
- User → Model comparison Python: compares models (evidence: `README.md`)
- User → Omni batch: runs prompts (evidence: `README.md`)
- User → Omni batch Python: runs prompts (evidence: `README.md`)
- User → Omni extensions: provides story (evidence: `README.md`)
- Veo batch → useapi Flow API: submits video jobs (evidence: `veo-video/google-flow.mjs`)
- Veo batch Python → useapi Flow API: submits video jobs (evidence: `veo-video/google-flow.py`)
- Image batch → useapi Flow API: requests images (evidence: `images/google-flow-images.mjs`)
- Image batch Python → useapi Flow API: requests images (evidence: `images/google-flow-images.py`)
- Model comparison → useapi Flow API: requests model images (evidence: `nano-banana-compare/google-flow-nano-banana-compare.mjs`)
- Model comparison Python → useapi Flow API: requests model images (evidence: `nano-banana-compare/google-flow-nano-banana-compare.py`)
- Omni batch → useapi Flow API: submits video jobs (evidence: `omni-flash/omni-flash.mjs`)
- Omni batch Python → useapi Flow API: submits video jobs (evidence: `omni-flash/omni-flash.py`)
- Omni extensions → useapi Flow API: extends video jobs (evidence: `omni-extend/omni-extend.py`)
- useapi Flow API → Generated media: returns media (evidence: `README.md`)
- User → Product story config: edits configuration (evidence: `README.md`)
- User → UGC orchestrator: runs pipeline (evidence: `README.md`)
- User → UGC orchestrator Python: runs pipeline (evidence: `README.md`)
- UGC orchestrator → Product story config: reads settings (evidence: `ugc-product-video/ugc-product-video.mjs`)
- UGC orchestrator Python → Product story config: reads settings (evidence: `ugc-product-video/ugc-product-video.py`)
- UGC orchestrator → useapi Flow API: creates assets and clips (evidence: `ugc-product-video/ugc-product-video.mjs`)
- UGC orchestrator Python → useapi Flow API: creates assets and clips (evidence: `ugc-product-video/ugc-product-video.py`)
- UGC orchestrator → Joined video: joins clips (evidence: `ugc-product-video/ugc-product-video.mjs`)
- UGC orchestrator Python → Joined video: joins clips (evidence: `ugc-product-video/ugc-product-video.py`)
- User → Browser chat: chats in browser (evidence: `README.md`)
- Browser chat → Demo API client: sends agent requests (evidence: `README.md`)
- Browser chat → Media rendering: renders media (evidence: `README.md`)
- Browser chat → Event streaming: streams answers (evidence: `README.md`)
- Demo API client → useapi Flow API: uses API (evidence: `README.md`)
- useapi Flow API → Google Flow agent: routes agent chat (evidence: `README.md`)
- User → n8n workflows: runs workflow (evidence: `README.md`)
- n8n workflows → useapi Flow API: generates media (evidence: `README.md`)
- n8n workflows → Google Flow account: saves to Drive (evidence: `README.md`)
- User → Video skill: requests a clip (evidence: `README.md`)
- Video skill → Skill scripts: invokes scripts (evidence: `README.md`)
- Skill scripts → useapi Flow API: generates video (evidence: `README.md`)
- Skill scripts → Generated media: downloads MP4 (evidence: `README.md`)
