The Magnetite n8n integration enables you to generate AI-powered, personalized lead magnets directly within your n8n workflows. As an official community node published on npm, it seamlessly integrates with n8n's workflow automation platform to help you create dynamic content at scale.
n8n is a fair-code licensed workflow automation platform that allows you to connect over 350+ apps and services. With Magnetite's n8n node, you can automate lead magnet generation as part of complex multi-step workflows.
Before installing the Magnetite n8n node, ensure you have:
1. An n8n instance running (self-hosted or n8n.cloud)
2. A Magnetite account with an active plan
3. API access enabled on your Magnetite account
4. At least one project configured with a research agent
5. Available credits for lead magnet generation
Installing the Community Node
1. Access Community Nodes Settings
- In your n8n instance, navigate to **Settings → Community Nodes**
- This feature may need to be enabled by your n8n administrator
2. Install the Magnetite Node
- Click the **Install** button
- Enter the package name: `n8n-nodes-magnetite`
- You'll see a warning about installing unverified code - this is normal for community nodes
3. Confirm Installation
- Review the security warning and click **Install** to proceed
- The node will be downloaded and installed automatically
4. Verify Installation
- Once complete, search for "Magnetite" in your node palette
- The node should appear under the "Marketing & Content" category
For self-hosted n8n instances with restricted community node access:
bash:
# Navigate to your n8n custom folder cd ~/.n8n/custom # Install the node package npm install n8n-nodes-magnetite # Restart n8n to load the new node
Setting Up Credentials
1. Add Magnetite Credentials
- In n8n, go to **Credentials → New**
- Search for "Magnetite API"
- Click to create new credentials
2. Configure API Access
- **Name**: Give your credentials a descriptive name (e.g., "Magnetite Production")
- **API Key**: Enter your Magnetite API key
- Get this from Magnetite Dashboard → Project Settings → API & Integrations
- **Base URL**: `https://app.magnetite.ai` (default)
- Only change if using a custom domain
3. Test Connection
- Click **Test Connection** to verify your credentials
- You should see a success message if configured correctly
Finding Your Project ID
Your Project ID is required for all operations:
- Navigate to your Magnetite project
- Look at the URL: ` /dashboard/projects/[PROJECT_ID]
`
- Example: ` j57bmx51vhg9bfkc84mjvmcpnr7495mv
`
1. Generate Lead Magnet
Creates a personalized lead magnet for a specific lead.
Configuration
- **Credentials**: Select your Magnetite API credentials
- **Operation**: Choose "Generate Lead Magnet"
- **Project ID**: Enter your Magnetite project ID
Input Fields
Required Fields:
- **Email**: The lead's email address
Optional Standard Fields:
- **Full Name**: Contact's complete name
- **Company**: Organization name
- **Domain**: Company website for research
- **Industry**: Business sector or vertical
- **Company Size**: Number of employees
- **Title**: Job position or role
- **Phone**: Contact number
Custom Fields:
- **Additional Fields (JSON)**: For project-specific data
JSON:
{ "budget":"50000", "timeline": "Q1 2024", "interests": ["AI", "automation"], "customField": "value" }
Output Data
The node returns:
JSON:
{ "success": true, "leadId": "lead_abc123", "jobId": "job_xyz789", "leadMagnetUrl": "https://your-project.go.magnetite.ai/lead_abc123", "status": "processing", "message": "Lead magnet generation started" }
2. Get Status
Checks the status of a lead magnet generation job.
Configuration
- **Credentials**: Select your Magnetite API credentials
- **Operation**: Choose "Get Status"
- **Job ID**: The job ID from a previous generation
Output Data
Returns detailed status information:
```json
{
"success": true,
"jobId": "job_xyz789",
"leadId": "lead_abc123",
"status": "completed",
"leadMagnetUrl": "https://your-project.go.magnetite.ai/lead_abc123",
"progressPercentage": 100,
"currentPhase": "Complete",
"processingTime": 125,
"researchData": {
"company": "Example Corp",
"insights": ["Key insight 1", "Key insight 2"]
},
"error": null
}
```
## Workflow Examples
### Basic Lead Generation Workflow
```mermaid
graph LR
A[Webhook Trigger] --> B[Magnetite: Generate]
B --> C[Wait 2 min]
C --> D[Magnetite: Get Status]
D --> E[Send Email]
```
**Implementation Steps:**
1. **Webhook** receives lead data
2. **Magnetite Generate** creates personalized content
3. **Wait** node pauses for generation (2-3 minutes typical)
4. **Magnetite Get Status** retrieves the completed URL
5. **Email** sends the lead magnet to the contact
### CRM Integration Workflow
```mermaid
graph LR
A[CRM Trigger] --> B[Get Contact]
B --> C[Magnetite: Generate]
C --> D[Loop: Check Status]
D --> E[Update CRM]
D --> F[Send Slack Alert]
```
**Features:**
- Triggers on new CRM contacts
- Enriches with CRM data before generation
- Polls for completion status
- Updates CRM with lead magnet URL
- Notifies team via Slack
### Multi-Channel Distribution
```mermaid
graph LR
A[Form Submission] --> B[Magnetite: Generate]
B --> C[Branch on Company Size]
C --> D[Email Template A]
C --> E[Email Template B]
D --> F[Add to Sequence]
E --> F[Add to Sequence]
```
**Logic:**
- Different email templates based on company size
- Automated follow-up sequences
- Personalized distribution strategy
## Advanced Usage
### Dynamic Field Mapping
Use n8n expressions to map data dynamically:
```javascript
// In the Magnetite node's parameters:
{
"email": "{{ $json.contact.email }}",
"fullName": "{{ $json.contact.firstName }} {{ $json.contact.lastName }}",
"company": "{{ $json.company.name }}",
"additionalFields": {
"score": "{{ $json.leadScore }}",
"source": "{{ $json.utm_source }}"
}
}
```
Error Handling
Implement robust error handling:
1. **Try/Catch Pattern**
```
Try Node → Magnetite Generate → Success Path
↓ (on error)
Error Handler → Log Error → Notification
```
2. **Retry Logic**
- Use n8n's built-in retry on fail
- Set retry attempts: 3
- Wait between retries: 30 seconds
Batch Processing
Process multiple leads efficiently:
```javascript
// Split In Batches node configuration
Batch Size: 10
Operation: Generate Lead Magnet
// Add delay between batches
Wait Node: 5 seconds
```
### Conditional Generation
Only generate for qualified leads:
```javascript
// IF node condition
{{ $json.leadScore > 50 && $json.company !== null }}
// True branch: Generate lead magnet
// False branch: Add to nurture campaign
```
1. Workflow Design
- **Use Wait Nodes**: Allow 2-3 minutes for generation
- **Implement Status Checks**: Don't assume immediate completion
- **Handle Errors Gracefully**: Plan for API limits and failures
- **Log Important Events**: Track generation success/failure
2. Data Management
- **Validate Inputs**: Check required fields before sending
- **Clean Data**: Remove extra spaces, validate emails
- **Use Consistent Formats**: Standardize company names
- **Map Fields Correctly**: Ensure data types match
3. Performance Optimization
- **Batch Similar Requests**: Group by project when possible
- **Respect Rate Limits**: 10 generations/minute per API key
- **Cache Results**: Store URLs to avoid duplicate generations
- **Monitor Credit Usage**: Each generation uses 1 credit
4. Security
- **Protect API Keys**: Use n8n's credential management
- **Validate Webhooks**: Implement authentication on triggers
- **Audit Access**: Review who can execute workflows
- **Encrypt Sensitive Data**: Use n8n's encryption features
Common Issues
Node Not Appearing
- **Solution**: Restart n8n after installation
- Check community nodes are enabled in settings
- Verify installation completed successfully
Authentication Failed
- **Check**: API key is active and not revoked
- Verify Base URL has no trailing slash
- Ensure API access is enabled on your plan
Generation Failing
- **Verify**: Project has configured research agent
- Check credit balance in Magnetite dashboard
- Ensure all required fields are provided
- Review error message in node output
Slow Performance
- **Optimize**: Reduce batch sizes
- Add delays between requests
- Check n8n instance resources
- Monitor API rate limits
Debug Mode
Enable detailed logging:
1. Set n8n environment variable: `N8N_LOG_LEVEL=debug`
2. Check execution details in n8n UI
3. Review node input/output data
4. Inspect error messages and stack traces
Integration Patterns
Pattern 1: Lead Scoring Integration
```
CRM Data → Calculate Score → IF Score > Threshold → Generate Lead Magnet
↓
Low Score → Standard Nurture
```
Pattern 2: Event-Driven Generation
```
Webinar Registration → Wait Until Event Date - 1 day → Generate Custom Prep Materials
```
Pattern 3: Progressive Profiling
```
Form Submit → Check Existing Data → Merge New + Old → Generate Enhanced Content
```
Pattern 4: Multi-Language Support
```
Detect Language → Route to Project → Generate in Language → Deliver
```
Endpoints Used by Node
**Generate Lead Magnet**
```
POST /api/projects/{projectId}/generate
Authorization: Bearer {apiKey}
```
**Get Status**
```
GET /api/generation/{jobId}/status
Authorization: Bearer {apiKey}
```
Rate Limits
- Generation: 10 requests/minute
- Status: 60 requests/minute
- Burst: 20 requests/10 seconds
Tracking Success
- Monitor completion rates in n8n executions
- Track credit usage in Magnetite dashboard
- Set up alerts for failures
- Analyze generation times
Key Metrics
- Average generation time
- Success/failure ratio
- Credit consumption rate
- Workflow execution time
- **This Documentation**: Comprehensive n8n integration guide
- **n8n Community**: forum.n8n.io for workflow help
- **Magnetite Dashboard**: Monitor usage and credits
- **npm Package**: [npmjs.com/package/n8n-nodes-magnetite](https://www.npmjs.com/package/n8n-nodes-magnetite)
Current Version: 1.0.3
- Fixed credential test endpoint
- Improved connection reliability
- Enhanced error messages
- Updated documentation
Roadmap
- Webhook support for instant notifications
- Bulk generation operations
- Enhanced field mapping UI
- Template management integration
---
- [ ] n8n instance ready (self-hosted or cloud)
- [ ] Community nodes enabled
- [ ] Magnetite account with API access
- [ ] API key generated
- [ ] Project ID identified
- [ ] n8n-nodes-magnetite installed
- [ ] Credentials configured
- [ ] Test workflow created
- [ ] First lead magnet generated
- [ ] Production workflow deployed
Ready to automate your lead generation? Start building your first Magnetite workflow in n8n!