# deskree-inc/blok architecture

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

- Interactive diagram: https://gitdiagram.com/deskree-inc/blok
- Repository: https://github.com/deskree-inc/blok

## Overview

Blok is a modular backend framework: developers define nodes and workflows, choose a trigger, and execute workflow logic through runtime services. The graph includes CLI project/workflow authoring, HTTP and gRPC trigger surfaces, shared workflow helpers, and TypeScript and Python execution components. README statements establish the product-level workflow; source-index references establish only the cited module relationships. Several runtime and CLI implementation files were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`core/workflow-helper/src/components/Workflow.ts`](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/Workflow.ts) (Workflow definition), [`triggers/http/src/runner/HttpTrigger.ts`](https://github.com/deskree-inc/blok/blob/main/triggers/http/src/runner/HttpTrigger.ts) (HTTP trigger), [`runtimes/python3/server.py`](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/server.py) (Python gRPC server), [`runtimes/python3/core/nanoservice.py`](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/nanoservice.py) (Python node service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring tools"]
  node_cli_project["Project creation<br/>[project.ts]"]
  node_cli_workflow["Workflow creation<br/>[workflow.ts]"]
  node_cli_node["Node creation<br/>[node.ts]"]
  node_cli_deploy["Deployment<br/>[index.ts]"]
  node_cli_monitor["Monitoring<br/>[index.ts]"]
end

subgraph group_workflow["Workflow model"]
  node_workflow_model["Workflow definition<br/>[Workflow.ts]"]
  node_step_node["Step builder<br/>[StepNode.ts]"]
  node_step_options["Step options<br/>[StepOpts.ts]"]
  node_if_condition["If condition<br/>[AddIf.ts]"]
  node_else_condition["Else condition<br/>[AddElse.ts]"]
end

subgraph group_ingress["Trigger ingress"]
  node_http_trigger["HTTP trigger<br/>[HttpTrigger.ts]"]
  node_grpc_trigger["gRPC trigger<br/>[GRpcTrigger.ts]"]
  node_http_routes["HTTP app routes<br/>[AppRoutes.ts]"]
end

subgraph group_tsruntime["TypeScript runtime"]
  node_ts_nanoservice["Node execution<br/>[NanoService.ts]"]
  node_runner_node["Runner node<br/>[RunnerNode.ts]"]
  node_runner_config["Workflow config<br/>[Config.ts]"]
  node_shared_context["Execution context<br/>[Context.ts]"]
end

subgraph group_pyruntime["Python runtime"]
  node_python_server["Python gRPC server<br/>[server.py]"]
  node_message_codec["Message codec<br/>[message_manager.py]"]
  node_python_runner["Python runner<br/>[runner.py]"]
  node_python_node["Python node base<br/>[node_base.py]"]
  node_python_service["Python node service<br/>[nanoservice.py]"]
  node_python_context["Python context<br/>[context.py]"]
  node_python_response["Python response<br/>[response.py]"]
end

node_developer(("Developer"))
node_http_actor(("HTTP client"))

node_developer -->|"creates project"| node_cli_project
node_developer -->|"creates workflow"| node_cli_workflow
node_developer -->|"creates node"| node_cli_node
node_cli_workflow -.->|"authors workflow"| node_workflow_model
node_workflow_model -->|"contains steps"| node_step_node
node_step_node -->|"uses condition"| node_if_condition
node_step_node -->|"uses condition"| node_else_condition
node_step_options -->|"types condition"| node_if_condition
node_step_options -->|"types condition"| node_else_condition
node_workflow_model -->|"starts with trigger"| node_http_trigger
node_http_actor -->|"sends request"| node_http_trigger
node_http_trigger -->|"references routes"| node_http_routes
node_grpc_trigger -.->|"alternative ingress"| node_http_trigger
node_workflow_model -->|"sequences node work"| node_ts_nanoservice
node_runner_config -->|"names node type"| node_runner_node
node_python_server -->|"decodes and encodes"| node_message_codec
node_python_server -->|"invokes runner"| node_python_runner
node_python_server -->|"constructs context"| node_python_context
node_python_service -->|"extends base"| node_python_node
node_python_service -->|"reads context"| node_python_context
node_python_service -->|"returns response"| node_python_response

click node_cli_project "https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/project.ts"
click node_cli_workflow "https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/workflow.ts"
click node_cli_node "https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/node.ts"
click node_cli_deploy "https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/deploy/index.ts"
click node_cli_monitor "https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/monitor/index.ts"
click node_workflow_model "https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/Workflow.ts"
click node_step_node "https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/StepNode.ts"
click node_step_options "https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/types/StepOpts.ts"
click node_if_condition "https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/AddIf.ts"
click node_else_condition "https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/AddElse.ts"
click node_http_trigger "https://github.com/deskree-inc/blok/blob/main/triggers/http/src/runner/HttpTrigger.ts"
click node_grpc_trigger "https://github.com/deskree-inc/blok/blob/main/triggers/grpc/src/GRpcTrigger.ts"
click node_http_routes "https://github.com/deskree-inc/blok/blob/main/triggers/http/src/AppRoutes.ts"
click node_ts_nanoservice "https://github.com/deskree-inc/blok/blob/main/core/runner/src/NanoService.ts"
click node_runner_node "https://github.com/deskree-inc/blok/blob/main/core/runner/src/RunnerNode.ts"
click node_runner_config "https://github.com/deskree-inc/blok/blob/main/core/runner/src/types/Config.ts"
click node_shared_context "https://github.com/deskree-inc/blok/blob/main/core/shared/src/types/Context.ts"
click node_python_server "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/server.py"
click node_message_codec "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/util/message_manager.py"
click node_python_runner "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/runner.py"
click node_python_node "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/node_base.py"
click node_python_service "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/nanoservice.py"
click node_python_context "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/types/context.py"
click node_python_response "https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/types/response.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_cli_project,node_cli_workflow,node_cli_node,node_cli_deploy,node_cli_monitor,node_http_actor toneBlue
class node_workflow_model,node_step_node,node_step_options,node_if_condition,node_else_condition toneAmber
class node_http_trigger,node_grpc_trigger,node_http_routes toneMint
class node_ts_nanoservice,node_runner_node,node_runner_config,node_shared_context toneRose
class node_python_server,node_message_codec,node_python_runner,node_python_node,node_python_service,node_python_context,node_python_response,node_developer toneIndigo
```

## Components

### Authoring tools

- [Project creation](https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/project.ts): `packages/cli/src/commands/create/project.ts`
- [Workflow creation](https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/workflow.ts): `packages/cli/src/commands/create/workflow.ts`
- [Node creation](https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/create/node.ts): `packages/cli/src/commands/create/node.ts`
- [Deployment](https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/deploy/index.ts): `packages/cli/src/commands/deploy/index.ts`
- [Monitoring](https://github.com/deskree-inc/blok/blob/main/packages/cli/src/commands/monitor/index.ts): `packages/cli/src/commands/monitor/index.ts`

### Workflow model

- [Workflow definition](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/Workflow.ts): `core/workflow-helper/src/components/Workflow.ts`
- [Step builder](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/StepNode.ts): `core/workflow-helper/src/components/StepNode.ts`
- [Step options](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/types/StepOpts.ts): `core/workflow-helper/src/types/StepOpts.ts`
- [If condition](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/AddIf.ts): `core/workflow-helper/src/components/AddIf.ts`
- [Else condition](https://github.com/deskree-inc/blok/blob/main/core/workflow-helper/src/components/AddElse.ts): `core/workflow-helper/src/components/AddElse.ts`

### Trigger ingress

- [HTTP trigger](https://github.com/deskree-inc/blok/blob/main/triggers/http/src/runner/HttpTrigger.ts): `triggers/http/src/runner/HttpTrigger.ts`
- [gRPC trigger](https://github.com/deskree-inc/blok/blob/main/triggers/grpc/src/GRpcTrigger.ts): `triggers/grpc/src/GRpcTrigger.ts`
- [HTTP app routes](https://github.com/deskree-inc/blok/blob/main/triggers/http/src/AppRoutes.ts): `triggers/http/src/AppRoutes.ts`

### TypeScript runtime

- [Node execution](https://github.com/deskree-inc/blok/blob/main/core/runner/src/NanoService.ts): `core/runner/src/NanoService.ts`
- [Runner node](https://github.com/deskree-inc/blok/blob/main/core/runner/src/RunnerNode.ts): `core/runner/src/RunnerNode.ts`
- [Workflow config](https://github.com/deskree-inc/blok/blob/main/core/runner/src/types/Config.ts): `core/runner/src/types/Config.ts`
- [Execution context](https://github.com/deskree-inc/blok/blob/main/core/shared/src/types/Context.ts): `core/shared/src/types/Context.ts`

### Python runtime

- [Python gRPC server](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/server.py): `runtimes/python3/server.py`
- [Message codec](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/util/message_manager.py): `runtimes/python3/util/message_manager.py`
- [Python runner](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/runner.py): `runtimes/python3/runner.py`
- [Python node base](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/node_base.py): `runtimes/python3/core/node_base.py`
- [Python node service](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/nanoservice.py): `runtimes/python3/core/nanoservice.py`
- [Python context](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/types/context.py): `runtimes/python3/core/types/context.py`
- [Python response](https://github.com/deskree-inc/blok/blob/main/runtimes/python3/core/types/response.py): `runtimes/python3/core/types/response.py`

### Other components

- **Developer**
- **HTTP client**

## Connections

- Developer → Project creation: creates project (evidence: `README.md`)
- Developer → Workflow creation: creates workflow (evidence: `README.md`)
- Developer → Node creation: creates node (evidence: `README.md`)
- Workflow creation → Workflow definition: authors workflow
- Workflow definition → Step builder: contains steps (evidence: `README.md`)
- Step builder → If condition: uses condition (evidence: `core/workflow-helper/src/components/StepNode.ts`)
- Step builder → Else condition: uses condition (evidence: `core/workflow-helper/src/components/StepNode.ts`)
- Step options → If condition: types condition (evidence: `core/workflow-helper/src/types/StepOpts.ts`)
- Step options → Else condition: types condition (evidence: `core/workflow-helper/src/types/StepOpts.ts`)
- Workflow definition → HTTP trigger: starts with trigger (evidence: `README.md`)
- HTTP client → HTTP trigger: sends request (evidence: `README.md`)
- HTTP trigger → HTTP app routes: references routes (evidence: `triggers/http/src/runner/HttpTrigger.ts`)
- gRPC trigger → HTTP trigger: alternative ingress
- Workflow definition → Node execution: sequences node work (evidence: `README.md`)
- Workflow config → Runner node: names node type (evidence: `core/runner/src/types/Config.ts`)
- Python gRPC server → Message codec: decodes and encodes (evidence: `runtimes/python3/server.py`)
- Python gRPC server → Python runner: invokes runner (evidence: `runtimes/python3/server.py`)
- Python gRPC server → Python context: constructs context (evidence: `runtimes/python3/server.py`)
- Python node service → Python node base: extends base (evidence: `runtimes/python3/core/nanoservice.py`)
- Python node service → Python context: reads context (evidence: `runtimes/python3/core/nanoservice.py`)
- Python node service → Python response: returns response (evidence: `runtimes/python3/core/nanoservice.py`)
