---
title: "procGraph (asset type)"
description: "A .procGraph asset is a procedural graph: a description of how to make something, written as code, that can be evaluated over and over with different numbers. Its init.luau returns proc.define(...) —…"
section: "Types"
slug: "types-procgraph"
canonical: "https://origozero.ai/docs/types-procgraph"
updated: "2026-08-22T07:41:56.154113639+00:00"
tags: ["asset-type", "reference"]
---

# procGraph (asset type)

## Shape

A `<name>.procGraph/` folder containing:
- `init.luau` — the graph's definition. Returns `proc.define(id, function(g) … end)`.
- `graph.json` — the compiled form (`proc.graph.v1`), written by this type from
  `init.luau`. Generated, never hand-edited.
- `README.md`, `.metadata` — the universal asset files.

## Authoring

Edit `init.luau`. The type recompiles on the write, rewrites `graph.json`, and
every live `Generator` bound to the asset re-cooks from it — there is no build
step between saving and seeing the result.

A recompile is cheap however large the graph: node results are keyed by content,
so recompiling an unchanged node reuses its cooked output, and an edit
invalidates only that node and the ones downstream of it. Changing the last step
of a landscape does not re-run the erosion above it.

Two words worth keeping apart, because both happen here:
- **compile** — `init.luau` → `graph.json`. Produces the graph.
- **cook** — each node performing its operation to produce a value. Runs the
  graph. Driven by a `Generator`, reported by `procgen.cooks`.

## Using one

Through the ref rather than a path string: `ref:eval("mesh")` evaluates an
output, `ref:inputs()` lists the knobs a Generator can override by name,
`ref:outputs()` the values it produces, `ref:validate()` type-checks it, and
`ref:asOp()` wraps it so another graph can composite it as a node.

Generated outputs (meshes, materials, textures, bundles) are persisted through
their own asset types — never `asset.write_*`.

## Related

- `@builtin::modules.proc` — the authoring + evaluation model.
- `procgen.toolbox` — `preview`, `spawn`, `bake`, `validate`, `ops`, `schema`
  and the wider tool family.
