Function Nodes

Natural language in. Running code out.

Describe what you want in plain English. The AI agent writes the computer code, deploys it to your private runtime, and runs it. No coding, no compiling, no deploying -- just a sentence and a result. Each one you keep becomes a named building block you can call again.

01   What it is

An agent prompt that quietly grows into a working tool.

A small invisible instruction teaches the AI agent, every turn, to turn a request like "compute the median of this list" or "fetch yesterday's invoices" into actual code, deploy it, run it, and show you the answer. You never see the scaffolding; you never see the deployment ceremony. What you see is a result.

[ 01 ]

Your own private runtime

An isolated machine that accepts code over the wire and runs it. Functions persist across calls, so the toolbox accumulates. Today's helper is callable from tomorrow's request.

[ 02 ]

The agent prompt writes the code

An invisible instruction tells the AI agent: when the user describes a function in English, write the code, deploy it, run it, render the result. The user types a sentence; the runtime gets a working function.

[ 03 ]

Authorized like every other call

Every compile, call, and audit query passes through the per-tool authorization map. The AI agent never holds the runtime's credentials and cannot bypass the gate.

[ 04 ]

Run once with the agent. Replay forever without it.

Multi-step requests become workflows -- a recorded chain of tool calls. The first run uses the agent and pays the LLM cost. Every replay is just the chain: sub-second, deterministic, no tokens spent, identical results.

[ 05 ]

The audit log is the truth

Every compile, every call, every approval lands in the per-instance audit log with the originating user. The agent prompt transcript is convenience; the audit log is evidence.

[ 06 ]

Reusable artefacts

The pipeline you described in an agent prompt at 11pm is named, durable, and re-runnable at 8am. The next workflow can extend it without recompiling, schedule it, or hand it off to another agent.

02   What it looks like

From sentence to running module.

[ 01 ] The round trip

You ask. The agent writes. The runtime answers.

The user types a function description in plain English. The AI agent picks a name for it, writes the code, pushes it to the runtime, calls it with sample inputs, and renders the results in a small table. The code itself stays hidden unless you ask to see it.

# user prompt
"median of [1, 2, 7, 9]"

# under the hood
→ function_node_compile(Adhoc.Median)
→ function_node_call(Adhoc.Median, :run, [...])
→ audit log

# what the user sees
| input | output |
| [1, 2, 7, 9] | {:ok, 4.5} |
| [3] | {:ok, 3} |
| [] | {:error, :empty} |
[ 02 ] Multi-step workflows

The agent prompt becomes a controller for a distributed system.

When intent decomposes into more than one call, the AI agent assembles a workflow. Each step is a named function-node call, an HTTP call, a guardrail, or a human approval. The workflow runs as a supervised process with durable state -- pause, approve, cancel, re-run, schedule.

Authoring is slow because the agent is in the loop. Replay is fast because it isn't. Every later run is a deterministic chain of tool calls -- no tokens, no re-deciding, identical results.

# user prompt
"fetch last 100 charges, dedupe by email,
 post the addresses to /tmp/uniq.txt"

# workflow_create
step 1: Adhoc.FetchCharges
step 2: Adhoc.DedupeByEmail
step 3: Adhoc.WriteFile (awaits_approval)
step 4: Adhoc.Summarise

workflow_id: "wf_84a2..."
status: "running, paused at step 3"
03   When it earns its keep

Three places this loop pays off immediately.

[ 01 ] AD-HOC ANALYSIS

One-off computations.

"Compute the median of these numbers, dedupe these rows, normalise these timestamps." A single sentence becomes a callable module you can re-invoke without re-prompting.

[ 02 ] REPEATING PIPELINES

Three-step jobs that keep coming back.

Pull, transform, post. Read, dedupe, summarise. The first run authors the workflow. Every later run is one call. Re-runnable, schedulable, auditable.

[ 03 ] PER-USER TOOLING

A toolbox that grows with you.

Modules persist on your runtime. Last week's helper is callable from this week's agent. The runtime accumulates the small functions you actually use.

04   Try it

From "I wish I had a function that..." to "you do, and here it ran."

Function Nodes ship with every AI Agent Gateway instance. Same per-tool authorization, same audit log, same self-hosted footprint -- now with a runtime that turns conversations into code.