Interface TriggerInterface

Base entity interface for all platform resources

All entities in the Mosaia platform extend this interface to provide consistent base properties across all resource types. This ensures that all entities have common fields for identification, status, and integration capabilities.

const entity: BaseEntity = {
id: 'entity-123',
active: true,
external_id: 'external-system-id',
extensors: {
custom_field: 'custom_value'
}
};
interface TriggerInterface {
    record_history?: RecordHistory;
    id?: string;
    org?: string | { id?: string; [key: string]: any };
    user?: string | { id?: string; [key: string]: any };
    name?: string;
    description?: string;
    type?: TriggerType;
    agent?: string | { id?: string; [key: string]: any };
    task?: string | { id?: string; [key: string]: any };
    plan?: string | { id?: string; [key: string]: any };
    log?: string | { id?: string; [key: string]: any };
    user_message?: string;
    status?: TriggerStatus;
    pause_on_completion?: boolean;
    last_triggered_at?: string | Date;
    next_trigger_at?: string | Date;
    trigger_count?: number;
    active?: boolean;
    config?: TriggerConfig;
    metadata?: Record<string, any>;
    keywords?: string[];
    tags?: string[];
    external_id?: string;
    extensors?: Record<string, any>;
}

Hierarchy (View Summary)

Properties

record_history?: RecordHistory

Record history tracking information

id?: string

Unique identifier for the entity

org?: string | { id?: string; [key: string]: any }

Organization reference (optional)

user?: string | { id?: string; [key: string]: any }

User reference (optional)

name?: string
description?: string
agent?: string | { id?: string; [key: string]: any }

Agent reference (optional)

task?: string | { id?: string; [key: string]: any }

Task reference (optional; exactly one of agent, task, plan required)

plan?: string | { id?: string; [key: string]: any }

Plan reference (optional)

log?: string | { id?: string; [key: string]: any }

AgentLog reference (optional)

user_message?: string
status?: TriggerStatus
pause_on_completion?: boolean

Auto-pause when task/plan completes (main indicator for whether cron runs again)

last_triggered_at?: string | Date
next_trigger_at?: string | Date
trigger_count?: number
active?: boolean

Whether the entity is active

config?: TriggerConfig

Type-specific config (e.g. CRON: cron_expression, timezone, run_once)

metadata?: Record<string, any>
keywords?: string[]
tags?: string[]
external_id?: string

External system identifier for integration with third-party systems

extensors?: Record<string, any>

Extended properties for custom integrations