Skip to content

Lua Entry Kinds

Configuration for Lua-based entries: functions, processes, workflows, and libraries.

KindDescription
function.luaStateless function, runs on demand
process.luaLong-running actor with state
workflow.luaDurable workflow (Temporal)
library.luaShared code imported by other entries
module.luaModule surface (multi-method library)

Each kind has a precompiled bytecode counterpart (function.lua.bc, library.lua.bc, process.lua.bc, workflow.lua.bc) produced by wippy pack --bytecode '**' (or a pattern like --bytecode 'app:**'). Authors write .lua entries; the bytecode kinds are emitted when packing with that flag.

All Lua entries share these fields:

FieldRequiredDescription
nameyesUnique name within namespace
kindyesOne of the Lua kinds above
sourceyesLua file path (file://path.lua)
methodfunction/process/workflowFunction to export (libraries don’t use it)
modulesnoAllowed modules for require()
importsnoOther entries as local modules
metanoSearchable metadata

Stateless function called on demand. Each invocation is independent.

- name: handler
kind: function.lua
source: file://handler.lua
method: main
modules:
- http
- json

Use for: HTTP handlers, data transformations, utilities.

Long-running actor that maintains state across messages. Communicates via message passing.

- name: worker
kind: process.lua
source: file://worker.lua
method: main
modules:
- process
- sql

Use for: Background workers, service daemons, stateful actors.

To run as a supervised service:

- name: worker_service
kind: process.service
process: app:worker
host: app:processes
lifecycle:
auto_start: true
restart:
max_attempts: 10

Durable workflow that survives restarts. State is persisted to Temporal.

- name: order_processor
kind: workflow.lua
source: file://order_workflow.lua
method: main
modules:
- workflow
- time

Use for: Multi-step business processes, long-running orchestrations.

Shared code that can be imported by other entries.

- name: helpers
kind: library.lua
source: file://helpers.lua
modules:
- json
- base64

Other entries reference it via imports:

- name: handler
kind: function.lua
source: file://handler.lua
method: main
imports:
helpers: app.lib:helpers

In Lua code:

local helpers = require("helpers")
helpers.format_date(timestamp)

The modules field controls which modules can be loaded with require():

modules:
- http
- json
- sql
- process

channel, print, subscribe, and unsubscribe are loaded as Lua globals — they don’t need to appear in modules:.

Only listed modules are available. This provides:

  • Security: Prevent access to system modules
  • Explicit dependencies: Clear what code needs
  • Determinism: Workflows only get deterministic modules

See Lua Runtime for available modules.

Import other entries as local modules:

imports:
utils: app.lib:utils # require("utils")
auth: app.auth:helpers # require("auth")

The key becomes the module name in Lua code. The value is the entry ID (namespace:name).

Configure execution pool for functions:

- name: handler
kind: function.lua
source: file://handler.lua
method: main
pool:
type: adaptive # explicit; omit to use auto-select (lazy)
max_size: 16 # cap for elastic growth
FieldPoolsDescription
typeallScheduler implementation (see table below)
workersstaticWorker thread count (falls back to size, then 8)
sizestaticWorker count when workers is unset; also steers auto-select toward a static pool
bufferstaticTask queue capacity (default: workers * 64)
max_sizelazy, adaptiveUpper bound for elastic growth (default: 16)
TypeBehavior
inlineSynchronous execution in caller’s goroutine. Lowest latency, no isolation between calls.
lazyZero idle workers, spawn on demand, tear down when idle.
staticFixed-size channel-based pool. Predictable under steady load.
adaptiveAuto-scaling pool — grows under load, shrinks when idle.

When type is omitted, the pool is auto-selected from the other fields: a lazy pool by default, a static pool if workers is set.

Use meta for routing and discovery:

- name: api_handler
kind: function.lua
meta:
type: handler
version: "2.0"
tags: [api, users]
source: file://api.lua
method: handle
modules:
- http
- json

Metadata is searchable via the registry:

local registry = require("registry")
local handlers = registry.find({["meta.type"] = "handler"})