Skip to main content

EventTaskInput

interface

Fields accepted by task for an event-triggered task.

interface EventTaskInput<TPayload>

Import

import { EventTaskInput } from '@modular/sdk';

Members7

id
string

Identifier, unique within the mod.

on
string

The host event that triggers this task.

onceoptional
boolean

Fire durably once per entity. For an event whose descriptor names an entity (session events key by session), "once" is per entity; otherwise it is once ever. Survives restarts.

run
TaskHandler<TPayload>
settleForoptional
string

Wait for this much quiet in the entity's lane before firing, delivering the most recent payload. A duration string: `'45s'`, `'30m'`, `'2h'`, `'1d'`.

titleoptional
string

Label shown where the host lists scheduled work.

whenoptional
(payload: TPayload) => boolean

Optional payload filter; a declined firing does not consume `once`.