Why Identify Matters
When you callidentify(), you’re telling Runflow who is interacting with your agent. This single call connects three critical systems:
- Memory — conversation history is stored and retrieved by this identifier. Same identifier = same conversation history.
- Traces — all execution traces are linked to this user, so you can search and filter by user in the dashboard.
- Metrics — business events emitted with
track()are associated with this user.
identify(), your agent still works, but memory won’t persist correctly between sessions and your dashboard data won’t be linked to specific users.
Basic Usage
Smart Identification (Auto-Detection)
New in v2.1: Theidentify() function now auto-detects entity type from value format:
- Email: Standard RFC 5322 format
- Phone: E.164 format (with/without +, with/without formatting)
- UUID: Standard UUID v1-v5
- URL: With or without protocol
- Fallback: Generic
idtype for custom identifiers
Explicit Identification
For custom entity types or when auto-detection is not desired:Common Patterns
WhatsApp / Phone Integration
The phone number is the natural identifier. Memory persists across all conversations with the same number:Email-Based
For web apps or email integrations:Multi-Conversation
When the same user can have multiple independent conversations (e.g., different support tickets):Integration Webhooks
Parse the identifier from the webhook payload:Backward Compatibility
The oldRunflow.identify() API still works but is not recommended. Prefer the direct import:
State Management
Next Steps
Best Practices
Identify patterns and more tips
Memory
Learn about memory management
Observability
Track execution with observability
Quick Start
See identify in action