Package Information
Documentation
n8n-nodes-leanplum
[Velocity BPA Licensing Notice]
This n8n node is licensed under the Business Source License 1.1 (BSL 1.1).
Use of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.
For licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.
A comprehensive n8n community node for Leanplum, the multi-channel customer engagement platform for mobile-first growth. This node enables workflow automation for user management, messaging campaigns, A/B testing, push notifications, in-app messaging, email, and behavioral analytics.
Features
- User Management: Set/get user attributes, track events, track purchases, manage sessions
- Message Campaigns: Create, manage, and schedule multi-channel messaging campaigns
- Campaign Management: Create and manage lifecycle, scheduled, and triggered campaigns
- Push Notifications: Send targeted push notifications with platform-specific options
- In-App Messages: Create and manage in-app messaging experiences
- Segmentation: Build and manage user segments with attribute, behavior, and event filters
- A/B Testing: Create and analyze A/B tests with statistical significance tracking
- Event Tracking: Track custom events and user behaviors with batch support
- Variables: Manage personalized content variables
- Data Export: Export data to Amazon S3 or Google Cloud Storage
Installation
Community Nodes (Recommended)
- Open n8n
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-leanplum - Click Install
Manual Installation
# Navigate to your n8n installation directory
cd ~/.n8n
# Install the node
npm install n8n-nodes-leanplum
Development Installation
# Clone the repository
git clone https://github.com/Velocity-BPA/n8n-nodes-leanplum.git
cd n8n-nodes-leanplum
# Install dependencies
npm install
# Build the project
npm run build
# Link to n8n
mkdir -p ~/.n8n/custom
ln -s $(pwd) ~/.n8n/custom/n8n-nodes-leanplum
# Restart n8n
Credentials Setup
To use this node, you need to set up Leanplum API credentials:
| Field | Description |
|---|---|
| App ID | Your Leanplum Application ID |
| Production Key | API key for production environment |
| Development Key | API key for development/testing (optional) |
| Data Export Key | API key for export operations (optional) |
| Environment | Select production or development |
Obtaining API Keys
- Log into your Leanplum Dashboard
- Navigate to App Settings > Keys & Settings
- View or generate API keys by type
- Copy the App ID and appropriate keys
Resources & Operations
User Resource (12 operations)
- Set User Attributes
- Get User Attributes
- Advance State
- Track Event
- Track Purchase
- Increment User Attribute
- Delete User
- Get User
- Pause Session
- Resume Session
- Set Device Attributes
- Unset User Attribute
Message Resource (14 operations)
- Create, Get, Get Many, Update, Delete
- Duplicate, Archive, Unarchive
- Get Stats, Pause, Resume
- Schedule, Send Now, Get Variants
Campaign Resource (12 operations)
- Create, Get, Get Many, Update, Delete
- Start, Stop, Pause
- Get Report, Get Conversions, Get Retention
- Duplicate
Push Notification Resource (10 operations)
- Send, Send to User, Send to Segment
- Schedule, Cancel
- Get Delivery Stats
- Create/Get/Update/Delete Templates
In-App Message Resource (10 operations)
- Create, Get, Get Many, Update, Delete
- Preview, Get Stats
- Duplicate, Activate, Deactivate
Segment Resource (9 operations)
- Create, Get, Get Many, Update, Delete
- Get Users, Get Size
- Export, Duplicate
A/B Test Resource (11 operations)
- Create, Get, Get Many, Update, Delete
- Start, Stop
- Get Results, Declare Winner
- Get Variants, Update Variant
Event Resource (9 operations)
- Track, Track Batch
- Get Events, Get Event Properties, Get Event Counts
- Create Event, Update Event, Delete Event
- Export Events
Variable Resource (6 operations)
- Set Variables, Get Variables
- Get Defaults, Sync
- Get Many for User, Force Content Update
Export Resource (6 operations)
- Export Data, Get Export Job, Get Export Jobs
- Cancel Export, Get Data Schema, Download Export
Trigger Node
The Leanplum Trigger node allows you to start workflows when Leanplum events occur:
session.start- User session startedsession.end- User session endedevent.tracked- Custom event trackedpurchase.made- Purchase completedmessage.sent- Message sent to usermessage.opened- Message openedmessage.clicked- Message link clickedpush.delivered- Push notification deliveredpush.opened- Push notification openedinapp.displayed- In-app message showninapp.dismissed- In-app message closedstate.changed- User state changedattribute.changed- User attribute updated
Webhook Configuration
- In n8n, add a Leanplum Trigger node to your workflow
- Copy the webhook URL provided
- In Leanplum, navigate to Data Export > Webhooks
- Create a new webhook with the n8n URL
- Select events to subscribe to
- Optionally configure a webhook secret for verification
Usage Examples
Track a User Event
// Track a custom event for a user
{
"resource": "user",
"operation": "track",
"userId": "user-12345",
"event": "item_viewed",
"additionalFields": {
"value": 29.99,
"params": {
"item_id": "SKU-001",
"category": "electronics"
}
}
}
Send a Push Notification
// Send a push notification to a user
{
"resource": "pushNotification",
"operation": "sendToUser",
"userId": "user-12345",
"message": "Your order has shipped!",
"title": "Order Update",
"data": {
"orderId": "ORD-789",
"trackingUrl": "https://example.com/track/789"
}
}
Create a Segment
// Create a user segment
{
"resource": "segment",
"operation": "create",
"name": "High-Value Users",
"additionalFields": {
"description": "Users with purchase value > $100",
"filters": {
"attributeFilters": [{
"attribute": "total_purchase_value",
"operator": "greaterThan",
"value": 100
}]
}
}
}
Leanplum Concepts
API Keys
Leanplum uses different API keys for different purposes:
- Production Key: Full access for production operations
- Development Key: Limited access for development/testing
- Data Export Key: Access to export endpoints only
Multi-Action Batching
The node supports batching up to 50 actions in a single API request, reducing API calls and improving efficiency.
Rate Limits
- Standard: 10 requests/second
- Enterprise: Higher limits per contract
- Export: 1 concurrent job
Error Handling
The node provides detailed error messages from the Leanplum API:
Invalid App ID: Incorrect appId parameterInvalid client key: Wrong API key for operationRate limit exceeded: Too many requestsUser not found: Invalid userIdMessage not found: Invalid messageId
Security Best Practices
- Store credentials securely: Use n8n's credential management
- Use appropriate keys: Use development keys for testing
- Verify webhooks: Configure webhook secrets for trigger nodes
- Limit data access: Use data export keys only for export operations
Development
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
# Build
npm run build
Author
Velocity BPA
- Website: velobpa.com
- GitHub: Velocity-BPA
Licensing
This n8n community node is licensed under the Business Source License 1.1.
Free Use
Permitted for personal, educational, research, and internal business use.
Commercial Use
Use of this node within any SaaS, PaaS, hosted platform, managed service,
or paid automation offering requires a commercial license.
For licensing inquiries:
licensing@velobpa.com
See LICENSE, COMMERCIAL_LICENSE.md, and LICENSING_FAQ.md for details.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code passes linting and tests before submitting.
Support
- Documentation: Leanplum API Documentation
- Issues: GitHub Issues
- Commercial Support: licensing@velobpa.com