AWS WebSocket icon

AWS WebSocket

Send messages to AWS API Gateway WebSocket connections

Overview

This node sends messages to AWS API Gateway WebSocket connections. It is useful for real-time communication scenarios where you need to push messages to connected clients via WebSocket, such as chat applications, live notifications, or interactive dashboards.

Use Case Examples

  1. Sending a chat message to a specific user connected via WebSocket.
  2. Pushing real-time updates or alerts to a client application through AWS API Gateway WebSocket.

Properties

Name Meaning
Connection ID The ID of the WebSocket connection to which the message will be sent.
Message The message content to send to the specified WebSocket connection.

Output

JSON

  • success - Indicates whether the message was sent successfully (true) or not (false).
  • connectionId - The ID of the WebSocket connection the message was sent to.
  • message - The message content that was sent.
  • error - Error message if sending the message failed.

Dependencies

  • AWS SDK for JavaScript (v3) - specifically @aws-sdk/client-apigatewaymanagementapi and @aws-sdk/credential-provider-ini

Troubleshooting

  • Ensure AWS credentials are correctly configured and provided; missing credentials will cause the node to throw an error.
  • Verify that the API Gateway Endpoint is correctly set in the credentials; missing or incorrect endpoint will cause an error.
  • If the connection ID is invalid or the connection is closed, sending the message will fail.
  • If the node is set to continue on fail, errors will be captured in the output JSON; otherwise, the node execution will stop on error.

Discussion