cannectors

Defaults inheritance

Hoist cross-cutting settings to the top — override per module.

When several modules in a pipeline need the same timeout, retry, or onError policy, hoist them into a top-level defaults block. Any module that doesn't redefine the same key inherits the default.

Top-level shape

defaults:
  timeoutMs: 15000
  onError: log
  retry:
    maxAttempts: 2
    delayMs: 1000
    backoffMultiplier: 2
    maxDelayMs: 10000
    retryableStatusCodes:
      - 429
      - 500
      - 503
    useRetryAfterHeader: true

All three keys are independently optional.

KeyWhat it sets
timeoutMsHTTP request timeout for every HTTP-shaped module.
onErrorDefault error policy. One of fail, skip, log.
retryDefault retry block — full object, see Retry & error handling.

Inheritance rules

Each module reads its setting in this order, first match wins:

  1. The value declared directly on the module.
  2. The value declared in top-level defaults.
  3. The module's built-in default (usually conservative — onError: fail, no retry).

For scalar settings such as timeoutMs and onError, a module-level value completely overrides the corresponding default.

For retry, inheritance is field-by-field: the top-level defaults.retry block is used as the base, then any fields declared in the module's own retry block override only those fields. This lets a module tune one retry setting without repeating the whole block.

Override example

defaults:
  timeoutMs: 15000
  onError: log
  retry:
    maxAttempts: 2
    delayMs: 1000

input:
  type: httpPolling
  schedule: "*/15 * * * *"
  endpoint: https://source.example.com/api/accounts
  # inherits timeoutMs=15000, onError=log, retry.maxAttempts=2

filters:
  - type: mapping
    onError: skip                # override: drop the record on error
    mappings: 

output:
  type: httpRequest
  endpoint: 
  method: POST
  requestMode: batch
  retry:
    maxAttempts: 4               # overrides only maxAttempts
    delayMs: 1000
    backoffMultiplier: 2

The mapping filter overrides onError only; it does not use timeoutMs or retry. The output overrides the retry fields it declares. Any retry fields omitted from the output's retry block still come from defaults.retry.

When to hoist vs duplicate

Hoist when the same value appears on two or more modules. Don't hoist a one-off — keep it on the module itself, where the reader will look for it.

Cross-references