Skip to content

feat: add retryNode with exponential backoff#50

Open
haroldfabla2-hue wants to merge 1 commit intowespreadjam:mainfrom
haroldfabla2-hue:feat/retry-node
Open

feat: add retryNode with exponential backoff#50
haroldfabla2-hue wants to merge 1 commit intowespreadjam:mainfrom
haroldfabla2-hue:feat/retry-node

Conversation

@haroldfabla2-hue
Copy link

Summary

Implements retryNode as a logic primitive that wraps operations with automatic retry logic using exponential backoff.

Features

  • Configurable retries (1-10 max attempts)
  • Exponential backoff with customizable multiplier (default: 2x)
  • Max delay cap to prevent excessive waits (default: 30s)
  • Jitter (±10%) to prevent thundering herd problem
  • Selective retry via retryOn string patterns
  • Zod schemas for input/output validation
  • Unit tests included

Input Schema

{
  maxRetries: number;           // 1-10
  initialDelayMs?: number;      // default: 1000
  maxDelayMs?: number;          // default: 30000
  backoffMultiplier?: number;   // default: 2
  retryOn?: string[];           // error patterns to match
  payload?: any;                // pass-through data
}

Files Changed

  • packages/nodes/src/logic/retry.ts — Node implementation
  • packages/nodes/src/logic/retry.test.ts — Unit tests
  • packages/nodes/src/logic/index.ts — Export registration
  • packages/nodes/src/index.ts — Top-level export + builtInNodes

Closes #10

Implements retryNode as a logic primitive that wraps operations
with automatic retry logic using exponential backoff and jitter.

Features:
- Configurable maxRetries (1-10)
- Exponential backoff with customizable multiplier
- Max delay cap to prevent excessive waits
- Jitter (±10%) to prevent thundering herd
- Optional retryOn filter for specific error types
- Zod schemas for input/output validation
- Unit tests

Closes wespreadjam#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Node] retryNode - Retry failed operations with backoff

1 participant