---
title: "Visual Scripting Functions"
description: "Functions are reusable same-script graph scopes with typed inputs and outputs. Use them to keep large graphs readable and to share behavior inside one script."
engineVersion: v1.0.234
date: 2026-09-28
license: "(c) Gessa, proprietary. Cite with attribution to https://gessa.ai/docs/. Terms: https://gessa.ai/terms/."
canonical: https://gessa.ai/docs/creator/visual-scripting-functions/
---
# Visual Scripting Functions

Functions are reusable same-script graph scopes with typed inputs and outputs.
Use them to keep large graphs readable and to share behavior inside one script.

## Authoring

- Create functions in the Functions panel.
- Add Function Input and Function Output nodes inside the function graph.
- Call the function from handlers or other function scopes with a Function Call
  node.
- Keep function call graphs acyclic; recursive functions are rejected.

## Exporting

The export toggle makes a function callable from the external runtime SDK. Only
export functions that are intended as part of the script's public runtime
contract.

Internal function calls remain synchronous inside the generated TypeScript.
External calls are asynchronous because they travel through Runtime command
dispatch.

```ts
await runtime.invokeScriptFunction(gameId, roomId, entityId, scriptId, "heal", [25], {
  playerSessionId,
  clientSeq
});
```

Non-exported functions are not exposed through generated SDK function
accessors, and Runtime rejects direct command attempts to call them.
