How Graftcode works under the hood
When to use this
You need one entry point for the full technical flow from public method to remote execution — without reading six separate concept articles.

What Graftcode Gateway is (and is not)
Graftcode Gateway (GG) is a native, dependency-free runtime host for Windows, Linux, and macOS. It loads application runtimes (.NET, JVM, Python, Node, …), discovers public interfaces, builds the UGM, and executes calls through embedded Hypertube and IIP.
GG is not a reverse proxy, API gateway, or traffic interceptor. It hosts code and connects runtimes — it does not sit between existing HTTP services.
Operational guides: Install GG, CLI reference. Full-duplex callbacks and multi-module hosting: Hypertube, Hosting multiple modules.
High-level flow
See the diagram at the top of this page. Step-by-step detail follows below.
Development time
- Developer exposes
publicmethods on modules (no REST required). - Graftcode Gateway loads runtimes, analyzes public interfaces, builds UGM (metadata only — no business logic leaves your environment).
- UGM uploads to cloud when
--projectKey/ GSMU enabled, or serves locally for anonymous mode. - Package manager requests a Graft for calling technology (npm, NuGet, pip, …).
- Graftcode Engine generates strongly typed client from UGM, caches, returns package.
See: How Grafts are generated, What goes to Graftcode Cloud.
Runtime
- Caller invokes method on generated Graft (looks like local API).
- Graft captures invocation intent — method name, args, types.
- Intent encoded as IIP (Intention Invocation Protocol) binary message.
- Hypertube on caller routes based on GraftConfig (in-memory, TCP, WebSocket).
- GG on receiver loads target runtime, executes method, returns result or exception.
- Result marshalled back to caller types; exceptions propagate natively.
See: Runtime call execution, Hypertube.
Key components
| Component | Role |
|---|---|
| GG | Native runtime host; produces UGM; executes receiver-side calls |
| UGM | Language-agnostic contract (methods, types, signatures) |
| IIP | Binary protocol for programming intent |
| Hypertube | Runtime bridge; routing, sessions, full-duplex callbacks |
| Graft | Generated typed client in caller language |
| Graftcode Engine | On-demand graft generation from UGM |
| Virtual feed | Project-scoped registry of exposed module versions |
Execution modes (same code)
| Mode | GraftConfig | Where Hypertube runs call |
|---|---|---|
| In-memory | host unset | Same process |
| Local polyglot | host unset, multiple runtimes | Same process, different runtime |
| Remote | host = tcp://… or ws://… | Remote GG process |
See: In-memory vs remote cookbook.
What is not sent to cloud
- Business logic source or IL
- Runtime data, secrets, or customer payloads
- Only interface metadata (UGM) for graft generation
Deeper reading
| Topic | Article |
|---|---|
| Gateway operations | Install GG, CLI reference |
| Caller/receiver | Caller and Receiver |
| Dev vs prod | Development-time vs production-time |
| Interface changes | What happens when interfaces change |
| Terms | Glossary |
Backend pipeline (Grafting Agent)
The monorepo orchestration layer (GPMG → GPGE → GMA → GCG → GRPG → GSMU) implements cloud-side generation. That is internal platform architecture; operators typically interact via Portal and GG only.