This is an n8n community node that lets you use Twosense events in your n8n workflows.
Twosense provides continuous authentication and behavioral biometrics to secure access to your applications.
n8n is a fair-code licensed workflow automation platform.
Installation Operations Trigger Credentials Compatibility Requirements Usage Resources
Follow the installation guide in the n8n community nodes documentation.
The Twosense node provides the following actions:
Fetch Twosense events within a specific time range for batch processing or historical analysis.
- Requires start time and optional end time parameters
- Returns all events within the specified period
- Automatically handles pagination when there are many events
Retrieve detailed information about a specific Twosense session by its ID.
- Requires session ID (UUID format)
- Returns structured data with
foundindicator:found: true→ Session data (startTime, userId, device, ipAddress)found: false→ Reason why session wasn't found
- No exceptions thrown - use IF node to branch on
foundfield
Get the current Twosense trust score and trust level for a specific user.
- Requires username in
DOMAIN\usernameformat (or UPN if using Entra ID) - Returns structured data with
foundindicator:found: true→ Trust score data (trustScore 0-100, trustLevel high/medium/low, timestamp, device)found: false, reason: 'user_not_found'→ User doesn't exist in systemfound: false, reason: 'no_recent_score'→ No score within last 60 minutes
- No exceptions thrown - use IF node to branch on
foundfield
Features:
- Automatic OAuth2 token management and refresh
- Pagination support for event operations
The Twosense Trigger node polls for new Twosense events and triggers your workflow automatically when new events are detected.
- Uses n8n's built-in polling mechanism (configure the interval in the trigger settings)
- Maintains cursor state between runs to only return new events
- Ideal for monitoring and real-time alerting workflows
This node requires Twosense API credentials. You'll need to provide:
- API Base URL - Your Twosense API endpoint (e.g.,
https://webapi.twosense.ai) - Client ID - Your OAuth2 client ID
- Client Secret - Your OAuth2 client secret
Contact your Twosense administrator to obtain these credentials.
Important: For reliable state persistence, this node requires n8n to be configured with PostgreSQL as the database backend.
- Add the On New Twosense Event Trigger node to your workflow
- Configure the polling interval in the trigger settings (e.g., every 5 minutes)
- Configure your Twosense API credentials
- Connect downstream nodes to process the events
- Add the Get Twosense Events node
- Set the Start Time and optional End Time
- Connect downstream nodes to analyze the historical data
- Add the Get Twosense Trust Score node
- Enter the Username (format:
DOMAIN\username) - Use an IF node to branch on the
foundfield:found: true→ Trust score found (includestrustScore,trustLevel,device, etc.)found: false, reason: 'user_not_found'→ User doesn't existfound: false, reason: 'no_recent_score'→ No score within 60 minutes
Trust Score Response Examples:
Success (200):
{
"found": true,
"username": "DOMAIN\\user",
"timestamp": "2026-02-03T10:30:00Z",
"trustScore": 85,
"trustLevel": "high",
"device": "LAPTOP-12345"
}User not found (404):
{
"found": false,
"reason": "user_not_found",
"username": "DOMAIN\\user",
"statusCode": 404,
"message": "User not found in Twosense system"
}No recent score (204):
{
"found": false,
"reason": "no_recent_score",
"username": "DOMAIN\\user",
"statusCode": 204,
"message": "No trust score within the last 60 minutes"
}- Add the Get Twosense Session Information node
- Enter the Session ID (UUID)
- Use an IF node to branch on the
foundfield:found: true→ Session found (includesstartTime,userId,device,ipAddress)found: false, reason: 'session_not_found'→ Session doesn't exist
Session Response Examples:
Success (200):
{
"found": true,
"startTime": "2026-02-03T14:15:22Z",
"userId": "bd5fe96641d7eabd81505f604b870a8895f68166f96c525b21f87ceb49dab522",
"device": "DESKTOP-12345",
"ipAddress": "203.0.113.45"
}Session not found (404):
{
"found": false,
"reason": "session_not_found",
"sessionId": "82299c01-aec1-4b41-015f-a876cb22255d",
"statusCode": 404
}Events returned from Get Twosense Events and the Twosense Trigger include:
uuid- Unique event identifiertimestamp- When the event occurredpublished- When the event was published (used for cursor tracking)username- Associated userdevice- Device nameipAddress- Client IP addresseventType- Type of event (e.g.,user.trust_level_change,user.auth)result- Event resultreason- Event reasonaction- Action takenapplication- Application name