---
title: EventAudience
description: "Who may send an event: `\"agent\"` (an Agent, as a pick from its Menu), `\"external\"` (the caller of a Gate), or `\"any\"` (both)."
---

# `EventAudience`

Type, in `src/define-event.ts` of `@jr2/agent-protocol`, a dependency of `@jr2/orchestrator`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.

```ts
type EventAudience = "agent" | "external" | "any";
```

Who may send an event: `"agent"` (an Agent, as a pick from its Menu), `"external"` (the caller of
a Gate), or `"any"` (both).

Leave it unset in most cases. Then the position of each `on` key decides: the event belongs to
the party that its state, or the nearest state above it, invokes. An `on` key on a state that
invokes no party, with no such state above it, belongs to both. Set an audience only to give an
event to the other party too (`"any"`). Or set it to keep an event on the root from one party
(`"agent"` or `"external"`).

**See also**

- [The Menu](../../concepts/the-menu.md)
- [Gates](../../concepts/gates.md)
- [ADR-0015: Workflows are authored through `jr2Setup`; vocabulary and agent menus derive from the machine](../decisions/0015-authoring-surface-absorbs-the-mechanism.md)
