Plug Database Advanced Trigger icon

Plug Database Advanced Trigger

Listen for custom Plug Socket events.

Plug Database Advanced Trigger

AI-generated

Summary

Listen for specified Plug Socket events (custom or agent profile updates) via a persistent socket connection, emitting matched events as workflow output items with optional metadata and binary attachments.

Inputs

  • Event Source (required) — Choose the type of Plug Socket event to listen for: 'Agent Profile Updated' for client:agent.profile.updated events, or 'Custom Events' to subscribe to exact client:custom.* event names.
  • Event Names (required) — For 'Custom Events' source, provide one or more exact event names (client:custom.*) to subscribe to. Wildcards are not supported.
  • Subscription ACK Timeout (MS) — Timeout to wait for socket connection and subscription acknowledgements.
  • Reconnect On Disconnect — Whether to automatically attempt reconnect and re-subscribe after retryable socket disconnects.
  • Max Reconnect Attempts — Maximum number of reconnect attempts; 0 means unlimited retries.
  • Reconnect Failure Window (MS) — Time window used by the reconnect circuit breaker to track failures.
  • Max Reconnect Failures in Window — Maximum allowed retryable reconnect failures within the failure window before the circuit breaker opens; set 0 to disable.
  • Reconnect Initial Delay (MS) — Initial delay before the first reconnect attempt, prior to exponential backoff and jitter.
  • Reconnect Max Delay (MS) — Maximum delay between reconnect attempts after backoff and jitter.
  • Max Inflight Events — Maximum number of custom socket events to process concurrently before queuing.
  • Max Queue Size — Maximum number of events to queue while processors are busy.
  • Overflow Policy — Specifies behavior when the event queue is full: fail, drop newest, or drop oldest.
  • Require Payload Signature — Enforces that incoming events must include a valid HMAC payload signature.
  • Require Payload Signature For — Determines which event sources require payload signatures when enforcement is enabled.
  • Deduplicate Events — For custom events, whether to ignore duplicate events with the same eventId during the TTL window.
  • Deduplication TTL (MS) — Duration to remember processed event IDs for deduplication; 0 disables deduplication.
  • Manual Listen Timeout (MS) — In manual execution mode, automatically close the socket after this timeout; 0 means keep listening indefinitely.
  • Binary Property Prefix — Prefix for binary properties created from inline event attachments.
  • Include Plug Metadata — Whether to include Plug socket and event metadata within the output items under the __plug property.

Output shape

a list of items, each representing a received Plug event, including event JSON data and optionally binary attachments and metadata properties.

Emits events in real-time as they arrive via the socket connection. Concurrent event processing and queuing are governed by the maxInflightEvents and maxQueueSize parameters. Emits errors on socket failures or reconnection exhaustion. Workflow must handle socket lifecycle under manual mode if manualListenTimeoutMs is set.

Examples

Example 1: Listening for custom Plug events named client:custom.status.changed and client:custom.alert.triggered

Set Event Source to Custom Events and add both event names under Event Names. Adjust backpressure and reconnection settings as needed.

Example 2: Listening for agent profile update events from Plug servers

Set Event Source to Agent Profile Updated. No event names are needed, as it listens to client:agent.profile.updated events automatically.

Links

Discussion