Node SDK

Flushing and shutdown

Deliver queued Node events before a process exits.

flush#

timeout is the maximum wait in milliseconds. close: true stops new events from entering the pipeline.

closeAndFlush#

Use this in serverless handlers, CLI commands, workers, and graceful shutdown hooks. It flushes queued events, waits for event callbacks, and closes the pipeline.

The SDK batches at flushAt events or flushInterval milliseconds, retries transient failures, and aborts a flush that exceeds its timeout. Calls after close are ignored.