Skip to content

js-bao-wss-client


js-bao-wss-client / CronTriggersAPI

Interface: CronTriggersAPI ​

Sub-API for cron triggers (client.cronTriggers.*). A cron trigger runs a workflow on a recurring schedule defined by a cron expression and timezone. Supports the full lifecycle: create, update, disable/enable, test-fire, and archive.

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).

Methods ​

create() ​

create<I>(params): Promise<CronTriggerInfo>

Create a new cron trigger. The trigger's scheduler is provisioned and the first fire is scheduled as part of this call.

Type Parameters ​

I ​

I = unknown

Parameters ​

params ​

CreateCronTriggerParams<I>

Returns ​

Promise<CronTriggerInfo>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


delete() ​

delete(triggerId): Promise<{ archived: boolean; }>

Soft-delete (archive) a cron trigger and cancel its next scheduled fire.

Parameters ​

triggerId ​

string

Returns ​

Promise<{ archived: boolean; }>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


disable() ​

disable(triggerId): Promise<CronTriggerInfo>

Take a trigger out of service. The next scheduled fire is cancelled and no further runs start until enable().

Parameters ​

triggerId ​

string

Returns ​

Promise<CronTriggerInfo>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


enable() ​

enable(triggerId): Promise<CronTriggerInfo>

Put a trigger back in service. Clears lastError and reschedules the next fire. Refuses an archived trigger — that is a delete, not a pause.

Parameters ​

triggerId ​

string

Returns ​

Promise<CronTriggerInfo>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


get() ​

get(triggerId): Promise<CronTriggerInfo>

Get a cron trigger by id, including live runtime state.

Parameters ​

triggerId ​

string

Returns ​

Promise<CronTriggerInfo>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


list() ​

list(): Promise<CronTriggerListResult>

List all cron triggers for the current app. Archived triggers are excluded.

Returns ​

Promise<CronTriggerListResult>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


test() ​

test(triggerId): Promise<{ error?: string; instanceId?: string; runId?: string; started: boolean; }>

Fire the associated workflow immediately without affecting the schedule.

Parameters ​

triggerId ​

string

Returns ​

Promise<{ error?: string; instanceId?: string; runId?: string; started: boolean; }>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).


update() ​

update<I>(triggerId, params): Promise<CronTriggerInfo>

Update one or more fields of an existing cron trigger. Schedule-relevant field changes (cron, timezone) take effect on the schedule immediately. Availability is not settable here — use disable() / enable().

Type Parameters ​

I ​

I = unknown

Parameters ​

triggerId ​

string

params ​

UpdateCronTriggerParams<I>

Returns ​

Promise<CronTriggerInfo>

Deprecated ​

Schedule a server function instead: declare [[function.triggers.cron]] in its config (see the Server Functions guide).

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30