Hookway

Redis kv — destinations/redis_kv

# examples/destinations/redis_kv.yaml
#
# Reference config for a Redis / Valkey key-value destination (redis_kv).
#
# redis_kv stores each webhook under a computed Redis key via SET. Default
# publish.payload (envelope) writes a JSON-encoded Message. Set
# publish.payload: object to SET decoded file bytes instead (same body
# contract as S3 object mode; see examples/multipart-split.yaml).
# This is a key-value store, NOT a queue:
#   - Each write overwrites the previous value at that key.
#   - There is no consumer group, ordering guarantee, or replay capability.
#
# Best for: latest-event caches, ephemeral state, or small binary blobs where
# only the most recent value matters. For durable, ordered delivery use
# redis_stream or redis_list.
#
# Key template / TTL:
#   redis_options.key_template and redis_options.ttl are not publish-node
#   fields. The publisher default template is "{prefix}:{endpoint}:{id}"
#   (endpoint = flow name). TTL is 0 (no expiry) unless set some other way.
#   max_len and consumer_group are invalid for redis_kv.
#
# Valkey is fully supported; point redis.url at a Valkey node.

server:
  addr: ":8080"
  max_body_bytes: 1048576

destinations:
  events:
    type: redis_kv

    redis:
      # ── Single-node / proxy mode (default) ────────────────────────────────
      mode: single          # single | cluster | sentinel
      url: "${REDIS_URL}"   # redis:// or rediss:// URL; set REDIS_URL in env

      # ── Cluster mode (uncomment and populate addrs; remove url) ───────────
      # mode: cluster
      # addrs:
      #   - "redis-1:6379"
      #   - "redis-2:6379"
      #   - "redis-3:6379"

      # ── Sentinel mode (uncomment; remove url; set master_name) ────────────
      # mode: sentinel
      # addrs:
      #   - "sentinel-1:26379"
      #   - "sentinel-2:26379"
      # master_name: "mymaster"

      # ── Optional auth ─────────────────────────────────────────────────────
      # username: "myuser"       # optional; only if your Redis requires auth (or reference an env var you export)
      # password: "mypassword"

      # ── Optional database index (single/sentinel only; cluster ignores it) ─
      # db: 0

      # ── Optional key prefix (substituted into {prefix} in key_template) ───
      # key_prefix: "hookway"

      # ── Optional TLS (required for rediss:// or private-CA servers) ───────
      # tls:
      #   enabled: false
      #   # For private / self-signed CAs:
      #   # ca_cert: "/etc/ssl/certs/redis-ca.pem"
      #   # Mutual TLS — both must be set together:
      #   # client_cert: "/etc/ssl/certs/redis-client.pem"
      #   # client_key:  "/etc/ssl/private/redis-client.key"
      #   # Override the server's SNI name:
      #   # server_name: "redis.internal"
      #   # Dev only — disables certificate verification; never use in production:
      #   # insecure_skip_verify: false

flows:
  # Webhook events stored as SET key-value pairs. Each delivery overwrites the
  # key at the default template; YAML does not set a TTL.
  webhook_events:
    nodes:
      - {id: in, type: http_trigger, path: /webhooks/events, methods: [POST]}
      - {id: body, type: read_body, max_bytes: 1048576}
      - {id: auth, type: auth, scheme: hmac_sha256_hex, secret: "${WEBHOOK_SECRET}", signature_header: X-Hub-Signature-256}
      - {id: env, type: envelope, body_format: json}
      # Publish target (used as {target} if a custom template existed). Must
      # match ^[a-zA-Z0-9._-]{1,128}$
      # Previously set redis_options.ttl: 168h and
      # key_template: "{prefix}:{endpoint}:{id}" (not publish-node fields).
      # Default template still applies; TTL is unset (no expiry).
      - {id: out, type: publish, destination: events, target: webhooks.kv, create: true}
    edges: [in>body, body>auth, auth>env, env>out]