Skip to main content

UpsertComputeTriggerInput

Bind a trigger to a module: a tick loop (tick_hz), a model/compute event subscription, or a client-invokable export.

input UpsertComputeTriggerInput {
appId: BigInt!
moduleName: String!
triggerType: String!
tickHz: Float
onEvent: String
functionName: String
containerTypeName: String
propertyKey: String
eventName: String
debounceMs: Int
exportName: String
invokePolicyJson: String
contractJson: String
}

Fields

UpsertComputeTriggerInput.appId ● BigInt! non-null scalar

The app (tenant).

UpsertComputeTriggerInput.moduleName ● String! non-null scalar

The module (by name) this trigger drives.

UpsertComputeTriggerInput.triggerType ● String! non-null scalar

Trigger type: tick | event | invoke.

UpsertComputeTriggerInput.tickHz ● Float scalar

For tick triggers: the tick rate in Hz (clamped by the app policy's maxTickHz).

UpsertComputeTriggerInput.onEvent ● String scalar

For event triggers: function_invoked | property_changed | container_created | compute_event | player_left | player_joined. player_left (v1.87.0) is delivered to on_event as JSON with event, actor_uuid, user_id, chunk_x/y/z, last_seen_at, left_reason and remaining_player_count, once per actor that stops being present, the last one included. player_joined (v1.93.0) is delivered with actor_uuid, user_id, chunk_x/y/z, first_seen_at and current_player_count, once per roster INSERT (ON CONFLICT no-op is not a join). A Redis flush can emit leave then join on later ticks.

UpsertComputeTriggerInput.functionName ● String scalar

Event filter: only this model function name.

UpsertComputeTriggerInput.containerTypeName ● String scalar

Event filter: only this container type.

UpsertComputeTriggerInput.propertyKey ● String scalar

Event filter: only this property key.

UpsertComputeTriggerInput.eventName ● String scalar

Event filter: only compute events with this name (on_event=compute_event).

UpsertComputeTriggerInput.debounceMs ● Int scalar

Debounce/coalesce window in ms for event triggers.

UpsertComputeTriggerInput.exportName ● String scalar

For invoke triggers: the exported guest function name computeInvoke routes to.

UpsertComputeTriggerInput.invokePolicyJson ● String scalar

For invoke triggers: JSON authority tree gating who may invoke (same shape as game-model function invoke policies). Null = app admins only.

UpsertComputeTriggerInput.contractJson ● String scalar

For invoke triggers: optional typed contract (JSON): {"params": {name: {type, required?, description?}}, "result": {...}, "description"?}. Types: int|float|string|bool|object|array. Declared params are validated on computeInvoke BEFORE the sandbox runs (required presence + type; undeclared params pass through); result is documentation/codegen only. Null = no validation.

Member Of

computeUpsertTrigger mutation