Skip to main content

FunctionTimerInput

A declarative one-shot timer the function arms TRANSACTIONALLY with its property mutations: "invoke this function again in N ms". The timer survives replica restarts and is claimed by the same dispatcher that runs scheduled automations, so it fires exactly once. Rolling back the invocation arms nothing. The target function must be autonomousInvocable, because a timer fires headlessly with no player in the request.

input FunctionTimerInput {
functionName: String!
target: String
delayMsExpression: String!
dedupeKeyExpression: String
params: [TimerParamInput!]
}

Fields

FunctionTimerInput.functionName ● String! non-null scalar

The function to invoke when the timer fires. Must exist and be autonomousInvocable.

FunctionTimerInput.target ● String scalar

Container reference the delayed invocation runs against, e.g. "self" (default) or "$target_id".

FunctionTimerInput.delayMsExpression ● String! non-null scalar

Expression resolving the delay in milliseconds (int > 0), floored by the app's minTimerDelayMs policy.

FunctionTimerInput.dedupeKeyExpression ● String scalar

Optional expression resolving an app-scoped string key. Re-arming the same key replaces the pending timer instead of queueing another fire, so a repeatedly invoked function cannot flood the timer queue.

FunctionTimerInput.params ● [TimerParamInput!] list input

Parameters bound into the delayed invocation. Expressions are evaluated at arm time on post-mutation state, so the fired invocation sees the values the arming logic decided.

Member Of

SeedFunctionInput input ● UpsertFunctionInput input