Skip to content
Ironflow is pre-1.0: APIs can change between releases. Pin a version. What is ready →

Quick Script

This script allows you to verify your Ironflow connection and see events flowing in real-time. Use this as a diagnostic tool or a starting point for your own subscribers.


  1. Start Ironflow: Run ironflow serve in one terminal.
  2. Run Subscriber: Run the code below in a second terminal.
  3. Trigger Events: Use ironflow emit in a third terminal to see events appear.

import { createSubscriptionClient } from "@ironflow/node";
async function main() {
const client = createSubscriptionClient({
serverUrl: "http://localhost:9123",
});
await client.connect();
// Subscribe to all system run events
await client.subscribe("system.run.>", {
onEvent: (e) => console.log(`[${e.topic}]`, e.data),
replay: 5,
});
// Subscribe to all user events
await client.subscribe("events:>", {
onEvent: (e) => console.log(`[${e.topic}]`, e.data),
replay: 5,
});
console.log("Listening for events...");
}
main().catch(console.error);