Data Model & Events
Section titled “Data Model & Events”To integrate effectively you need a mental model of how OSOS stores data and how its services talk to one another. This guide describes the developer-facing data model and the message-bus vocabulary that integrators observe and react to — enough to design against, and detailed enough to serve as a reference when you write triggers/reactions, custom functions, or external integrations (webhooks/Zapier) that respond to activity inside a tenant.
The vocabulary here is the platform’s shared contract — the single definition every backend service imports, where events, commands, socket messages and the domain models are all declared. Match on the wire identifiers shown below, never on class names.
The core model
Section titled “The core model”Almost everything in OSOS is a data entry with a dynamic value payload, described by a data entity (its schema). A few consistent ideas run through the whole model:
- Entities and entries. A data entity defines a schema — its fields, validation, workflows, and triggers. A data entry is a single record of that entity, holding its field values plus state and history.
- References. Records link to one another through a universal reference pointer of the form
{ dataEntity, dataEntry }. Wherever one record points at another, this is the shape you will see. - Localized text. Human-facing names and text are localized strings carrying both Arabic and English (
{ ar, en }). Send and expect this shape for names and labels.
The main building blocks
Section titled “The main building blocks”| Concept | Role |
|---|---|
| Data entity | Schema definition: fields, validation, state (Draft / Active / Archived), workflows, triggers |
| Data entry | A record of an entity, with its value payload, state, and history |
| Data module | Groups entities (drives the sidebar) |
| Data view | A per-entity presentation (table, kanban, calendar, timeline, and more) |
| Data query / statistic query | Saved filters and aggregations |
| Workflow | A process definition (steps, ownership, SLA) attached to an entity |
| Reaction | An automation rule (event + condition + actions) |
| Function | User-authored serverless code |
| Access right | A permission, expressing a level (None / View / Edit / Admin) over a target |
| Delegation | An “act as” grant with a time window |
Identity objects — users, groups, organization units, roles, and assignments — are themselves modeled as data entities, so the same concepts apply when you read or write them.
Field types
Section titled “Field types”A field’s type comes from a fixed set: Text, Number, Date, Time, DateTime, Boolean, Blob, Entity (a reference to another record), Icon, Block (a sub-table), localized JSON, GeoJSON, and JSON. A field’s value can be entered manually, defaulted, sourced dynamically, computed from an expression, or resolved through a pointer — with recalculation timed to form open, save, or field change. The computed options connect to the expression engine described in the Functions & Integrations guide.
The reference shape
Section titled “The reference shape”Cross-record references everywhere in OSOS use a two-part pointer, not a bare id:
export interface ReferenceProperty { dataEntity: Id; // which entity/collection the target lives in dataEntry: UUID; // which record within it}A ReferenceProperty identifies both what kind of thing is referenced and which instance. When a field value in an entry is a reference, its value is this shape.
Data entity (the schema)
Section titled “Data entity (the schema)”A DataEntity is a record-type definition — the closest analogue to a table/collection schema. Key fields an integrator reads:
| Field | Type | Notes |
|---|---|---|
id | UUID | string | Entity id. |
normalizedName | string | Stable machine name; use this to identify an entity in code rather than the localized name. |
name / description | LocalizedString | Human labels, per-language. |
type | DataEntityTypeEnum | Entity category (see enum below). Custom = 0 is a normal builder-defined entity. |
version | number | Schema version, bumped on breaking field changes. Entries record the entityVersion they were saved against. |
module | UUID | The module the entity belongs to. |
fields | DataEntityField[] | The field definitions. |
workflows | DataEntityWorkflow[] | Workflow definitions attached to the entity. |
state | DataEntityStateEnum | Active = 0, Archived = 1. |
isImplicit | boolean | System-owned entities (see enum values Core, System, Space, …). |
virtual | VirtualEntityOptions? | Present for computed/aggregator entities (no physical rows). |
A DataEntityField declares one field: normalizedName, dataType (DataTypeEnum), renderOptions, validations, and the optional virtualField, mapping, sources, sensitiveAccess, and valueValidators. When you react to a field-level change you match on the field’s normalizedName / fullNormalizedName.
Data entry (the record)
Section titled “Data entry (the record)”A DataEntry<T> is a single record of an entity. This is the object most events hand you:
| Field | Type | Notes |
|---|---|---|
id | UUID | Entry id. |
dataEntity | UUID | The entity this entry belongs to. |
value | T extends DataEntryValue | The field values, keyed by field normalizedName. Reference-typed fields hold ReferenceProperty values. |
state | DataEntryStateEnum | Draft = 0, Active = 1, Archived = 2. |
stateHistory | DataEntryStateHistoryRecord[] | Audit of state transitions. |
lifeCycleStatus | LifeCycleStatusEnum? | Workflow lifecycle: Failed = -1, Active = 0, Completed = 1; undefined = not in a workflow. |
entryType | EntryTypeEnum? | Normal = 0, Virtual = 1. |
virtual | boolean? | true for calculated entries that don’t physically exist (aggregator/virtual entity output). |
basedOn | ReferenceProperty[]? | For virtual entries, the source records the calculation derived from. |
entityVersion | number | The entity schema version this entry was saved against. |
store | ReferenceProperty | The store/partition the entry lives in. |
isImplicit | boolean | System-owned entry that cannot be modified or archived. |
isInvalid / invalidReason | boolean / DataEntryInvalidReasonEnum | null | Set when a schema change invalidated the entry: Obsolete = 0, Invalid = 1. |
creationInfo / updateInfo | ActionInfo | Who/when created/updated. |
The value object also carries workflow meta under reserved keys: _metaCurrentSteps, _metaWorkflowHistory, _metaAdhocSteps, _metaOrder. Treat any _meta* key as system-managed.
Note on statuses:
lifeCycleStatus(undefined/Active/Completed/Failed) is the workflow-lifecycle tracking value that rides on the entry. It is distinct from the human-facing UI statuses shown for request-style entities (for example Draft / Open / Completed / OnHold with a result of Succeeded / Failed / Rejected / Timedout / Cancelled / Obsolete). When you automate against a request, readlifeCycleStatusfor the tracking state and the entity’s own status field for the UI state.
Reactions, triggers, and event configs
Section titled “Reactions, triggers, and event configs”A reaction (aka trigger) is the builder-facing object that says “when this event happens matching this criteria, run these actions.” It is modeled by DataReaction:
| Field | Type | Notes |
|---|---|---|
eventType | EventTypeEnum | Which event this reaction listens to. |
eventConfig | DataReactionEventConfig | Event-type-specific matching config (see below). |
executorType | { id: EventExecutorTypeEnum }? | Whose identity actions run as: SYSTEM, MANAGER, EXECUTOR. |
criteria | FilterExpression? | Value-based filter on the affected entry. |
query | ReferenceProperty? | A saved query that overrides criteria when set. |
actions | DataReactionAction[] | The ordered actions to run. |
spaceScope | DataReactionSpaceScope | { rootSpace, currentSpace, otherSpaces } — which spaces the reaction fires in. |
type | DataReactionTriggerTypeEnum? | NormalTrigger = 0, SLATrigger = 1. |
sourceEntity | DataReactionSourceEntity? | Self, Relation, or AbsoluteEntity — the entity whose events fire this. |
loopThreshold | number? | Guard against runaway reaction chains. |
disabled | boolean? | Reaction paused. |
relatedEntities | DataReactionRelatedEntities[]? | Related entities whose changes also count. |
Event configuration
Section titled “Event configuration”DataReactionEventConfig is a discriminated union keyed by event type. The ones an integrator most often configures:
DataEntryCreatedEventConfig— fires on create.DataEntryUpdatedEventConfig—fields[](match specificfullNormalizedNames; empty = any field) andrelatedFields[]for changes reached through references.DataEntryArchivedEventConfig— fires on archive.CustomEventConfig— a custom action (the builder’s Custom Action trigger): a requiredcustomActionType(UI,ExternalorLocal—CustomActionTypeEnum; it replaced the retireduiEventflagSince 1.8), acontextualflag (defaulttrue, no runtime behaviour yet), an optionalaskUserdialog config (inline entity or an external entity and view), and start/successmessages.WorkflowStepReachedEventConfig/WorkflowStepExitedEventConfig/WorkflowActionExecutedEventConfig— scoped bysteps[](workflowId+stepId, wherestepIdmay be the literal'ADHOC_STEP') and, for exit/action configs, matchedactions[].SLATimeExceededEventConfig—occurrencesConfig(startingAfterandrepeatAfterin seconds,repetitionsa count) plus step scoping.TimerEventConfig—timerOptionswith aoneTimetimestamp or arepeatcronexpression(+ timezone / start / end).ReactionSucceededEventConfig/ReactionFailedEventConfig— chain off another reaction byentityId+triggerId.FileGeneratedEventConfig— matched bytemplate.EventAnnouncedEventConfig—entityId+announcementIdof an announced event.
Every config extends BaseEventConfig, which carries relatedInfo (relatedEntity + relatedFieldPath, null for the reaction’s own entity) and triggerContextId. Since 1.8, triggerContextId lives on the event config (it owns the context entity), having moved up from individual action options.
Actions
Section titled “Actions”DataReactionAction has an actionType (AutomatedActionTypeEnum) and a typed options union (DataReactionActionOptions). Actions are what a reaction executes; the actionType enum is the catalog of things the platform can do automatically — create/update/archive entities and entries, move workflow steps, send email/SMS/notifications/push, call an external API, run a custom function, announce an event, notify Zapier, and more. See the enum table below.
The message bus
Section titled “The message bus”Internally OSOS runs on an internal message bus (@node-ts/bus) using a command/event pattern:
- Commands are imperatives — “do this.” Examples include creating, updating, patching, archiving, restoring, or bulk-updating entries; executing a workflow action or changing a workflow step; scheduling a job; or notifying an external integration.
- Events are facts — “this happened.” Examples include an entry being created, updated, deleted, archived, or restored; a workflow step being reached or exited; an access right changing; an API token being generated; a background job finishing; or a scheduled job firing.
You do not need the bus to use OSOS, but the vocabulary is worth knowing because it shapes the surfaces you do touch: reactions subscribe to domain events and issue commands as their actions (the no-code automation surface), and real-time updates are OSOS re-publishing selected domain events to your client over Socket.IO.
Message taxonomy
Section titled “Message taxonomy”Three message families are exported from @osos/shared/messages:
| Family | Base class | Direction / semantics | Where declared |
|---|---|---|---|
| Events | Event (@node-ts/bus-messages) | “Something happened” — published after a fact, fan-out to any number of subscribers. This is the primary vocabulary an integrator reacts to. | messages/events |
| Commands | Command | “Do this” — an instruction addressed to the service that owns the action, handled by exactly one handler. | messages/commands |
| Socket messages | BaseSocketMessage | Envelopes relayed to connected UI clients over the realtime socket (e.g. job/command completion, UI custom events). | messages/socket-messages |
Every event and command carries a stable string identity and a schema version:
export class DataEntryCreatedEvent extends Event { static readonly NAME = 'osos/data-entry/data-entry-created'; readonly $name = DataEntryCreatedEvent.NAME; readonly $version = 1; constructor( readonly dataEntry: DataEntry, readonly userId: string, readonly normalizedEntity: { normalizedName: string; name: LocalizedString; type: DataEntityTypeEnum; moduleId: string }, readonly valueDiff?: UpdateAdditionalData[], readonly isSystemModification?: boolean, ) { super(); }}$nameis the wire name (namespacedosos/<domain>/<event>). Match on this string, never on the class name.$versionis the payload schema version. At the time of writing every event and command is$version = 1.- The constructor parameters are the payload. All fields are
readonly.
Note: the
$namestring and the class filename are not always identical, and a few names contain historical typos frozen for wire compatibility (osos/scheduler/scheduled-job-triggerd,osos/reaction/event-announced). Always copy the exactNAMEconstant from the source.
Message attributes (envelope metadata)
Section titled “Message attributes (envelope metadata)”Payload aside, each dispatched message carries an attribute envelope. Two shapes are defined in @osos/shared.
BaseMessageAttributes:
| Field | Type | Meaning |
|---|---|---|
messageId | string | Unique id of this message instance. |
instanceId | string? | Correlates a dispatched job/command with its completion message. |
BaseStickyAttributes — sticky attributes propagate along a causation chain (they ride from a triggering message onto every message it causes):
| Field | Type | Meaning |
|---|---|---|
userId | string? | The acting user, carried across the whole reaction chain. |
spaceId | string? | The space (tenant sub-scope) the activity happened in. |
A handler receives both the payload and the attributes:
async handle( event: AccessRightChangedEvent, messageAttributes: MessageAttributes<BaseMessageAttributes>,): Promise<void> { /* ... */ }Many events also carry a
userIdin their own payload (e.g.DataEntryCreatedEvent.userId). The code marks this as gradually being superseded bystickyAttributes.userId. For now, prefer the payloaduserIdwhere present and fall back to the sticky attribute.
Core enumerations
Section titled “Core enumerations”These integer/string enums appear throughout event payloads and models. Numeric values are the wire values — do not assume ordering, copy them exactly.
EventTypeEnum — reaction trigger types
Section titled “EventTypeEnum — reaction trigger types”| Name | Value |
|---|---|
DataEntryCreated | 0 |
DataEntryUpdated | 1 |
DataEntryArchived | 2 |
WorkflowActionExecuted | 3 |
WorkflowStepReached | 4 |
WorkflowStepExited | 5 |
Timer | 6 |
CustomEvent | 7 |
ReactionSucceeded | 8 |
FileGenerated | 9 |
ReactionFailed | 10 |
EventAnnounced | 11 |
DataEntryRestored | 12 |
ZapierEvent | 20 |
SlaTimeExceeded | 100 |
AutomatedActionTypeEnum — reaction action types
Section titled “AutomatedActionTypeEnum — reaction action types”| Name | Value | Name | Value |
|---|---|---|---|
CreateDataEntity | 0 | MoveWorkflowToStep | 20 |
UpdateDataEntity | 1 | ExecuteWorkflowAction | 21 |
ArchiveDataEntity | 2 | ChangeCurrentStepOwner | 22 |
CreateDataEntry | 10 | UserActivationToggle | 30 |
UpdateDataEntry | 11 | SetPermission Since 1.10 | 31 |
ArchiveDataEntry | 12 | RemovePermission Since 1.10 | 32 |
CreateBlockItem | 13 | CallApi | 90 |
UpdateBlockItem | 14 | SendNotification | 100 |
DeleteBlockItem | 15 | SendEmail | 101 |
DeleteArchivedEntry | 16 | SendSms | 102 |
GenerateFileFromTemplate | 103 | ||
ExecuteCustomFunction | 104 | ||
AnnounceEvent | 105 | ||
ExecuteCustomAction Since 1.8 | 106 | ||
SendWhatsApp Since 1.10 | 107 | ||
NotifyZapier | 200 |
CreateDataEntity (0) and UpdateDataEntity (1) stay declared, but Since 1.10 a reaction carrying either is refused on save and a stored one is skipped at run time — see Action types.
SendWhatsApp (107) Since 1.10 carries SendWhatsAppActionOptions: recipients (resolved like the Send SMS recipients), templateName (an approved Meta template), language (the template language code, e.g. en or ar) and parameters (TokenSource[]; index i fills {{i+1}}, may be empty). How the action behaves when it runs is on Reactions & Automation; the list of approved templates comes from the WhatsApp template API.
Other frequently-seen enums
Section titled “Other frequently-seen enums”| Enum | Values |
|---|---|
DataEntryStateEnum | Draft = 0, Active = 1, Archived = 2 |
DataEntityStateEnum | Active = 0, Archived = 1 |
EntryTypeEnum | Normal = 0, Virtual = 1 |
LifeCycleStatusEnum | Failed = -1, Active = 0, Completed = 1 (plus undefined = not in a workflow) |
DataEntryInvalidReasonEnum | Obsolete = 0, Invalid = 1 |
EventExecutorTypeEnum | SYSTEM, MANAGER, EXECUTOR |
DataReactionTriggerTypeEnum | NormalTrigger = 0, SLATrigger = 1 |
TriggerSourceEntityTypeEnum | Self = 0, Relation = 1, AbsoluteEntity = 2 |
FunctionTypeEnum | REACTION_CUSTOM_ACTION, INTERCEPTOR, STANDALONE_VALIDATOR, VALUE_VALIDATOR |
FunctionStatusEnum | BUILD_FAILED, PROVISIONING, PROVISIONED, DELETED |
DataEntityTypeEnum is large; the values integrators most often encounter are Custom = 0, Service = 2, Request = 3, Notification = 7, Task = 8, User = 9, Group = 10, and the system band (Core = 30, System = 40, VirtualProxy = 50, VirtualAggregator = 52, Space = 60).
Event catalog
Section titled “Event catalog”The full published event vocabulary, grouped by domain. The payload column lists the constructor parameters (the wire payload). ? marks optional fields.
Data entities (schema lifecycle)
Section titled “Data entities (schema lifecycle)”Event ($name) | Payload |
|---|---|
osos/data-entity/data-entity-created | dataEntity: DataEntity, userId |
osos/data-entity/data-entity-updated | dataEntity, userId, requiresReIndex?, workflowStatus?, entityChanges?[], isSystemModification?, rawDiff? |
osos/data-entity/data-entity-archived | dataEntity, userId |
osos/data-entity/data-entity-version-changed | dataEntity, oldVersion, newVersion, userId |
osos/data-entity/data-entity-deleted Since 1.10 | dataEntity (read before the purge), owned: DeletedEntityOwnedIds, moduleNormalizedName, userId — see below |
osos/data-entity-field-meta/data-entity-updated | dataEntity, changedMeta (mainTitle/mainPicture), userId |
DataEntityUpdatedEvent.entityChanges[] reports structural field changes via the EntityChanges enum: FIELD_DELETED, FIELD_ADDED, FIELD_REQUIRED_VALIDATION_CHANGED, FIELD_RENDER_OPTIONS_CHANGED, FIELD_INTERNAL_COLLECTION_CHANGED, VIRTUAL_ENTITY_OPTIONS_CHANGED, TREE_STRUCTURE_DELETED. rawDiff is the complete diff from the just-diff library.
DataEntityDeletedEvent — permanent entity delete Since 1.10
Section titled “DataEntityDeletedEvent — permanent entity delete Since 1.10”Published at the end of an administrator’s permanent entity purge (DELETE /v1/entities/{id}/permanent), just before the entity document itself is deleted. owned lists the ids of what was removed with the entity, by kind: views, queries, collections, statistic queries, relations, aggregates, quick-filter groups, tag groups, reports, system buttons, counter widgets, dashboards, pages and functions. Reactions and announcements are not listed — their services find them by the entity id.
- Consumers must be idempotent. A retried purge can publish the event again.
- No archive event is published by the purge, so the entity’s archive reactions never fire for it.
- The audit service records it as
DATA_ENTITY_DELETED.
Data entries (record lifecycle)
Section titled “Data entries (record lifecycle)”Event ($name) | Payload |
|---|---|
osos/data-entry/data-entry-created | dataEntry: DataEntry, userId, normalizedEntity, valueDiff?, isSystemModification? |
osos/data-entry/data-entry-updated | dataEntry, userId, normalizedEntity, metaDataChanges, valueChanges?[], valueDiff?, isSystemModification?, refreshedEntities? |
osos/data-entry/data-entry-deleted | dataEntry |
osos/data-entry/data-entry-archived | dataEntry, userId |
osos/data-entry/data-entry-restored | dataEntry, userId |
osos/data-entry/data-entry-invalidated | dataEntry, userId, normalizedEntity |
osos/data-entry/data-entry-permanently-deleted | dataEntry, userId, stateBefore, entryNameBefore |
osos/data-entry/data-entries-archived | `dataEntries: Pick<DataEntry,‘id’ |
osos/data-entry/data-entries-permanently-deleted | items: PermanentlyDeletedEntrySnapshot[], userId |
osos/data-entry/draft-data-entry-upserted | dataEntry, userId, rawDiff |
osos/data-entry/draft-data-entry-deleted | dataEntityId, draftDataEntryId, userId |
DataEntryUpdatedEvent.valueChanges[] (IValueChangesEntryUpdated) is the field-level change set: each item has fullNormalizedName, optional fieldId, an optional mapConfig (mapped-field source/reference/updateMode), and isTreeStructureField?. This is what a DataEntryUpdated reaction’s fields[] config is matched against. refreshedEntities is an internal de-duplication list used by the aggregator refresh handler to avoid re-refreshing an entity already refreshed inline. Since 1.6, DataEntryInvalidatedEvent announces entries invalidated by a schema change. DataEntryRestoredEvent and the permanently-deleted family are Since 1.8.
A write whose entry is deleted before its re-read publishes nothing Since dev. After a create, update, patch or upgrade, data-service re-reads the entry to put the resolved version on DataEntryCreatedEvent / DataEntryUpdatedEvent. When a concurrent delete won that race, the event used to go out with dataEntry undefined, and every consumer failed on it and was retried. Now the write is reported as a non-retryable failure and no created/updated event is published; the deletion has its own DataEntryDeletedEvent. The payload contract is unchanged (dataEntry is always present on an event that is published), but a write can now end without any event, so do not wait for an updated event on an entry that may have been deleted. audit-service also skips, with a warning, an updated event that arrives without dataEntry (from an older publisher or a replayed message).
Collections, relations, views, queries, and modules
Section titled “Collections, relations, views, queries, and modules”Event ($name) | Payload |
|---|---|
osos/data-collections/data-collection-created / -updated / -archived | dataCollection: DataCollections, userId (-updated adds rawDiff?) |
osos/data-relation/data-relation-created / -updated / -deleted | dataRelation: IDataRelation, userId (-updated adds rawDiff?) |
osos/data-view/data-view-created / -updated / -deleted | dataView: IDataViews, userId, plus permissions?, changedStatus? (published/pinned), isSystemModification?, rawDiff? on -updated |
osos/data-query/data-query-created / -updated / -deleted | dataQuery: DataQuery (-updated adds criteriaChanged: boolean, rawDiff?) |
osos/data-module/data-module-created / -updated / -deleted | dataModule: DataModule, userId (-updated adds changes?: Record<string,{oldValue,newValue}>) |
osos/generic-view/generic-view-created / -updated / -deleted | genericView: IGenericView, userId, permissions?, changedStatus?, defaultPageForSpaces?, rawDiff? |
osos/statistic-query/statistic-query-created / -updated / -deleted | statisticQuery: IStatisticQuery |
osos/report/report-deleted | reportId, userId |
Reports are a web-only surface; they are not available in the mobile app, so any report deep-link surfaced to a mobile client is treated as unsupported.
Reactions, triggers, and custom events
Section titled “Reactions, triggers, and custom events”Event ($name) | Payload |
|---|---|
osos/reaction/reaction-created / -deleted | dataReaction: DataReaction, userId |
osos/reaction/reaction-updated | dataReaction, previousDataReaction, userId, rawDiff? |
osos/reaction/announcement-created / -deleted | announcement: Announcement, userId |
osos/reaction/announcement-updated | announcement, previousAnnouncement, userId |
osos/reaction/event-announced | dataEntityId, announcementId, dataEntry, userId, announcementEntry? |
osos/triggers/custom-event-triggered | dataEntityId, dataEntries: ReferenceProperty[], userId, triggerId, timestamp, askUserValue?, askUserDataEntry? |
osos/triggers/trigger-executed | dataEntityId, triggerId, triggerHistoryId |
osos/triggers/email-generated | subject, body, to, cc, bcc, link?, attachments?, relatedTriggerExecutionId?, eventType?, dataEntry?, from? |
osos/triggers/sms-generated | body, recipients, link?, relatedTriggerExecutionId? |
osos/triggers/whatsapp-generated Since 1.10 | recipients: string[], template: {name, language, category: 'authentication' | 'other'}, parameters: string[] (for authentication: [code]), relatedTriggerExecutionId? |
Note the class name EmailGeneratedEvent maps to $name osos/triggers/email-generated, and SMSGeneratedEvent to osos/triggers/sms-generated.
WhatsApp messages Since 1.10. WhatsAppGeneratedEvent (osos/triggers/whatsapp-generated) asks notification-service to send one approved WhatsApp template. Two services publish it: reaction-service, for the Send WhatsApp action, and users-service, for WhatsApp one-time codes during multi-factor sign-in. notification-service answers with one osos/events/whatsapp-send-status per recipient, which logging-service records. That publish is best effort — a failed publish is logged and never retried, because a redelivery would message every recipient again. Meta’s later delivery callbacks reach logging-service through its public webhook (WhatsApp API); they update the same log row by provider message id and are not republished on the bus.
Reaction-history storage Since 1.10. The TriggerHistory row that trigger-executed points at (one per reaction run) is now indexed for the Reaction Logs filters, its result is optional with default [] (a run that recorded no action), and the entry-history row an entry-created / entry-updated message writes is unique per source message, so a redelivered message writes it once. Details: Reaction history indexes and clean-up.
Workflow
Section titled “Workflow”Event ($name) | Payload |
|---|---|
osos/workflow/step-reached | dataEntry, workflowId, stepId, userId, isAdhoc? |
osos/workflow/step-exited | dataEntry, workflowId, stepId, userId, action?, isAdhoc? |
osos/workflow/action-executed | dataEntry, workflowId, stepId, action, userId, isAdhoc? |
osos/workflow/ended | dataEntry, workflowId, userId |
osos/workflow/workflow-step-owner-changed | dataEntry, userId, changes: ReassignOwnerChanges, doneAt, additionalData? |
osos/workflow/adhoc-step-created | dataEntry, adhocStep: WorkflowStep, userId |
osos/sla/time-exceeded | dataEntry, workflowId, stepId, userId, isAdhoc, receivedDate, dueDate, workingHours, holidays? |
Integrations, functions, files, jobs, and messaging
Section titled “Integrations, functions, files, jobs, and messaging”Event ($name) | Payload |
|---|---|
osos/events/zapier-event-triggered | entityId, zapId, eventType, eventOutput |
osos/functions/function-provisioning-status-update | functionModel: FunctionModel, status: FunctionStatusEnum, details: { url } |
osos/files/file-generated | file: IFile, fileName, template, exportType, dataEntityId, dataEntryIds |
osos/app-tokens/app-token-generated | token, tokenName, userId, email |
osos/app-tokens/function-app-token-rotated Since dev | functionId, userId (the function’s own user), token (the new raw token: never log or store it). Published instead of the e-mailed token events when a function’s own user has its token regenerated; functions-service stores it as the function’s OSOS_API_TOKEN secret, and audit-service records FUNCTION_APP_TOKEN_ROTATED without the token. See the per-function identity. |
osos/events/job-executed | messageId, instanceId, userId, messages{startMessage,successMessage}, result{success,error?,result?} |
osos/events/email-sent | (no payload) |
osos/events/email-send-status | delivery report: from, to, cc, bcc, subject, body, `status:‘success’ |
osos/events/sms-send-status | to, body, status, strategy, relatedTriggerExecutionId, errorMessage?, smsProviderResponse?, … |
osos/events/push-notification-sent | notificationId: UUID |
osos/events/whatsapp-send-status Since 1.10 | payload: {to, status, providerMessageId?, messageId?, spaceId, templateName, templateLanguage, category, parameters?, errorCode?, errorMessage?, relatedTriggerExecutionId?, timestamp}; status is accepted, sent, delivered, read, failed or mocked (a send skipped in test mode). parameters is left out for authentication templates, because it holds the code. |
osos/icons/icons-updated | timestamp: number |
osos/packaging/package-exported | packageName, resourceCount, resourceTypes[], description? |
osos/packaging/package-imported | sessionId, created, overwritten, skipped, failed, packageFileName? |
osos/packaging/package-changed Since 1.10 | packageId — published by packaging-service when a package’s review or store state moves. A UI signal only; see the socket message. |
osos/dependency/rebuild-dependency-requested | reason, resourceTypes? |
The FileGeneratedEvent.exportType identifies the produced document format; data-export files are generated as XLSX or PDF.
Access, spaces, and users
Section titled “Access, spaces, and users”Event ($name) | Payload |
|---|---|
osos/access-rights/access-rights-changed | entitlementType: EntitlementEnum, `entitlementId: string |
osos/spaces/space-created-event | space: SpaceDataEntry, userId, valueDiff?, isSystemModification? |
osos/spaces/space-updated-event | space, userId, rawDiff?, isSystemModification? |
osos/spaces/space-activated-event / space-deactivated-event | space, userId |
osos/spaces/end-user-activated / end-user-deactivated | space, userId, doneAt |
osos/user/user-signed-up | userId, value, defaultGroup, defaultSpace, … |
osos/user/user-signin-attempted | userId, timestamp, `outcome:‘success’ |
osos/user/user-account-activated / -deactivated / -locked | userId |
osos/user/user-external-id-linked | userId, externalId, syncPatches? |
osos/user/user-password-changed / -reset / -reset-by-system / -reset-completed | userId (+ email/token/etc. per variant) |
Command vocabulary
Section titled “Command vocabulary”Commands are one-to-one instructions handled by the owning service. An integrator issues these (directly or via reaction actions) rather than merely observing them. Full name list from messages/commands:
Data entries — create-data-entry, update-data-entry, patch-data-entry, upsert-data-entry, upsert-draft-data-entry, delete-data-entry, archive-data-entry / archive-data-entries, restore-data-entry / restore-data-entries, permanently-delete-data-entry / permanently-delete-data-entries, upgrade-data-entry, and the bulk variants (bulk-patch-data-entries, bulk-update-data-entries, bulk-update-entries, bulk-upgrade-data-entries).
Data entities — create-data-entity, update-data-entity, create-virtual-data-entity, update-virtual-data-entity, archive-data-entity, recalculate-references, migrate-history-for-entity-entries.
Workflow — change-step, change-step-owner, execute-action, insert-adhoc-step.
Authorization projection Since 1.10 — osos/authz/reconcile-authz-tenant (ReconcileAuthzTenantCommand): mode (repair writes what differs, report only counts it) and an optional trigger (nightly or on-demand). It is sent in the Root Space as the system user and reconciles the sending tenant’s OpenFGA projection; the on-demand sender is an internal, service-only route. It is internal plumbing, listed so you recognise it in bus traces.
Reactions / integrations / messaging / scheduling — osos/reaction/create-reaction, osos/integrations/notify-zapier, osos/notifications/send-push-notification, osos/sms/send-sms, osos/data/generate-file-from-template, osos/shared/export-template-in-background, osos/scheduler/schedule-job, osos/scheduler/schedule-interval-job, osos/scheduler/remove-scheduled-job.
Example command shapes:
new CreateDataEntryCommand( store: string, dataEntry: Pick<DataEntry, 'id' | 'value' | 'specificationVersion' | 'dataEntity'>, userId: UUID, isAdminModification: boolean, skipValidation?: boolean, viewId?: UUID, systemButtonId?: UUID, isSystemModification?: boolean,);
// osos/notifications/send-push-notificationnew SendPushNotificationCommand( tokens: string[], title: string, content: string, data: any, notificationId?: UUID,);Note that commands intentionally carry Pick<...> slices of DataEntry/DataEntity, not the full model — only the fields the handler needs travel over the wire.
Socket (real-time) messages
Section titled “Socket (real-time) messages”Socket messages wrap results relayed back to connected UI clients (messages/socket-messages). They implement BaseSocketMessage ({ $name, $version }) and, unlike bus events, embed the full correlation envelope in the message body:
Message ($name) | Purpose |
|---|---|
osos/infrastructure/command-executed | A dispatched command finished. |
osos/infrastructure/job-executed | A background job finished (mirrors JobExecutedEvent; carries messageId, instanceId, userId, messages, result). |
osos/infrastructure/job-progress | Progress update for a running job. |
osos/infrastructure/job-scheduled / job-started | Job lifecycle notifications. |
osos/infrastructure/register-service | Service registration handshake. |
osos/triggers/custom-event-triggered | UI custom event relayed to clients. |
packages/changed Since 1.10 | Server → client, broadcast to every socket of the event’s tenant when a package’s review or store state moves. Payload { $name, $version: 1, packageId }. An open package page reloads. |
packages/changed differs from the other rows in two ways. Its message class (PackageChangedMessage) lives in web-socket-service, not in @osos/shared. And it is derived from a bus event rather than relayed from a command result: packaging-service publishes PackageChangedEvent (osos/packaging/package-changed) and web-socket-service broadcasts it. It carries no store or review detail — treat it as “re-read the package”, never as state to build on. Delivery details: Real-Time.
CustomEventTriggeredMessage wraps the CustomEventTriggeredEvent plus messageId, instanceId, traceId, userId, spaceId, and optional delegateeId / delegationId — useful when a UI custom event runs under delegation.
Delivery while a tenant is under maintenance Since 1.10
Section titled “Delivery while a tenant is under maintenance Since 1.10”In a multi-tenant deployment a tenant can be put under maintenance: restoring while its data is restored from a backup, or moving while an operator holds it for a move between cells. Bus consumers that run the shared maintenance gate — the LoopBack services’ message bus, indexing-service, notification-service, users-service and web-socket-service — neither process that tenant’s messages meanwhile nor return them to the queue (which would dead-letter the tenant’s traffic after five attempts). They park them: the original is acknowledged and a copy goes to <queue>-parked, a queue with a fixed TTL that dead-letters back to the main queue, so the message is checked again on its next delivery.
What a subscriber can observe:
- Delay, not loss, for most work. Once the maintenance clears, parked messages replay. This applies to a
movinghold and to a restore that did not rewind the data. - Deliberate loss after a restore that rewound the data. A message first parked under a
restoringwindow is dropped once the restore has rewound the tenant’s data (itslastRestoredAtis at or after the window’s start): it describes data as it was after the restore point, and replaying it would, for example, index an entry the restore removed or run a reaction twice. Drops are counted (outcome="dropped") and logged with the restore id. An integration that relies on an event for an outside effect — a webhook, a Zapier call — must treat events emitted inside the restore window as possibly never delivered. - A time cap. A message waits at most 2 hours by default, or the maintenance’s own cap (a move carries the cell’s
movingcap); beyond it the message goes to the real dead-letter queue with the reasonrestore-timeout. - Cell-level messages that name no tenant are never parked, and single-tenant installations have no maintenance state.
The HTTP side of the same state is the 503 TENANT_IN_MAINTENANCE refusal with Retry-After — see Calling the HTTP API.
How integrators consume events
Section titled “How integrators consume events”There are several consumption surfaces, all keyed off the same event vocabulary:
-
Reactions/triggers (no code) — a builder configures a
DataReactionbound to anEventTypeEnumwith aneventConfigmatcher,criteria/queryfilter, and a list ofDataReactionActions. The platform matches published events against these and runs the actions. This is the primary, config-driven path. -
Custom functions — a reaction action of type
ExecuteCustomFunction(AutomatedActionTypeEnum = 104) runs aFunctionModelofFunctionTypeEnum.ReactionCustomAction. Functions can also beInterceptor,StandaloneValidator, orValueValidatortypes, hooking the save/edit/archive lifecycle (StandaloneFunctionValidatorTriggerTypeEnum:BEFORE_SAVE,BEFORE_EDIT,BEFORE_ARCHIVE;ValueFunctionValidatorTriggerTypeEnum:ON_SAVE). A function’s build/deploy status is reported viaFunctionProvisioningStatusUpdateEvent. -
In-service handlers (engine code) — backend services subscribe by implementing
@node-ts/bus-core’sHandler<TEvent>: setmessageType = SomeEventand implementhandle(event, messageAttributes). Example:
export class AccessRightChangedHandler implements Handler<AccessRightChangedEvent> { handlerName = AccessRightChangedHandler.name; messageType = AccessRightChangedEvent; async handle(event: AccessRightChangedEvent, attrs: MessageAttributes<BaseMessageAttributes>) { /* ... */ }}- External integrations — the
ZapierEventTriggeredevent (osos/events/zapier-event-triggered) and theNotifyZapierCommandbridge tenant activity to external Zapier flows;AppTokenGeneratedEventbacks API-token issuance for programmatic access.
For most integrations, prefer events for reactive workflows and the HTTP API for request/response work. If you only need to know that something changed, the real-time channel is lighter than any deeper integration.
A note on the data-service observers
Section titled “A note on the data-service observers”The files under backend/services/data-service/src/observers are not bus-event handlers — they are LoopBack LifeCycleObservers (startup/shutdown booters), grouped by ObserverGroupsEnum.Preparation:
| Observer | Role |
|---|---|
ApplicationObserver | Stops the bus cleanly on app shutdown. |
DomainRedisBooter | Warms the domains cache in Redis at startup (DomainService.refreshDomainsInRedis). |
SpaceRedisBooter | Warms the spaces cache in Redis (SpaceService.refreshSpaceInRedis). |
IconManifestRedisBooter | Regenerates the icon manifest cache. |
GeojsonValidatorObserver | Registers a custom GeoJSON Position validator (lon −180..180, lat −90..90). |
LanguagesBooter | Loads active language entries into the app (falls back to English/Arabic defaults if none exist). |
Actual event handling for the data-service lives under data-service/src/handlers/events/**, and events are published from controllers/services. If you are looking for “who reacts to event X,” search the handlers/events trees, not observers.
Versioning and compatibility
Section titled “Versioning and compatibility”- Match events by their
$namestring constant and check$version(currently all1). If a$versionever bumps, treat the older payload as a distinct contract. - Field additions to event payloads are made as optional (
?) trailing constructor parameters — safe to ignore if you don’t use them (e.g.rawDiff,isSystemModification,refreshedEntities). - Use
normalizedName(entity, field, reaction) as your stable identifier in code; localizednamevalues change and are per-language. rawDiffon*-updatedevents is the rawjust-diffoperation list — prefer the higher-levelvalueChanges/entityChanges/changessummaries where provided; userawDiffonly when you need the exact operation set.
Feature availability
Section titled “Feature availability”DataEntryInvalidatedEvent— Since 1.6.rawDiffon update events — Since 1.6.triggerContextIdon the event config (moved up from action options) — Since 1.8.refreshedEntitiesonDataEntryUpdatedEvent— Since 1.8.DataEntryRestoredEvent,EventAnnouncedEvent,DataEntriesPermanentlyDeletedEvent— Since 1.8.DataEntityDeletedEvent(permanent entity delete) — Since 1.10.SetPermission(31) /RemovePermission(32) action types — Since 1.10.WhatsAppGeneratedEvent,WhatsAppSendStatusEvent,PackageChangedEvent(and thepackages/changedsocket message),ReconcileAuthzTenantCommand, theSendWhatsAppaction type (107) and the maintenance parking and drop behaviour — Since 1.10.FunctionAppTokenRotatedEvent, and no created/updated event for an entry deleted before its re-read — Since dev.ZapierEventTriggered,FunctionProvisioningStatusUpdateEvent,DraftDataEntryUpsertedEvent— Long-standing (available before 1.2); no availability badge.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27