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.

Graftcode end-to-end flow — development time and runtime


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

  1. Developer exposes public methods on modules (no REST required).
  2. Graftcode Gateway loads runtimes, analyzes public interfaces, builds UGM (metadata only — no business logic leaves your environment).
  3. UGM uploads to cloud when --projectKey / GSMU enabled, or serves locally for anonymous mode.
  4. Package manager requests a Graft for calling technology (npm, NuGet, pip, …).
  5. Graftcode Engine generates strongly typed client from UGM, caches, returns package.

See: How Grafts are generated, What goes to Graftcode Cloud.


Runtime

  1. Caller invokes method on generated Graft (looks like local API).
  2. Graft captures invocation intent — method name, args, types.
  3. Intent encoded as IIP (Intention Invocation Protocol) binary message.
  4. Hypertube on caller routes based on GraftConfig (in-memory, TCP, WebSocket).
  5. GG on receiver loads target runtime, executes method, returns result or exception.
  6. Result marshalled back to caller types; exceptions propagate natively.

See: Runtime call execution, Hypertube.


Key components

ComponentRole
GGNative runtime host; produces UGM; executes receiver-side calls
UGMLanguage-agnostic contract (methods, types, signatures)
IIPBinary protocol for programming intent
HypertubeRuntime bridge; routing, sessions, full-duplex callbacks
GraftGenerated typed client in caller language
Graftcode EngineOn-demand graft generation from UGM
Virtual feedProject-scoped registry of exposed module versions

Execution modes (same code)

ModeGraftConfigWhere Hypertube runs call
In-memoryhost unsetSame process
Local polyglothost unset, multiple runtimesSame process, different runtime
Remotehost = 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

TopicArticle
Gateway operationsInstall GG, CLI reference
Caller/receiverCaller and Receiver
Dev vs prodDevelopment-time vs production-time
Interface changesWhat happens when interfaces change
TermsGlossary

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.