# Events and live updates

React the moment something happens, and keep screens up to date without anyone pressing refresh.

A job is created, a reading goes out of range, a form is submitted. With **events**, your module announces it the moment it happens. Other parts of the platform can react: an agent triages the new record, a schedule kicks off, and every open screen updates itself. No refresh button, no polling every few seconds.

## Publishing and listening

Your module publishes events in its own name, such as *jobs.job_created*, with a small payload (usually the record's id). Then:

| Who listens | What happens |
|---|---|
| **Screens** | Open pages of your module update as soon as an event arrives. |
| **Triggers** | An event can start your agent or a job. See [Schedules and triggers](article:6fdf08ad-f3dc-4641-9c6c-457de97ebf29). |
| **Your module's code** | It can react to events from outside, such as changes to the workspace's settings. |

A screen only receives events if the person holds the module's view permission. By default it gets the ids, not the full record, and fetches the details through your module's normal permission checks.

> **Keep a fallback.** Delivery to screens is best effort and nothing is replayed. If the live connection drops, your page should refresh the old way until it's back. The platform tells your page when it's live.

## Live rooms for screens several people watch at once

Events go one way. Sometimes people act **together**: a shared walkthrough, a live board several people edit, a game at the team lunch. For that there are **live rooms**:

- Everyone in a room sees every message in the **same order**.
- People see who joins and leaves.
- Your module decides who may join which room.

Nothing in a room is stored. After a reconnect, a screen asks someone else in the room for the current state.

## Limits and rate

| Events | Live rooms |
|---|---|
| 64 KB per event | 16 KB per message |
| 1,200 events per workspace per minute | 30 messages a second per person |
| 8 live connections per person | 16 people per room, 200 rooms per workspace |

Rooms close briefly when the platform is updated, and screens reconnect on their own.

## Ask the Module Builder

> *"When someone creates a job, update the jobs list for everyone who has it open, and have the agent check the new job for missing details."*

## For developers

```json
"events": {"publishes": ["job_created"], "stream_permission": "JOBS.READ"}
```

```python
await event_bus.publish(tenant_id, "jobs.job_created", {"id": job_id})
```

```js
Platform.events.subscribe('JOBS', {
  events: ['jobs.job_created'],
  onEvent: () => reload(),
  onStatus: s => s === 'live' ? stopPolling() : startPolling(),
});
```

Your own namespace (your module code in lowercase) needs no declaration; another module's is refused.

## Good to know

- **Events are metered** and rate-limited, so publish what matters, not every keystroke.
- **Need an answer back?** Events don't reply. Call a [service](article:eea37a13-648b-4366-92bb-1b437221765b) instead.
- **Testing a trigger?** A Workspace Admin can send a test event with **Fire event** under **System settings › Schedules**.


Source: https://datavisions.ai/docs/creators/platform-services/events-and-live-updates
