XMPP Trigger

Triggers on incoming XMPP messages (type=chat or groupchat)

Overview

This node triggers workflows based on incoming XMPP messages, supporting both one-on-one chat and multi-user chat (MUC) group messages. It connects to an XMPP server using provided credentials and listens for new messages. If configured, it can join a specified MUC room and listen for groupchat messages there.

Common scenarios include:

  • Automating responses or processing of direct chat messages from users.
  • Monitoring and reacting to messages in group chat rooms, such as team collaboration channels.
  • Integrating XMPP-based communication into broader automation workflows.

For example, you could use this node to trigger a workflow whenever a user sends a direct message asking for support, or when a message is posted in a project’s group chat room.

Properties

Name Meaning
Join MUC (Room JID) Optional. The JID of the multi-user chat room to join (e.g., room@conference.example.com). If set, the node listens for groupchat messages in that room.
Nickname in Room The nickname to use when joining the MUC room. Defaults to "n8n".
Emit Raw XML Boolean flag indicating whether to include the raw XMPP stanza XML in the output under the raw field.

Output

The node outputs JSON objects representing incoming XMPP messages with the following structure:

{
  "from": "string",        // The sender's full JID (e.g., user@domain/resource)
  "to": "string",          // The recipient's JID
  "body": "string",        // The text content of the message
  "type": "chat" | "groupchat", // Message type: either direct chat or group chat
  "timestamp": "string",   // ISO timestamp of when the message was received
  "id": "string",          // Optional message ID if present
  "raw": "string"          // Optional raw XML stanza string if 'Emit Raw XML' is enabled
}

If the "Emit Raw XML" option is enabled, the raw XMPP stanza XML is included in the raw field, which can be useful for debugging or advanced processing.

The node does not output binary data.

Dependencies

  • Requires an XMPP server connection with valid credentials including service URL, JID, password, and optionally resource.
  • Needs an API key credential or equivalent authentication configured in n8n to connect securely to the XMPP server.
  • Uses the @xmpp/client library internally to handle XMPP protocol communication.

Troubleshooting

  • Missing or invalid credentials: The node will throw an error if the required XMPP credentials are not properly configured or incomplete.
  • Invalid JID format: The node expects the JID in the form user@domain[/resource]. An incorrect format will cause an error.
  • Connection errors: Network issues or incorrect service URLs may cause connection failures. Check the XMPP server availability and credentials.
  • Message filtering: If no messages appear, verify the "Join MUC" setting and ensure the node is listening to the correct room or chat type.
  • Self-message dropping: By default, the node ignores messages sent by itself to avoid loops. This behavior can affect testing if sending messages from the same JID.

Links and References

Discussion