Awaiting Chains
awaitChain waits for a chain to complete by combining polling with notify adapter events. Between polls, it listens for completion notifications to react immediately.
const completedChain = await client.awaitChain( { id: chainId }, { timeoutMs: 30_000, pollIntervalMs: 5_000 },);
console.log(completedChain.output); // Typed output from the final jobThrows WaitChainTimeoutError on timeout. Supports an AbortSignal for cancellation.
See examples/showcase-chain-awaiting for a complete working example demonstrating basic awaiting, parallel awaiting, timeout handling, and abort signals.