Skip to main content


Deno runtime

The DenoRuntime allows you to run lightweight and short-lived typescript function in a sandboxed environment. Permissions can be customized per typegraph and by default only include some HTTPs domains. It's a great way to implement custom logic and materializers. All typegraphs can lazily spawn a web worker and get an incredible cold-start and continuous performance thanks to the V8 engine powering Deno.


Instead of providing the typescript code inline, we can also point to a file on disk:


from typegraph import typegraph, Policy, t, Graph
from typegraph.runtimes.deno import DenoRuntime

def deno(g: Graph):
public = Policy.public()
deno = DenoRuntime()

t.struct({"a": t.number(), "b": t.number()}),
module="main.ts", # path to ts file
name="doAddition", # function export from ts file to use

Where main.ts looks like:

// main.ts

interface AddInput {
a: number;
b: number;
export function doAddition({ a, b }: AddInput) {
return a + b;