Figmation Connector
AI-generatedOverview
This node implements a WebSocket server trigger for Figma plugin events. It listens on a specified localhost port for WebSocket connections from Figma clients and triggers workflows based on selected event types such as client connections, disconnections, command receptions, and command results. This node is useful for automating workflows that respond to real-time interactions and commands from Figma plugins, for example, triggering actions when a user connects to the Figma plugin or when a command is executed within the plugin.
Use Case Examples
- Trigger a workflow when a Figma client connects to the WebSocket server to log connection details or initialize session data.
- Trigger a workflow when a command is received from the Figma plugin to process or respond to plugin commands automatically.
- Trigger a workflow when a command result is received to handle the outcome of plugin commands, such as updating a database or notifying users.
Properties
| Name | Meaning |
|---|---|
| WebSocket Port | The port number on localhost where the WebSocket server will listen for incoming connections from Figma clients. |
| Event Types | The types of events that will trigger the workflow. Options include client connections, client disconnections, command receptions, and command results. |
Output
JSON
eventType- The type of event that triggered the workflow (e.g., client_connected, client_disconnected, command_received, command_result).timestamp- The ISO timestamp when the event occurred.triggerId- A unique identifier for the trigger instance.command- The command received from the Figma plugin (present for command_received events).params- Parameters associated with the received command (present for command_received events).commandId- The unique ID of the command or command result.result- The result data of a command (present for command_result events).clientInfo- Information about the connected or disconnected client (present for client_connected and client_disconnected events).connectedClients- List of currently connected clients at the time of the event (present for client_connected and client_disconnected events).sourceType- Indicates the source of the event, always 'figma_plugin'.websocketUrl- The URL of the WebSocket server (present in the initial trigger activation event).status- Status of the WebSocket server connection (present in the initial trigger activation event).message- Informational message about the trigger activation status.
Dependencies
- Requires a WebSocket server running on localhost and the ability to open the specified port.
Troubleshooting
- If the specified WebSocket port is already in use, the node will throw an error indicating the port conflict. To resolve, choose a different port or free the port.
- Ensure the WebSocket server is accessible only on localhost as the node binds to localhost for security.
- If no events are triggering, verify that the event types selected in the node settings match the events being emitted by the Figma plugin.
- Check network/firewall settings to ensure localhost WebSocket connections are allowed.
