Getting Authentication Data from Chat Trigger Node

Problem

The Chat Trigger is a powerful node for creating interactive workflows. However, it currently lacks the ability to identify the n8n user who initiates the chat, even when authentication is required. This limits its potential for building personalized and context-aware internal tools.

Chat Trigger Login

The Chat Trigger node includes a crucial setting under Authentication: “n8n User Auth”.

By enabling this option, we ensure that only logged-in n8n users can interact with the chat. This means that n8n already has the user’s identity verified at the very start of the workflow.

Despite this, the user’s information (like their username, email, ID, or name) is not passed into the workflow’s execution data. This feels like a missed opportunity, as the most difficult part—authentication—is already handled.

Proposed Solution

I propose to enrich the data output by the Chat Trigger with the details of the authenticated user when the “n8n user account” authentication method is selected.

Ideally, the trigger’s output JSON could be augmented with a user object.

For example:

{
  "user": {
    "id": "cGFzaWVudG9yOnNldGJhc2g=",
    "username": "[email protected]",
    "firstName": "John",
    "lastName": "Doe"
  },
  "chatInput": "I need help with my last order",
  "sessionId": "ca9b9930308f474c9ea8a88d494d078b",
  "action": "sendMessage"
}

Use Cases and Benefits

This feature would unlock several valuable use cases:

  1. Personalization: Greet the user by their name ("Hello, John!") to create a more welcoming and human experience.

  2. User-Specific Actions: Use the user’s email or ID to query internal databases, CRMs, or APIs to fetch their specific data (e.g., look up their support tickets, retrieve their order history, etc.).

  3. Conditional Logic: Route the workflow down different paths based on the user’s identity or role. For example, an “admin” user might see different chat options than a “viewer”.

  4. Auditing and Logging: Easily log which user performed specific actions through the chat interface, improving security and traceability for internal processes.

Thank you for considering this feature request.