Plug Database icon

Plug Database

Run Plug Database commands over REST or Socket.

Tools → Publish Socket Event

AI-generated

Summary

Publish a custom socket event to the Plug system using either REST or socket transport, sending a JSON payload and optional binary attachments to subscribers.

Inputs

  • Tool Category — Select a category of tools to filter or categorize the operation usage, though it is not directly related to the publishing action.
  • Publish Channel (required) — Choose the transport protocol for publishing the event: REST (via HTTP POST to /client/me/socket-events) or Socket (via socket:event.publish on /consumers).
  • Event Name (required) — Specify the exact custom event name to publish, which must start with 'client:custom:'. This identifies the event to subscribers.
  • Payload JSON (required) — Provide the JSON object to be delivered as the event payload. Use null to send a null payload.
  • Attachments — Optionally add one or more binary data properties from the workflow input to be sent inline as socket event attachments.
  • Payload Frame Compression — Set the compression preference for the payload frame when emitting the event, choosing 'Always', 'Default', or 'None' compression.
  • Idempotency Key — Optionally provide a string key to ensure idempotent publishing; reusing the same key with the same body returns the original accepted response.
  • Timeout (MS) — Specify the timeout in milliseconds for REST publishing requests; not used for socket publishing.
  • Socket ACK Timeout (MS) — Specify the timeout in milliseconds to wait for acknowledgments when publishing via socket transport.
  • Include Plug Metadata — Set whether to include the '__plug' metadata object with channel and event details in the node output.

Output shape

a single record containing the published event confirmation and optionally metadata about the channel and event

The output format depends on the chosen publish channel and includes acknowledgments or error information. If 'Include Plug Metadata' is enabled, the output contains the internal Plug event metadata.

Links

Discussion