N8N Integration Guide¶
This guide explains how to integrate Slidefactory with N8N workflows using the official N8N community node package.
Overview¶
The n8n-nodes-slidefactory package provides native N8N integration for Slidefactory's presentation generation API. This allows you to:
- Generate presentations directly from N8N workflows
- Monitor presentation generation status
- Download and share generated presentations
- Manage templates programmatically
- Build automated presentation workflows
Installation¶
Prerequisites¶
- N8N instance (cloud, self-hosted, or Docker)
- Slidefactory instance with API access
- API token with appropriate scopes
Install the Community Node¶
Option 1: Via N8N GUI (Recommended)¶
- Open your N8N instance
- Navigate to Settings → Community Nodes
- Click Install a community node
- Enter:
n8n-nodes-slidefactory - Click Install
- Wait for installation to complete
- Refresh your browser
The Slidefactory node will now appear in your node palette.
Option 2: Via npm (Self-Hosted)¶
# In your N8N installation directory
cd ~/.n8n
npm install n8n-nodes-slidefactory
# Restart N8N
n8n start
Option 3: Docker¶
Add to your docker-compose.yml:
services:
n8n:
image: n8nio/n8n
environment:
- N8N_CUSTOM_EXTENSIONS="/home/node/.n8n/custom"
volumes:
- ./n8n_data:/home/node/.n8n
command: /bin/sh -c "npm install -g n8n-nodes-slidefactory && n8n start"
Or create a custom Dockerfile:
Configuration¶
Step 1: Generate API Token¶
Create an API token for N8N integration:
# Using Docker Compose
docker-compose exec web python -m cli users create-api-key <your-username> "N8N Integration" \
--scopes "presentations:*,templates:read"
# Or using the slidefactory CLI wrapper
./slidefactory users create-api-key <your-username> "N8N Integration" \
--scopes "presentations:*,templates:read"
Required Scopes: - presentations:generate - Generate presentations - presentations:read - Get status, list, download, share - presentations:delete - Delete presentations (optional) - templates:read - List and view templates
Recommended Scope Combinations: - Read-only: templates:read,presentations:read - Standard: templates:read,presentations:generate,presentations:read - Full access: presentations:*,templates:*
The command will output a token like:
API Key created successfully:
Name: N8N Integration
Token: sf_abc123def456ghi789jkl012mno345pqr
Scopes: presentations:*, templates:read
⚠️ Important: Save this token securely. It won't be displayed again.
Step 2: Configure Credentials in N8N¶
- Create a new workflow in N8N
- Add a Slidefactory node to the canvas
- Click on the Credential for Slidefactory API dropdown
- Select Create New Credential
- Fill in the credential form:
| Field | Value | Example |
|---|---|---|
| API URL | Your Slidefactory instance URL | https://slidefactory.your-domain.com |
| API Token | Token from Step 1 | sf_abc123def456ghi789... |
- Click Save
N8N will automatically test the credentials by calling /api/presentations/list.
Step 3: Test the Integration¶
- Configure the Slidefactory node:
- Resource: Presentation
- Operation: List
- Click Execute Node
- You should see a list of presentations (may be empty if none exist)
Usage Examples¶
Example 1: Simple Presentation Generation¶
Workflow:
Slidefactory Generate Node Configuration:
{
"resource": "presentation",
"operation": "generate",
"template_id": "1",
"data": {
"title": "Test Presentation",
"date": "{{ $now.format('YYYY-MM-DD') }}",
"content": "This is a test"
}
}
Example 2: Automated Daily Reports¶
Workflow:
Schedule Trigger (Daily at 9 AM)
↓
HTTP Request (Fetch data from CRM)
↓
Code (Transform data)
↓
Slidefactory (Generate)
↓
Wait (30 seconds)
↓
Slidefactory (Get Status)
↓
IF (Status === 'finished')
↓ Yes
Slidefactory (Download)
↓
Email (Send to team)
↓ No
Error (Notify admin)
Code Node (Data Transformation):
const salesData = $input.first().json;
return {
json: {
title: `Daily Sales Report - ${new Date().toLocaleDateString()}`,
summary: {
revenue: salesData.total_revenue,
orders: salesData.order_count,
avg_order: salesData.avg_order_value
},
top_products: salesData.products.slice(0, 5).map(p => ({
name: p.name,
units: p.units_sold,
revenue: p.revenue
}))
}
};
Example 3: Webhook-Triggered Presentation¶
Workflow:
Webhook Trigger (POST /generate-presentation)
↓
Slidefactory (Generate)
↓
Slidefactory (Poll Status)
↓
Slidefactory (Share with 24h expiration)
↓
Webhook Response (Return share URL)
Webhook Trigger Configuration: - Method: POST - Path: /generate-presentation - Authentication: Basic Auth
Slidefactory Generate Node:
{
"resource": "presentation",
"operation": "generate",
"template_id": "{{ $json.body.template_id }}",
"data": "{{ $json.body.data }}",
"additionalOptions": {
"title": "{{ $json.body.title }}",
"ai_provider": "openai",
"ai_model": "gpt-4"
}
}
Example 4: Batch Generation from Spreadsheet¶
Workflow:
Manual Trigger
↓
Google Sheets (Read rows)
↓
Loop Over Items
↓
Slidefactory (Generate)
↓
Wait (5 seconds - rate limiting)
↓
Merge (Collect process IDs)
↓
Wait (60 seconds - let all complete)
↓
Loop Over Process IDs
↓
Slidefactory (Get Status)
↓
IF (Status === 'finished')
↓
Slidefactory (Download)
↓
Google Drive (Upload)
↓
Slack (Notify completion)
Example 5: Template Management¶
Workflow:
Manual Trigger
↓
Slidefactory (List Templates)
↓
Code (Filter templates by criteria)
↓
Slidefactory (Get Placeholders for selected template)
↓
Code (Generate sample data matching schema)
↓
Slidefactory (Generate test presentation)
Advanced Features¶
Polling for Completion¶
Presentations are generated asynchronously. Use polling to wait for completion:
Method 1: Simple Wait + Check
Method 2: Loop Until Complete
// Code node to check status
const status = $input.first().json.state;
if (status === 'finished' || status === 'error') {
return {
json: { complete: true, status }
};
}
return {
json: { complete: false, status }
};
Dynamic Template Selection¶
Load templates dynamically and select based on criteria:
// Code node after List Templates
const templates = $input.all();
const selectedTemplate = templates.find(t =>
t.json.workflow_folder === 'reports' &&
t.json.original_path.includes('sales')
);
return {
json: {
template_id: selectedTemplate.json.id,
template_name: selectedTemplate.json.original_path
}
};
Error Handling¶
Enable Continue On Fail for resilience:
- Select the Slidefactory node
- Go to Settings tab
- Enable Continue On Fail
- Add an error handling branch:
Slidefactory (Generate)
↓
IF (Error exists)
↓ Yes
Slack (Notify admin)
↓
Stop
↓ No
Continue workflow
Rate Limiting¶
If generating many presentations, add delays:
Recommended rates: - Light load: 2 seconds between requests - Heavy load: 5-10 seconds between requests
Using Result IDs¶
Instead of passing data directly, reference stored results:
// In Generate node
{
"template_id": "1",
"result_id": "{{ $json.result_uuid }}", // UUID from previous workflow result
"additionalOptions": {
"title": "Presentation from stored result"
}
}
API Reference¶
Presentation Operations¶
| Operation | Description | Required Fields | Returns |
|---|---|---|---|
| Generate | Create new presentation | data or result_id | process_id |
| Get Status | Check progress | processId | Status info + download_url when finished |
| List | List presentations | - | Array of presentations |
| Download | Get file as binary | processId | Binary PPTX file |
| Share | Create shareable link | processId | Temporary URL (1-24h) |
| Delete | Remove presentation | processId | Success confirmation |
Template Operations¶
| Operation | Description | Required Fields | Returns |
|---|---|---|---|
| List | List templates | - | Array of templates |
| Get | Get template details | templateId | Template metadata |
| Get Placeholders | Extract schema | templateId | Placeholder analysis + JSON schema |
Troubleshooting¶
Common Issues¶
"Invalid API key" Error¶
Symptoms: 401 Unauthorized error
Solutions: 1. Verify API token is correct 2. Check token hasn't expired 3. Ensure Slidefactory URL is correct (no trailing slash) 4. Test API token manually:
"Template not found" Error¶
Symptoms: 404 error when generating
Solutions: 1. Use List Templates operation to see available templates 2. Verify template_id is correct 3. Check API token has templates:read scope 4. Ensure template exists in database:
Presentation Stuck in "pending"¶
Symptoms: Status never changes from "pending"
Solutions: 1. Check Celery workers are running:
2. Verify AI provider credentials in Slidefactory.env 3. Check Slidefactory logs: Download Returns Empty File¶
Symptoms: Downloaded file is 0 bytes or corrupted
Solutions: 1. Verify presentation state is finished before downloading 2. Check storage backend (MinIO/Azure) is accessible 3. Review Slidefactory logs for storage errors
Debug Mode¶
Enable verbose logging in N8N:
Check N8N logs for detailed request/response info.
Best Practices¶
1. API Token Security¶
- ✅ Store tokens in N8N credentials (encrypted)
- ✅ Use minimal required scopes
- ✅ Rotate tokens periodically
- ✅ Create separate tokens per integration
- ❌ Never hardcode tokens in workflows
- ❌ Don't share tokens between environments
2. Resource Management¶
- Use Get Status before downloading to avoid unnecessary requests
- Delete old presentations periodically to save storage
- Cache template listings instead of fetching repeatedly
- Use Share URLs for external distribution instead of downloading
3. Error Handling¶
- Enable Continue On Fail for non-critical operations
- Add error notification nodes (Slack, Email)
- Log failures to external monitoring tools
- Implement retry logic for transient errors
4. Performance¶
- Poll status every 10-30 seconds (not every second)
- Add delays between batch operations
- Use Download only when needed (binary data is large)
- Leverage N8N's Binary Data mode for file handling
5. Workflow Organization¶
- Group related operations with Sticky Notes
- Name nodes descriptively ("Generate Sales Report" vs "Slidefactory")
- Use Set nodes to store intermediate values
- Document complex workflows with comments
Support¶
Resources¶
- Package README:
/packages/n8n-nodes-slidefactory/README.md - API Documentation: Check your Slidefactory instance at
/docs - User Management:
DOCUMENTATION/USER_MANAGEMENT_QUICKREF.md - Issue Tracker: GitHub Issues
Getting Help¶
- Check this guide and package README first
- Review N8N logs (
N8N_LOG_LEVEL=debug) - Check Slidefactory logs (
docker-compose logs) - Test API manually with curl/Postman
- Open an issue with:
- N8N version
- Slidefactory version
- Error messages
- Workflow JSON (redact sensitive data)
Updates¶
Updating the Node Package¶
N8N Cloud¶
Updates are automatic when a new version is published to npm.
Self-Hosted¶
# In your N8N directory
npm update n8n-nodes-slidefactory
# Or specify version
npm install n8n-nodes-slidefactory@latest
# Restart N8N
n8n start
Docker¶
Version Compatibility¶
| n8n-nodes-slidefactory | Slidefactory | N8N |
|---|---|---|
| 0.1.x | 1.0+ | 1.0+ |
Changelog¶
See packages/n8n-nodes-slidefactory/CHANGELOG.md for version history.
Questions or Issues?
Open an issue on GitHub or contact your Slidefactory administrator.