Skip to main content
Was this helpful?

Trigger Reference

All valid triggerType values available when building automation rules in PrimeCal.

Trigger Types​

Enum ValueWire StringDescriptiontriggerConfig Required
EVENT_CREATEDevent.createdFires when a new event is created in any of the user's calendars.None
EVENT_UPDATEDevent.updatedFires when an existing event is modified.None
EVENT_DELETEDevent.deletedFires when an event is deleted.None
EVENT_STARTS_INevent.starts_inFires X minutes before an event starts.{ minutesBefore: number }
EVENT_ENDS_INevent.ends_inFires X minutes before an event ends.{ minutesBefore: number }
RELATIVE_TIME_TO_EVENTrelative_time_to_eventFires at a time relative to event start or end (positive or negative offset).{ offsetMinutes: number, anchor: 'start' | 'end' }
CALENDAR_IMPORTEDcalendar.importedFires when an external calendar sync import completes.None
SCHEDULED_TIMEscheduled.timeFires on a cron schedule, independent of any specific event.{ cronExpression: string }
WEBHOOK_INCOMINGwebhook.incomingFires when a POST request is received at the rule's unique webhook URL.None
TASK_STATUS_CHANGEDtask.status_changedFires when a task's status field changes (e.g. todo → done). Not yet selectable from the rule builder UI — create rules using it via the Automation API.None
TASK_SCHEDULED_STARTtask.scheduled_startFires when a task reaches its scheduled start time, including tasks instantiated from a routine template. Also API-only for now.None
NOTIFICATION_DISPATCHEDnotification.dispatchedFires whenever a notification is dispatched to the rule owner, across any channel — e.g. an event.reminder push notification, a reservation.due alert, or another rule's send_notification action.None
EVENT_RESCHEDULEDevent.rescheduledFires when smart reschedule has actually moved an event — once per moved event, after the move was written. Runs the rules of the owner of the calendar the event is on, like event.created / event.updated / event.deleted. Never fires for an undo or for a plan that was rejected.None

Notes​

  • event.starts_in / event.ends_in: The scheduler polls at a 1-minute resolution. minutesBefore values below 1 are unreliable.

  • scheduled.time: cronExpression must be a valid 5-field cron expression (minute hour day month weekday). The scheduler evaluates eligible cron expressions every minute.

  • webhook.incoming: Each rule with this trigger type is assigned a unique webhookToken (64-char hex). Token is accessible in the rule detail view and can be regenerated via POST /api/automation/rules/:id/webhook/regenerate.

  • relative_time_to_event: Introduced for finer-grained time offsets not covered by event.starts_in/event.ends_in. Uses offsetMinutes (negative = before, positive = after).

  • task.status_changed / task.scheduled_start: Backend-recognized trigger types not yet exposed in the rule builder's trigger picker. task.scheduled_start is what drives the "routine task fires a smart-home REST call at its scheduled time" pattern — see Smart-Home Automation.

  • notification.dispatched: The reverse direction of the send_notification action — instead of a rule sending a notification, a rule can react to one being sent (by any source: the reminder scheduler, another automation rule, a reservation alert, etc.). Use notification.type and notification.channel condition fields (see Condition Reference) to narrow which notifications a rule reacts to. This lets a notification orchestrate an external system rather than only alerting the user — for example, a 5-minute event.reminder in-app notification can trigger a webhook action that activates a smart-home "meeting mode" scene:

    {
    "triggerType": "notification.dispatched",
    "conditionLogic": "AND",
    "conditions": [
    { "field": "notification.type", "operator": "equals", "value": "event.reminder" },
    { "field": "notification.channel", "operator": "contains", "value": "inapp" },
    { "field": "notification.data.minutesBefore", "operator": "equals", "value": "5" }
    ],
    "actions": [
    { "type": "webhook", "config": { "url": "https://smarthome.local/api/scene/meeting-mode" } }
    ]
    }

    Because this trigger fires from the shared DomainEventBus rather than a direct service call, it works for any notification eventType in the catalog (see Notifications API) — not just event reminders.

  • event.rescheduled: Fires after smart reschedule has moved an event (someone confirmed a plan and the new time was saved). It fires once per event that was actually moved: if a plan moves three events and the third write fails, rules fire for the two that landed. It does not fire when a person presses Undo — putting an event back is not a new reschedule, and a rule reacting to it would fight them — and it does not fire when a plan is refused. Rules run for the owner of the calendar the event is on, exactly as for event.created, event.updated and event.deleted: not for whoever confirmed the plan, and not for whoever created the event. If you displace a flexible event on a colleague's calendar, the colleague's event.rescheduled rules react, and yours do not; on a shared calendar the calendar owner's rules run even when someone else created the event. If the event or its calendar can no longer be found, nothing runs. Conditions are evaluated against the moved event as it is now (its new start and end), and several rules run one after another so they cannot race on the same event; a failing rule does not stop the others. The event condition fields and event smart values are the same ones event.updated offers (see the Condition Reference).

    The announcement the rules are fired from carries these fields (ISO-8601 UTC timestamps). They describe the move for the server and are logged by event id only; they are not condition fields:

    FieldMeaning
    eventIdThe event that was moved.
    ownerIdThe moved event's creator (createdById), read from the database row (never from the client). Informational: it does not choose which rules run — the calendar owner's do.
    actorIdThe user who applied the plan. May differ from ownerId.
    fromUtcThe start time the event had before the move.
    toUtcThe start time the event has after the move.
    causedByEventIdThe event whose placement displaced this one, or null when the plan did not carry it. Reserved: currently always null.
    strategyThe reschedule strategy that produced the plan, or null when the plan did not carry it. Reserved: currently always null.
    depthLoop guard. 1 for a reschedule a person applied; higher for a reschedule caused by a reschedule. The planner returns nothing to do for any request made with depth above 0, so rules cannot ping-pong two flexible events forever.

    event.rescheduled also pairs with the set_reschedulable action, which decides which events are eligible to be moved in the first place. Note that writing the new time also fires event.updated rules for the event, as any edit does.

Plan Requirement​

Automation endpoints require a PrimeCal plan that includes the automation feature. See Plans and Pricing for plan details.