Skip to main content

Observability Exports

import {
  createTraceCollector,
  RunflowTraceCollector,
  RunflowTraceSpan,
  traced
} from '@runflow-ai/sdk';

Business Events Tracking

import { track, flushTrackEvents } from '@runflow-ai/sdk/observability';

track(eventName, properties?, options?)

Emit a business event for the portal dashboard.
track('alert_received', { company: 'NW', severity: 'High' });
Parameters:
NameTypeDescription
eventNamestringEvent name (e.g. 'order_placed')
propertiesRecord<string, any>Key-value event data
optionsTrackOptionsOptional overrides
TrackOptions:
NameTypeDescription
threadIdstringOverride auto-resolved thread ID
executionIdstringOverride auto-resolved execution ID
timestampstringISO-8601 timestamp (defaults to now)

flushTrackEvents()

Manually flush all buffered events. Returns a Promise<void>.
await flushTrackEvents();

Next Steps

API Client

View API client exports

Standalone Modules

View standalone modules