mastra-ai/mastra · error · Error

sendNotificationSignal requires a notifications storage doma

Error message

sendNotificationSignal requires a notifications storage domain

What it means

Agent notification signals are persisted through the notifications storage domain. #sendNotificationSignalBatch checks getStore('notifications') and throws a plain Error when it is unavailable — i.e. the Mastra instance either has no storage or its backend doesn't implement the notifications domain.

Source

Thrown at packages/core/src/agent/agent.ts:8315

    target: SendAgentNotificationSignalOptions<OUTPUT>,
  ): Promise<SendAgentNotificationSignalResult<OUTPUT>[]>;
  async sendNotificationSignal<OUTPUT = TOutput>(
    notification: SendNotificationSignalInput | SendNotificationSignalInput[],
    target: SendAgentNotificationSignalOptions<OUTPUT>,
  ): Promise<SendAgentNotificationSignalResult<OUTPUT> | SendAgentNotificationSignalResult<OUTPUT>[]> {
    const isBatch = Array.isArray(notification);
    const inputs = isBatch ? notification : [notification];
    const results = await this.#sendNotificationSignalBatch<OUTPUT>(inputs, target);
    return isBatch ? results : results[0]!;
  }

  async #sendNotificationSignalBatch<OUTPUT = TOutput>(
    inputs: SendNotificationSignalInput[],
    target: SendAgentNotificationSignalOptions<OUTPUT>,
  ): Promise<SendAgentNotificationSignalResult<OUTPUT>[]> {
    const notifications = await this.#mastra?.getStorage()?.getStore('notifications');
    if (!notifications) {
      throw new Error('sendNotificationSignal requires a notifications storage domain');
    }

    const records = [];
    for (const notification of inputs) {
      records.push(
        await notifications.createNotification({
          ...notification,
          agentId: this.id,
          resourceId: target.resourceId,
          threadId: target.threadId,
        }),
      );
    }

    const threadState = agentThreadStreamRuntime.getThreadState(
      { resourceId: target.resourceId, threadId: target.threadId },
      this.getPubSub(),
    );

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Attach a storage backend that implements the notifications domain to the Mastra instance.
  2. Upgrade @mastra/storage adapters to versions that support the notifications store.
  3. Guard the call: check agent storage availability before sending notification signals, or handle the thrown Error.

Example fix

// before
const mastra = new Mastra({ agents: { myAgent } });
await myAgent.sendNotificationSignal(input, target);
// after
const mastra = new Mastra({ agents: { myAgent }, storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }) });
await myAgent.sendNotificationSignal(input, target);
Defensive patterns

Strategy: validation

Validate before calling

const notifications = await mastra.getStorage()?.getStore('notifications');
if (!notifications) {
  logger.warn('Notifications storage unavailable; skipping notification signal');
  return [];
}

Try / catch

try {
  await agent.sendNotificationSignal(input, target);
} catch (e) {
  if (e instanceof Error && e.message.includes('notifications storage domain')) {
    logger.warn('Notification storage not configured; skipping');
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling agent.sendNotificationSignal() (or the batch path) on a Mastra instance without storage, or with a storage adapter that lacks a notifications store implementation.

Common situations: Ephemeral/in-memory Mastra setups; older storage adapters that predate the notifications domain; forgetting to configure storage in the deployment environment while it existed locally.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/29ae418c79828aa5. Report an issue: GitHub.