Insight Center API Documentation

OData Query Examples

Basic Filtering

Filter by time range
Get events after a specific date
/odata/ChecklistEvents?$filter=TimestampUtc gt 2025-01-01T00:00:00Z
Filter by action type
Get only task update events
/odata/ChecklistEvents?$filter=Action eq 'Task_Update'
Filter with multiple conditions
Combine filters with and / or
/odata/ChecklistEvents?$filter=Action eq 'Task_Override' and CommentType ne null
Filter by list of values
Use in operator for multiple matches
/odata/ChecklistEvents?$filter=Action in ('Task_Comment','Task_Override','Task_Update')
Filter by location
/odata/ChecklistEvents?$filter=LocationName eq 'Headquarters Office' and TimestampUtc gt 2025-06-01T00:00:00Z

Selecting Fields

Return only specific columns
Reduces payload size — only returns the requested fields
/odata/ChecklistEvents?$select=Id,Action,Value,DisplayValue,TimestampUtc,FlowName,TaskName

Sorting

Sort by timestamp descending
/odata/ChecklistEvents?$orderby=TimestampUtc desc
Multi-column sort
/odata/ChecklistEvents?$orderby=FlowName asc,TimestampUtc desc

Pagination

Page through results
Use $top and $skip together. Max top is 1000, default page size is 100.
/odata/ChecklistEvents?$top=50&$skip=100&$orderby=TimestampUtc desc
Get total count with results
Returns @odata.count in the response
/odata/ChecklistEvents?$count=true&$top=10

Combined Queries

Full query example
Filter + select + sort + paginate + count in one request
/odata/ChecklistEvents?$filter=Action eq 'Task_Update' and TimestampUtc gt 2025-06-01T00:00:00Z&$select=Id,FlowName,TaskName,Value,DisplayValue,Action,TimestampUtc,LocationName&$orderby=TimestampUtc desc&$top=100&$skip=0&$count=true
Comments with images
Find all comment/override events that have an image attached
/odata/ChecklistEvents?$filter=(Action eq 'Task_Comment' or Action eq 'Task_Override') and FileUrl ne null&$select=Id,Action,CommentId,CommentType,CommentTypeDisplayValue,CommentText,FileUrl,TimestampUtc
String functions
Use contains, startswith, endswith
/odata/ChecklistEvents?$filter=contains(FlowName,'Safety') and startswith(LocationName,'Head')
Filter by array fields (Tags / AnalyticTags)
Use any / all lambda operators on Tags and AnalyticTags
/odata/ChecklistEvents?$filter=Tags/any(t: t eq 'MRV') and AnalyticTags/any(a: a eq '133')

OData Operators Reference

Comparison
eqEqual
neNot equal
gtGreater than
geGreater or equal
ltLess than
leLess or equal
inIn list
Logical & String
andLogical AND
orLogical OR
notLogical NOT
contains(field,'val')Substring match
startswith(field,'val')Prefix match
endswith(field,'val')Suffix match
arr/any(x: …)True if any array element matches
arr/all(x: …)True only if all array elements match

Event Feed (WebSocket)

Quick Start

GET /v1/events

One WebSocket carries every checklist event for your tenant as it is stored. You open the socket with an AppStore bearer token, send a single subscribe frame, and then receive event frames until the socket closes. Every frame in both directions is one JSON object of UTF-8 text — no binary, no compression, no subprotocol. The path is configurable per environment; the default is /v1/events, over wss://.

Connect, subscribe, receive
The smallest client that works. Copy it, set a token, run it.
# pip install "websockets>=14"
import asyncio, json, os, websockets

URL = "wss://<host>/v1/events"

async def main():
    headers = {"Authorization": "Bearer " + os.environ["MARANICS_FEED_TOKEN"]}
    # max_size matters: server frames go up to 4 MiB, the library default is 1 MiB.
    # additional_headers needs websockets 14+; on 12/13 the same argument is called extra_headers.
    async with websockets.connect(URL, additional_headers=headers, max_size=8 * 1024 * 1024) as ws:
        await ws.send(json.dumps({"type": "subscribe"}))   # no "from" = live only, no history
        async for raw in ws:
            msg = json.loads(raw)
            if msg["type"] == "event":
                e = msg["data"]
                print(e["sequence"], e["eventType"], e["eventId"])
            elif msg["type"] == "heartbeat":
                await ws.send(json.dumps({"type": "pong"}))

asyncio.run(main())
Not a WebSocket request? A plain GET on the feed path without an upgrade header returns 426 Upgrade Required with the body "The event feed is a WebSocket endpoint; upgrade the connection." Authentication happens before the upgrade, so every refusal is an ordinary HTTP status with a readable body — not a close frame.

Three Things to Get Right

1. sequence is ingest order, occurredAt is business time — they are not correlated. sequence is allocated per tenant when the event is stored and is the only ordering you may rely on. occurredAt is when the thing happened on the vessel or device; a vessel that was offline for days sends its backlog when the link returns, so days-old occurredAt values arriving at the live tail are normal and not a fault. Sort, resume and deduplicate on sequence; use occurredAt only as data.
2. Resume means persisting the last sequence to disk and sending it back as from. Write the cursor somewhere durable after you have processed the event, and send {"type":"subscribe","from":<cursor>} on every reconnect — you then receive everything with sequence > from. A cursor held only in memory silently loses every event between your last checkpoint and the restart, with nothing in either log to show for it. The ack frame does not do this for you: the server parses and logs it, and it drives nothing. Your own persisted cursor is the only source of truth.
3. Reconnect-and-resume is routine, not exceptional. Every deployment restarts the process and closes every open socket with 1001. A correct client reconnects immediately (with jitter), resumes from its cursor, and logs nothing alarming. Build the reconnect loop first, not last — a client that treats a close as an error will page someone every release.

Getting Credentials

In UserManagement → Application Catalogue → Installed apps, choose Add new. Give the application a name and grant it at least one scope — Use Insight Center API is the one this feed needs. At least one scope is mandatory; without it the token is rejected.

You are then shown three things, once: a client id, a client secret, and a ready-made access token. The token works immediately, so you can connect and test without minting anything. The secret is never displayed again — it can only be regenerated.

Tenant scope: the application belongs to the tenant you were logged into when you created it, and that cannot be changed or widened afterwards. This is what limits which events the feed will ever hand you.

Minting a new token

Tokens last 365 days. When you need another, request one with your client id and secret. The /internal suffix matters — the plain /connect/token endpoint rejects an application created this way.

POST https://<appstore-host>/connect/token/internal
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=openid&client_id=<client id>&client_secret=<secret>
Which host? You do not need to ask. Decode the token you were given and read its iss claim — that is the AppStore host to call, already correct for your environment.

The response is JSON; the value you want is access_token. To revoke access, disable the application in the Application Catalogue — tokens are not individually revocable before they expire.

Authentication

Send an AppStore bearer token in the Authorization header on the handshake request: Authorization: Bearer <token>. This is the only accepted form — there is no query-string token and no in-band re-authentication once the socket is open. The token's tenant grants are resolved live from the AppStore on every handshake, so a revoked grant stops the next connection rather than an already-open one.

StatusMeaningWhat to do
401No token, unreadable token, expired token, or no client id in itRefresh the token and retry
403Authenticated but not entitled — client id not allowed, no granted tenant, or ?tenant= naming a tenant you do not holdDo not retry; contact us
503The permissions lookup failed — a dependency outage on our side, not a decision about youRetry after the Retry-After header (30s)

Choosing a tenant

If your token grants exactly one tenant, it is used automatically and you need to do nothing. If it grants several, add ?tenant=<name> to the socket URL naming one you already hold — connecting without it is a 403, and so is naming a tenant you do not hold. The parameter can only select among your grants; it can never widen them. Tenant headers, cookies and claims are deliberately ignored.

The Subscribe Frame

The server sends nothing until it receives this frame, and you have 10 seconds from the socket opening to send it. Exactly one per connection.

Resume from a cursor, filtered to task events at one location
{
  "type": "subscribe",
  "from": 104200,
  "eventTypes": ["flow.task.*"],
  "locationIds": ["e7c3a1b2-4f5d-4e6a-8b9c-1d2e3f4a5b6c"]
}
FieldTypeMeaning
typestringRequired. Must be exactly subscribe on the first frame.
fromint64?Optional resume cursor — you receive sequence > from. Omit it for live-only with no history. Negative, or higher than the tenant's latest sequence, closes the socket with 4400; equal to the latest is valid and simply waits.
eventTypesstring[]?Optional. Shell-style globs over the dotted eventType, matched case-insensitively, where * matches any run of characters including dots and ? matches exactly one.
locationIdsstring[]?Optional. Exact, case-sensitive match against subject.locationId. An event whose locationId is null never matches this filter.
Filters only ever narrow. The two are combined with AND, and neither can widen the stream past what your token grants. An empty or all-blank array is treated exactly like an absent field — it narrows nothing. Any JSON property the server does not recognise is ignored silently, with one exception below.
There is no imo filter. Our events carry no IMO number, so filtering by one is impossible and is rejected loudly rather than ignored: the mere presence of an imo key — even "imo": [] — closes the socket with 4400 and the reason UNSUPPORTED_FILTER:imo; use locationIds. Identify vessels by subject.locationId.

Other Frames You Can Send

FrameMeaning
{"type":"pong"}The answer to a heartbeat. Any inbound frame proves liveness, but this is the one the server asks for.
{"type":"ack","sequence":104233}Optional progress report. It is parsed and logged and drives nothing — your own persisted cursor is what resumes the stream.
Anything else closes the socket with 4400. A first frame that is not subscribe, a second subscribe, an unrecognised type, a frame that is not valid JSON or not a JSON object, or a frame over 64 KiB. These are client bugs, so do not retry on 4400 — fix the frame.

Server Messages

Four message types, distinguished by type. All JSON is camelCase, and null fields are omitted entirely rather than sent as null. Timestamps are RFC 3339 with an explicit +00:00 offset.

subscribed
Sent exactly once, before anything else, as soon as the subscription is accepted
{
  "type": "subscribed",
  "from": 104200,
  "replaying": true,
  "filtered": false,
  "oldestAvailable": 98311,
  "latest": 104987,
  "serverTime": "2026-09-21T08:14:02.118+00:00"
}
FieldMeaning
fromThe cursor actually adopted, which can be higher than the one you asked for when your cursor had fallen outside the replay window. Trust this one, not yours.
replayingTrue when the connection starts behind the live tail, i.e. history is coming first.
filteredTrue when any filter is in force — and therefore when sequence numbers are legitimately sparse.
oldestAvailableLowest sequence still inside the replay window at subscribe time.
latestThe tenant's highest sequence at subscribe time, so you can measure your own lag.
serverTimeThe server clock, to measure skew against.
event
One envelope. The envelope is described in full below.
{
  "type": "event",
  "data": {
    "eventId": "9f1c2f0e-6b2a-4a1f-9d8e-3c5b7a1e4d20",
    "sequence": 104233,
    "eventType": "flow.task.completed",
    "schemaVersion": "1.0",
    "occurredAt": "2026-09-21T08:14:02.118+00:00",
    "source": "maranics.flowapp",
    "subject": {
      "locationId": "e7c3a1b2-4f5d-4e6a-8b9c-1d2e3f4a5b6c",
      "locationGlobalId": "3a9f61c4-0f2b-4c7d-9a3e-5b8c2d1f6e40",
      "locationName": "MV Example",
      "flowId": "8b1d47e0-3c92-4f18-b6a5-77d0c9e2a134"
    },
    "payload": {
      "flowName": "Daily Engine Round",
      "sectionName": "Main Engine",
      "taskName": "Jacket water temperature",
      "value": "82",
      "displayValue": "82 °C",
      "action": "Task_Complete",
      "timestampUtc": "2026-09-21T08:14:02.118+00:00"
    }
  }
}
heartbeat
Sent after every 30 seconds of outbound silence, only once subscribed — a busy feed may never send one. Answer it with {"type":"pong"}.
{"type": "heartbeat", "ts": "2026-09-21T08:14:32.004+00:00"}
error — GAP
Events this socket will never deliver. The connection stays open and the stream continues from the oldest available sequence.
{
  "type": "error",
  "code": "GAP",
  "message": "Events 98000-98310 are outside the RetentionDays replay window and cannot be delivered; replay resumes at the oldest available sequence.",
  "detail": { "skippedFrom": 98000, "skippedTo": 98310, "oldestAvailable": 98311 }
}
error — OVERSIZE_EVENT
One event was too large to put on the wire. The connection stays open, and a flow.meta.oversize placeholder follows at that same sequence.
{
  "type": "error",
  "code": "OVERSIZE_EVENT",
  "message": "Event 9f1c2f0e-6b2a-4a1f-9d8e-3c5b7a1e4d20 at sequence 104233 is larger than the 4194304 byte frame limit; a placeholder was sent at its sequence and the payload can be fetched over OData.",
  "detail": { "eventId": "9f1c2f0e-6b2a-4a1f-9d8e-3c5b7a1e4d20", "sequence": 104233, "bytes": 5242880 }
}
Branch on code, never on message. The message is human text for an operator's log and its wording varies — a GAP raised at the retention boundary reads differently from one raised over a sequence genuinely missing from the store, and both carry the same three detail keys.
Order at subscribe time: subscribed is sent first, then a GAP error frame if your requested cursor fell outside the replay window, then the events. Take your expected next sequence from subscribed.from, which is already clamped.

The Event Envelope

The envelope is transport-independent by design: it is routing identity plus the native event as payload. payload is exactly the object the OData API serves — see Event Data Model above for its full field list and source mappings.

FieldTypeMeaning
eventIdstringUUID string. Your deduplication key — stable across replays and redeliveries. Opaque: it is not sortable and carries no ordering.
sequenceint64Per-tenant, gap-free, strictly increasing, allocated inside the transaction that stores the event. The only ordering you may rely on, and the resume cursor.
eventTypestringThe dotted name of the action, from the vocabulary below. A frozen contract: a name may be deprecated alongside a replacement, never renamed.
schemaVersionstringSemVer of the payload schema for that eventType. Every type is 1.0 today and they can diverge independently.
occurredAtstringRFC 3339 business time — when it happened, taken from payload.timestampUtc, falling back to payload.serverTimestamp and, when the event carries neither, to 0001-01-01T00:00:00+00:00. Not ordered with respect to sequence.
sourcestringAlways the constant maranics.flowapp.
payloadobject?The flat native event, untranslated — the same shape the OData API serves. Null only on an oversize placeholder.
payloadOmittedbool?Present and true only on an oversize placeholder. Absent — not false — on every normal event.
subject — routing identity, every member optional
subject.locationIdstring?The tenant-local location (vessel, site) id. The only field locationIds filters on.
subject.locationGlobalIdstring?Cross-tenant stable id for the same location.
subject.locationNamestring?Display name. Do not key on it.
subject.flowIdstring?The checklist instance the event belongs to.
Careful: payload.eventType is the control type (Text, Number, Form, List) — not the envelope's eventType, which is the action. They are different fields with the same name at different levels.
Treat unknown fields as ignorable. A replay re-projects the stored event through today's mapping, so a field added after an event was stored appears on that event when it is replayed. Sensitive tasks are delivered in full — payload.sensitiveData is true and nothing is redacted, so handle those payloads accordingly. The JSON Schema for the payload is served at /schemas/checklist-event/v1.json (urn:maranics:insightcenter:checklist-event:v1); the feed's payload does not carry $schema inline.

eventType Vocabulary

The complete set. Each maps to one Maranics action from Supported Event Actions above. Use these names in eventTypes globs.

eventTypeMaranics action
Flow
flow.flow.createdFlow_Create
flow.flow.startedFlow_Start
flow.flow.completedFlow_Complete
flow.flow.discardedFlow_Discard
flow.flow.dueTimeMissedFlow_DueTimeMissed
flow.flow.updatedFlow_Update
Section
flow.section.startedSection_Start
flow.section.commentedSection_Comment
flow.section.commentCompletedSection_CommentComplete
flow.section.overriddenSection_Override
flow.section.completedSection_Complete
flow.section.clearedSection_Clear
Task
flow.task.updatedTask_Update
flow.task.modifiedTask_Modify
flow.task.clearedTask_Clear
flow.task.commentedTask_Comment
flow.task.commentCompletedTask_CommentComplete
flow.task.overriddenTask_Override
flow.task.remindedTask_Reminder
flow.task.listUpdatedTask_ListUpdate
flow.task.confirmedTask_Confirm
flow.task.completedTask_Complete — synthesized by InsightCenter
flow.task.listRowUpdatedTask_ListRowUpdated — synthesized by InsightCenter
Reserved — the whole flow.meta. prefix
flow.meta.unmappedAn action the vocabulary has no name for. Emitted anyway, payload intact, so the sequence stays contiguous. A boot-time completeness check makes this close to impossible.
flow.meta.oversizePlaceholder for an event too large to send. Carries the real eventId, sequence and subject, no payload, and payloadOmitted: true.
Not carried in v1: flow deletions and restores. There is no flow.flow.deleted or flow.flow.restored — those actions are not stored as events and so cannot be delivered. Anything outside the actions listed above is discarded before it becomes an event; it does not even arrive as flow.meta.unmapped.
flow.task.listRowUpdated fires on edits too. The source app sends the same Task_ListUpdate whether a row is new or an existing row was changed, and the message carries no created-versus-modified marker. A consumer that wants only genuinely new rows must remember the row ids it has already seen.

Close Codes

Every close carries a reason string of the form TOKEN:human text, truncated at 123 bytes. Branch on the code, not the text.

CodeMeaningWhat to do
1000Normal — the connection endedReconnect and resume
1001Going away — the server is shutting down. Every deploy does this.Reconnect immediately with jitter, and resume
1011Internal error — an integrity fault on our sideReconnect with backoff, and resume
1013Try again later — your outbound buffer stayed full for 30s and you were evicted. Nothing is lost.Reconnect with backoff and read faster
4400Protocol error — a malformed, oversized or unsupported frame, including any imo keyDo not retry. Fix the client
4401Token expired mid-connection. There is no in-band re-auth.Reconnect with a fresh token, and resume
4403Forbidden — authenticated but not entitled. (At handshake time the same condition is an HTTP 403.)Do not retry. Contact us
4408Timeout — either no subscribe within 10s, or no pong within 60s of a heartbeatReconnect, and answer heartbeats
4429Rate limited — more than 5 concurrent connections. Arrives as a close after the upgrade, not as an HTTP 429.Back off, then reconnect with fewer sockets

Limits

LimitValueNotes
Inbound frame size64 KiBExceeding it closes 4400
Outbound frame size4 MiBSet your library's frame limit above this. Exceeding it does not skip the sequence — an OVERSIZE_EVENT error and a flow.meta.oversize placeholder take its place
Concurrent connections5Per AppStore client id. One socket is the intended shape
Subscribe deadline10 sFrom the socket opening → 4408
Heartbeat30 sAfter 30s of outbound silence. A busy feed may never send one
Pong deadline60 sMeasured from when the heartbeat was sent → 4408
Slow-consumer grace30 s1000 frames are buffered per connection; 30s with a full buffer → 1013
Replay window7 daysA read policy — nothing is deleted, and events behind a GAP stay queryable over OData
Live latencyup to ~500 msThe feed polls its own store every 500 ms once it has caught up, so live events arrive within one poll
Keep-alive: the connection also runs WebSocket ping/pong at the protocol level every 20 seconds. Any proxy between you and us must allow long-lived upgraded connections with an idle timeout well above 30 seconds.

Delivery and Ordering

Gap-free within the tenant. The sequence number is allocated in the same transaction that stores the event, so per tenant, sequence order is commit order. On an unfiltered subscription the numbers you receive are contiguous, with exactly two announced exceptions: a GAP error frame, which always names the skipped range, and an oversize placeholder, which occupies its sequence and so is not a hole at all. A hole with neither is a bug — report it.

At-least-once. Deduplicate on eventId, which is stable across replays and redeliveries. One duplicate case it will not catch: the vessel-to-cloud bridge can republish the same business event as a genuinely new message, which becomes a second stored event with a different eventId and sequence. If that matters to you, deduplicate additionally on the natural key payload.flowId + sectionId + itemId + action + timestampUtc + value.

Replay and live are the same loop. The server reads a page after your cursor, delivers it, and waits when the page is empty. There is no phase switch and no window in which an event can fall between replay and live.

Filtering makes the stream sparse — and ages your cursor. On a filtered subscription the sequence numbers are legitimately non-contiguous (subscribed.filtered tells you so), which means contiguity can no longer be used to detect loss. Worse, your cursor only advances on events actually delivered, so a narrow filter that matches nothing for a week leaves the cursor outside the 7-day window and produces a GAP on the next reconnect even though nothing was missed. For v1 we recommend subscribing unfiltered and filtering on your side.
What GAP means. Either your requested from was older than the replay window, or a sequence went permanently missing from the store. In both cases the connection stays open and the stream resumes, but those events will never arrive on this socket — treat a GAP as an incident, not a log line. The events themselves are not deleted and remain queryable over OData.
What the promise does not cover. Everything that reaches InsightCenter is delivered in order and gap-free — between the store and the socket there is no sampling, dropping or rate limiting. That is narrower than "everything that happens on a vessel": a vessel's events reach the cloud only when it has connectivity, and the feed cannot tell a quiet vessel from a dead link. The feed's history also begins at its deployment; events stored before that have no sequence and are available only over OData.

Health and Status

Two plain HTTP endpoints sit beside the socket, on the same path.

GET /v1/events/health

Anonymous liveness probe. 200 while the process is serving, 503 once it has begun shutting down. No body, ever — it needs to be reachable without a token.

GET /v1/events/status

Behind the same token as the socket, and scoped to your tenant only. Useful for checking your lag without opening a connection.

{
  "tenant": "example-tenant",
  "latest": 104987,
  "oldestAvailable": 98311,
  "activeConnections": 1,
  "secondsSinceLastIngest": 42.7,
  "serverTime": "2026-09-21T08:14:02.118+00:00"
}
FieldMeaning
tenantThe tenant this document describes — your own, resolved from the token exactly as the socket resolves it
latestYour tenant's highest sequence; 0 when nothing has been produced yet
oldestAvailableLowest sequence still inside the replay window
activeConnectionsOpen feed sockets for your tenant on that server process
secondsSinceLastIngestAge of the newest stored event; null when the tenant has no sequenced events at all
serverTimeThe server clock

Reference Client

A complete consumer: durable cursor, reconnect with backoff and jitter, heartbeat answers, and the two close codes that must never be retried. Everything in it is load-bearing.

# pip install "websockets>=14"   # 14+ for additional_headers; on 12/13 it is extra_headers
import asyncio, json, os, random, tempfile
import websockets

URL      = "wss://<host>/v1/events"
CURSOR   = "feed-cursor.json"   # MUST be on disk: an in-memory cursor loses events across a restart
MAX_SIZE = 8 * 1024 * 1024      # server frames reach 4 MiB; the library default of 1 MiB is too small
FATAL    = (4400, 4403)         # client bug / not entitled - retrying cannot help

def read_cursor():
    try:
        return json.load(open(CURSOR))["lastSequence"]
    except FileNotFoundError:
        return None

def commit_cursor(sequence):
    fd, tmp = tempfile.mkstemp(dir=".")
    with os.fdopen(fd, "w") as f:
        json.dump({"lastSequence": sequence}, f)
    os.replace(tmp, CURSOR)     # atomic: a crash mid-write cannot truncate the cursor

def handle(envelope):
    # Idempotent on envelope["eventId"] - delivery is at-least-once.
    if envelope.get("payloadOmitted"):        # flow.meta.oversize: fetch the body over OData if you need it
        print("oversize", envelope["sequence"], envelope["eventId"])
        return
    payload = envelope.get("payload", {})
    print(envelope["sequence"], envelope["eventType"], payload.get("flowName"), payload.get("value"))

async def consume(get_token):
    backoff = 1.0
    while True:
        try:
            headers = {"Authorization": "Bearer " + get_token()}
            async with websockets.connect(URL, additional_headers=headers, max_size=MAX_SIZE) as ws:
                frame = {"type": "subscribe"}
                cursor = read_cursor()
                if cursor is not None:
                    frame["from"] = cursor    # omit for live-only. Never send an "imo" key: it closes 4400
                await ws.send(json.dumps(frame))
                backoff = 1.0

                async for raw in ws:
                    msg = json.loads(raw)
                    kind = msg["type"]
                    if kind == "event":
                        handle(msg["data"])
                        commit_cursor(msg["data"]["sequence"])   # persist AFTER processing
                    elif kind == "heartbeat":
                        await ws.send(json.dumps({"type": "pong"}))
                    elif kind == "subscribed":
                        # "from" may be higher than we asked for; a GAP frame follows when it is.
                        print("subscribed from", msg["from"], "latest", msg["latest"], "filtered", msg["filtered"])
                    elif kind == "error":
                        # GAP means events this socket will never deliver. Alert on it.
                        print("ERROR", msg["code"], msg["message"], msg.get("detail"))
        except websockets.ConnectionClosed as exc:
            if exc.code in FATAL:
                print("fatal close", exc.code, exc.reason)
                raise
            if exc.code in (1001, 4401):      # deploy, or expired token - get_token() returns a fresh one
                backoff = 1.0
        except OSError as exc:
            print("transport error", exc)
        await asyncio.sleep(min(backoff, 60) * (0.5 + random.random()))
        backoff *= 2

asyncio.run(consume(lambda: os.environ["MARANICS_FEED_TOKEN"]))

Event Data Model

Null and empty fields are omitted from the published JSON to keep payloads small. Each event carries $schema — a stable, deployment-independent URN identifying the schema version — and $schemaLocation, the path to fetch the full schema (resolve it against your InsightCenter host). Enums are serialized as their string name.

FieldTypeMapped From (DispatchData)
Identity
$schemastringStable URN identifying the schema version (urn:maranics:insightcenter:checklist-event:v1)
$schemaLocationstringPath to fetch the schema (/schemas/checklist-event/v1.json)
idGuidAuto-generated (gen_random_uuid)
tenantstringEvent.Tenant
eventTypestring?Event.Control.Type
titlestring?Task.Name (prefixed with "TBD: ")
flowIdstring?Checklist.Id
templateIdstring?Checklist.TemplateId
sectionIdstring?Section.Id
itemIdstring?Task.Id
subItemIdstring?Event.Control.Items[].Id (List) or Event.Control.FormValues[].DataId (Form)
subItemIndexint?Event.Control.Items[].Index (List) or Event.Control.FormValues[].Index (Form)
Flow / Section / Item
eventstring?Event.Action — or Task_Complete / Task_ListRowUpdated on the events InsightCenter synthesizes (see action)
actionstring?Event.Action, plus two actions InsightCenter generates itself. Task_Complete: emitted once when a multi-value control (Form / List / Dual) is finalized, carrying the control's identity (no value / dataId / unit) plus the whole control on controlPayload, so a trigger fires once instead of on the last field/row/side update — single-value controls do not emit it. Task_ListRowUpdated: emitted once per list row changed in a Task_ListUpdate, carrying that row as one object on controlPayload and keeping subItemId/subItemIndex. See the event list below.
flowNamestring?Checklist.Name
flowSubtitlestring?Checklist.TemplateShortDescription
flowRefIdstring?Checklist.RefId
flowTopicstring?Template.Topic
sectionNamestring?Section.Name
sectionTopicstring?Section.Topic
taskNamestring?Task.Name
taskSecondaryTitlestring?Task.SecondaryTitle
tagsstring[]?Task.Tags (comma-separated → array; omitted when none)
analyticTagsstring[]?Task.AnalyticTags (comma-separated → array; omitted when none)
itemNamestring?Task.Control.ValueTitle
Data / Value
dataTypestring?Event.Control.Type
controlDataIdstring?Event.Control.Items[].Values[].DataId (List) or Event.Control.FormValues[].DataId (Form)
dataIdstring?Event.Control.DataId
valuestring?Event.Control.Value (or per-item value for List/Form)
displayValuestring?Event.Control.DisplayValue (or per-item display value for List/Form)
controlPayload newobject?The complex control's values as a nested object. Present only on Task_Complete (the whole control) and Task_ListRowUpdated (one row); null on every other event. Shapes: {"type":"Form"|"Dual"|"ListRow","fields":{dataId: value}} and {"type":"List","items":[{dataId: value}]}, list rows in fill order. Keys are the template's dataId, falling back to the input title then a positional key. Values are raw strings. Capped at 16 KB — past that, entries are dropped and "truncated": true is set alongside the true itemCount/fieldCount. Cannot be used in filter expressions — read it in the workflow body instead (e.g. payload.fields['my-data-id']).
Source & Comments
sourceValuestring?null (reserved)
sourcestring?null (reserved)
sourceTimeDateTimeOffset?null (reserved)
commentIdstring?Event.Comment.Id
commentTypestring?Event.Comment.Type
commentTypeDisplayValuestring?Event.Comment.DisplayType
commentTextstring?Event.Comment.Value
prefixstring?Event.Control.TextBefore
subfixstring?Event.Control.TextAfter
File
fileIdstring?Event.Control.Value (filename without extension, File type only)
fileNamestring?Event.Control.Value (filename without extension, File type only)
fileTypestring?Event.Control.Value (file extension, File type only)
fileUrlstring?Event.Control.Value (File type) or Event.Comment.ImageUrl (Comment/Override fallback)
Timestamps
serverTimestampDateTimeOffset?Event.Timestamp.Server.Processing.Time
deviceTimestampDateTimeOffset?Event.Timestamp.Device.Time
timestampUtcDateTimeOffset?Event.Time
Stream / Process / Category
streamIdstring?Checklist.StreamId
processIdstring?Template.Process.Id
processNamestring?Template.Process.Name
categoryIdstring?Template.Category.Id
categoryTitlestring?Template.Category.Name
Location
latitudedecimal?Event.Geoposition.Latitude
longitudedecimal?Event.Geoposition.Longitude
locationIdstring?Location.Id
locationNamestring?Location.Name
locationGlobalIdstring?Location.GlobalId
locationTimeZonestring?Event.Timezone
locationRouteIdstring?Location.RouteId
User / Position
userIdstring?Event.UserId
positionIdstring?Event.PositionId
positionNamestring?Event.Position
sensitiveDatabool?Task.SensitiveData
Note: The metadata fields (flowMetadata, sectionMetadata, itemMetadata, locationMetadata) are stored as JSONB in the database but are excluded from the OData EDM model and not queryable via OData.

Supported Event Actions

Flow Events
Flow_Create
Flow_Start
Flow_Complete
Flow_Discard
Flow_DueTimeMissed
Flow_Update
Section Events
Section_Start
Section_Comment
Section_CommentComplete
Section_Override
Section_Complete
Section_Clear
Task Events
Task_Update
Task_Modify
Task_Clear
Task_Comment
Task_CommentComplete
Task_Override
Task_Reminder
Task_ListUpdate
Task_Confirm
Task_Complete new
Task_ListRowUpdated new
Task_Complete and Task_ListRowUpdated are generated by InsightCenter, not by the source app — no message on the bus carries these actions. Both exist so a trigger can fire once on a complete unit of work instead of correlating the individual value events itself, and both carry the values on controlPayload.
Task_Complete mirrors Flow_Complete / Section_Complete. When a multi-value control (Form / List / Dual) is finalized, InsightCenter emits one extra event with this action, reduced to the task's identity — no value, dataId, or unit — so a trigger fires once instead of on the last field/row/side update. Its controlPayload carries the whole control. Single-value controls do not emit it.
Task_ListRowUpdated fires once per list row that changed in a Task_ListUpdate, alongside the per-cell events, and carries that one row as a single object on controlPayload. Unlike Task_Complete it keeps subItemId and subItemIndex — which row changed is the point of it.

It is called Updated and not Added on purpose: the source app sends the same Task_ListUpdate action whether a row is brand new or an existing row was edited, and the message carries no created-versus-modified marker — so this event also fires when an existing row is edited. A trigger that must act only on genuinely new rows has to remember which subItemIds it has already seen.

Usage in Automation

Overview

Insight Center events can be consumed in real-time by the Elsa Automation App via RabbitMQ. The InsightCenterEventListener activity listens for incoming checklist events, filters them using configurable trigger expressions, and resumes workflows when a match is found.

Events are published to RabbitMQ as flattened JSON messages. The automation engine flattens nested objects into dot-notation keys (e.g. location.fromPort) so you can filter on any level of the event structure.

Event Trigger Configuration

Each trigger is a Name + Value pair entered in the Elsa workflow designer. The Name (left field) is the event field to match against, and the Value (right field) is the filter expression. All triggers must match for the event to pass through to the workflow.

Name (field)Value (expression)Description
eventTask_UpdateMatch task update events — plain value, same as eq 'Task_Update'
flowTopicSafetyMatch flows with topic "Safety" — plain value, same as eq 'Safety'
flowTopiceq 'port/ship/#'Wildcard match on topic path
valuegt 5Numeric comparison on value
value#Simple match — any non-empty value
dataIdin ('A','B','C')Match if dataId is in list
tagscontains 'Logbook'Match if the array field contains the value
tagscontains 'Logbook,MRV'Match only if all listed values are present (AND semantics)
flowTopiclike 'engine'Case-insensitive substring match on a string field
timestampUtcgt 2025-01-01T00:00:00ZDate comparison
location.fromPorteq 'Oslo'Dot-path access to nested JSON
Simple match: If the Value contains no operator, it is treated as a direct equality match. For example, writing Task_Update is equivalent to eq 'Task_Update'. This is the most common and convenient way to set up triggers. # matches any value with one or more path segments, + matches exactly one segment.

Filter Expression Syntax

Filter expressions use an OData-inspired syntax evaluated by the EventListenerEvaluator.

Comparison Operators

OperatorDescriptionExample
eqEquals (case-insensitive)event eq 'Task_Update'
neNot equalscommentType ne 'Info'
gtGreater thanvalue gt 5
geGreater or equalvalue ge 10
ltLess thanvalue lt 100
leLess or equalvalue le 50
inIn listdataId in ('A','B','C')
containsArray membership — single value or comma-separated where all must be presenttags contains 'Logbook,MRV'
likeCase-insensitive substring match on a string field (supports %/_ wildcards)flowTopic like 'engine'

Array Fields (contains)

contains targets array-valued fields like tags and analyticTags. It's case-insensitive, supports the #/+ wildcards on each element, and accepts a single value or a comma-separated list (whitespace tolerant) where every listed value must be present. Returns false if the field has no array entries.

ExampleBehavior
tags contains 'Logbook'True when the tags array includes Logbook
tags contains 'logbook'Case-insensitive match
tags contains 'Logbook,MRV'True only if both Logbook and MRV are present
tags contains 'Log#'Wildcard inside an element — matches Logbook
analyticTags contains '133'Works on analyticTags too
contains 'Logbook'Shorthand — uses the trigger Name as the field

Substring Matching (like)

like performs a case-insensitive substring match against a string field — it matches when the expected text appears anywhere in the value. This is the right operator for topics where you only know a fragment. For example, flowTopic like 'engine' matches vessel.engine.temperature. Optionally use SQL-style wildcards: % matches any sequence of characters and _ matches a single character; when present, the pattern is anchored to the whole value.

ExampleBehavior
flowTopic like 'engine'True when "engine" appears anywhere in flowTopic (e.g. vessel.engine.temperature)
flowTopic like 'ENGINE'Case-insensitive
flowTopic like 'vessel%temperature'% wildcard — starts with vessel, ends with temperature
flowTopic like 'a_c'_ wildcard — matches exactly one character (abc, not abXc)
like 'engine'Shorthand — uses the trigger Name as the field
like vs. contains: use like for a substring of a single string field (e.g. a topic), and contains for membership in an array field such as tags or analyticTags.

Wildcard Patterns

Wildcards work on path-style values separated by /.

PatternDescriptionExample
#Matches one or more levelsflowTopic eq 'port/host/#'
+Matches exactly one levelflowTopic eq 'port/+/status'

Logical Operators & Grouping

FeatureExample
AND (binds tighter than OR)event eq 'Task_Update' and value gt 5
ORevent eq 'Task_Comment' or event eq 'Task_Override'
Implicit field chainingvalue eq '5' or eq '10'
Parentheses grouping(value eq '5' or eq '10') and value ne '7'

Data Type Handling

The evaluator automatically detects and compares values by type:

TypeExample
DateTimeOffset (ISO 8601)timestampUtc gt 2025-01-01T00:00:00Z
Numeric (int / double)value gt 5
String (case-insensitive)event eq 'Task_Update'

Filter Expression Examples

Each example below shows the Name (left) and Value (right) as entered in the workflow designer.

NameValueWhat it does
eventTask_UpdatePlain value — same as eq 'Task_Update', simplest form
eventeq 'Task_Update'Explicit equality match — equivalent to above
flowTopiceq 'port/host/#'Wildcard — match any sub-path under port/host/
timestampUtcgt 2025-01-01T00:00:00ZDate comparison — only events after this date
valuegt 5Numeric comparison
value#Simple wildcard — matches any non-empty value
dataIdin ('SensorA','SensorB')List membership
tagscontains 'Logbook'Array membership — tags includes Logbook
tagscontains 'Logbook,MRV'All-of — both Logbook and MRV must be present
analyticTagscontains '133'Same on analyticTags
tagscontains 'Logbook' and analyticTags contains '133'Combine across two array fields
flowTopiclike 'engine'Substring match — topic contains "engine" anywhere
flowTopiclike 'vessel%temperature'Substring with % wildcard between fragments
valueeq '5' or eq '10'Implicit OR — field name inherited
event(eq 'Task_Comment' or eq 'Task_Override') and commentType ne nullComplex grouping with AND/OR
location.fromPorteq 'Oslo'Dot-path access to nested JSON field

Available Event Fields

All fields from the Event Data Model are available as trigger Names. The event JSON is flattened to dot-notation, so nested fields are also accessible.

Commonly Used Trigger Fields

NameWhat it representsExample Values
eventThe event action typeTask_Update, Task_Comment, Flow_Complete
flowNameName of the flow/checklistSafety Inspection, Daily Report
flowTopicTopic of the templateSafety, Maintenance, port/ship/engine
taskNameName of the task/itemCheck oil level, Verify pressure
valueThe control valueOK, 42, Yes
displayValueHuman-readable control valueApproved, 42 PSI
dataTypeControl typeCheckbox, Dropdown, Text, Number
locationNameLocation where the event occurredHeadquarters Office, Deck 3
commentTypeType of comment (for comment/override events)Info, Warning, Critical
tagsFree-form tags on the task (array) — use with containsTest, Logbook, MRV
analyticTagsAnalytic tags on the task (array) — use with contains133, forDPLog
timestampUtcWhen the event occurred2025-06-15T14:30:00Z
templateIdTemplate ID of the flowabc-123-def
sectionNameName of the sectionPre-departure checks
Dot-path fields: If the event JSON contains nested objects, you can access them using dot notation in the Name field (e.g. location.fromPort). Arrays use bracket notation (e.g. items[0].id).