# yiurenma/workflow architecture

> Architecture diagram of the GitHub repository yiurenma/workflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yiurenma/workflow
- Repository: https://github.com/yiurenma/workflow

## Overview

The repository documents a workflow automation platform: users design and validate workflows, publish them, then invoke them and inspect run records. The product documentation identifies the UI, online API, and operation API; the sampled assistant scripts explicitly call those APIs and local Ollama. The tree does not expose implementation files for the platform submodules, so their internal calls and persistence wiring are not inferred. The graph also includes the local AI assistant’s documented workflow-generation, validation, search, and support capabilities.

Main entry points: [`local-ai-assistant`](https://github.com/yiurenma/workflow/tree/master/local-ai-assistant) (AI assistant), [`workflow-ui`](https://github.com/yiurenma/workflow/tree/master/workflow-ui) (Workflow UI), [`local-ai-assistant/tools/generate_workflow.py`](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/generate_workflow.py) (Workflow generator), [`workflow-operation-api`](https://github.com/yiurenma/workflow/tree/master/workflow-operation-api) (Operation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Workflow design"]
  node_studio["Workflow UI"]
  node_canvas["Canvas editor"]
  node_appmgr["Applications"]
end

subgraph group_runtime["Execution and records"]
  node_online["Online API"]
  node_operation["Operation API"]
  node_records[("Run records")]
end

subgraph group_assistant["Local AI assistant"]
  node_agent["AI assistant"]
  node_router["Model router<br/>[model_router.py]"]
  node_ollama["Ollama"]
  node_generator["Workflow generator"]
  node_validator["Workflow validator"]
  node_websearch["Web search<br/>[web_search.py]"]
  node_gateway["AI gateway<br/>[app.py]"]
  node_trigger["Workflow trigger"]
  node_recordquery["Record query<br/>[query_records.py]"]
end

subgraph group_platform["Platform services"]
end

node_user(("Workflow user"))

node_user -->|"designs and runs"| node_studio
node_studio -->|"edits workflows"| node_canvas
node_studio -->|"manages apps"| node_appmgr
node_user -->|"asks for help"| node_agent
node_agent -->|"routes prompts"| node_router
node_router -.->|"fallback generation"| node_ollama
node_generator -->|"requests generation"| node_ollama
node_generator -.->|"output can be checked"| node_validator
node_agent -.->|"invokes search"| node_websearch
node_agent -.->|"requests chat"| node_gateway
node_gateway -->|"proxies requests"| node_ollama
node_user -->|"requests execution"| node_trigger
node_trigger -->|"posts workflow"| node_online
node_user -->|"requests history"| node_recordquery
node_recordquery -->|"queries records"| node_operation
node_operation -->|"reads and writes"| node_records

click node_studio "https://github.com/yiurenma/workflow/tree/master/workflow-ui"
click node_canvas "https://github.com/yiurenma/workflow/tree/master/workflow-ui"
click node_appmgr "https://github.com/yiurenma/workflow/tree/master/workflow-ui"
click node_online "https://github.com/yiurenma/workflow/tree/master/workflow-online-api"
click node_operation "https://github.com/yiurenma/workflow/tree/master/workflow-operation-api"
click node_records "https://github.com/yiurenma/workflow/tree/master/workflow-operation-api"
click node_agent "https://github.com/yiurenma/workflow/tree/master/local-ai-assistant"
click node_router "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/openwebui-functions/model_router.py"
click node_generator "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/generate_workflow.py"
click node_validator "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/validate_workflow.py"
click node_websearch "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/openwebui-tools/web_search.py"
click node_gateway "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/gateway/app.py"
click node_trigger "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/trigger_workflow.py"
click node_recordquery "https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/query_records.py"

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_studio,node_canvas,node_appmgr,node_user toneBlue
class node_online,node_operation,node_records toneAmber
class node_agent,node_router,node_ollama,node_generator,node_validator,node_websearch,node_gateway,node_trigger,node_recordquery toneMint
```

## Components

### Workflow design

- [Workflow UI](https://github.com/yiurenma/workflow/tree/master/workflow-ui): `workflow-ui`
- [Canvas editor](https://github.com/yiurenma/workflow/tree/master/workflow-ui): `workflow-ui`
- [Applications](https://github.com/yiurenma/workflow/tree/master/workflow-ui): `workflow-ui`

### Execution and records

- [Online API](https://github.com/yiurenma/workflow/tree/master/workflow-online-api): `workflow-online-api`
- [Operation API](https://github.com/yiurenma/workflow/tree/master/workflow-operation-api): `workflow-operation-api`
- [Run records](https://github.com/yiurenma/workflow/tree/master/workflow-operation-api): `workflow-operation-api`

### Local AI assistant

- [AI assistant](https://github.com/yiurenma/workflow/tree/master/local-ai-assistant): `local-ai-assistant`
- [Model router](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/openwebui-functions/model_router.py): `local-ai-assistant/openwebui-functions/model_router.py`
- **Ollama**
- [Workflow generator](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/generate_workflow.py): `local-ai-assistant/tools/generate_workflow.py`
- [Workflow validator](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/validate_workflow.py): `local-ai-assistant/tools/validate_workflow.py`
- [Web search](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/openwebui-tools/web_search.py): `local-ai-assistant/openwebui-tools/web_search.py`
- [AI gateway](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/gateway/app.py): `local-ai-assistant/gateway/app.py`
- [Workflow trigger](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/trigger_workflow.py): `local-ai-assistant/tools/trigger_workflow.py`
- [Record query](https://github.com/yiurenma/workflow/blob/master/local-ai-assistant/tools/query_records.py): `local-ai-assistant/tools/query_records.py`

### Other components

- **Workflow user**

## Connections

- Workflow user → Workflow UI: designs and runs
- Workflow UI → Canvas editor: edits workflows
- Workflow UI → Applications: manages apps
- Workflow user → AI assistant: asks for help
- AI assistant → Model router: routes prompts
- Model router → Ollama: fallback generation
- Workflow generator → Ollama: requests generation
- Workflow generator → Workflow validator: output can be checked
- AI assistant → Web search: invokes search
- AI assistant → AI gateway: requests chat
- AI gateway → Ollama: proxies requests
- Workflow user → Workflow trigger: requests execution
- Workflow trigger → Online API: posts workflow
- Workflow user → Record query: requests history
- Record query → Operation API: queries records
- Operation API → Run records: reads and writes
