By Paul Scanlon

Publish and Subscribe with Mastra's Built-In Event System

Mastra apps now have a built-in event system to publish and subscribe to messages. You can listen for events like workflow step completion, pause, or completion. Clients that disconnect can replay what they missed.

Non-Mastra apps can also publish their own events through the system. That means you can subscribe external systems to Mastra events, or subscribe Mastra agents and workflows to external events.

The default implementation works on a single machine, but distributed pub/sub is supported through Redis Streams or Google Cloud Pub/Sub, with other services coming soon.

Because Mastra events operate over common pub/sub transports, you can enable interoperable communications with a wide range of external systems or processes.

Hey!

Leave a reaction and let me know how I'm doing.

  • 0
  • 0
  • 0
  • 0
  • 0
Powered byNeon
Close