@roomi-fields/notebooklm-mcp 1.3.6 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +71 -34
- package/deployment/INDEX.md +292 -0
- package/deployment/PACKAGE-FILES.txt +180 -0
- package/deployment/QUICK-START.md +100 -0
- package/deployment/docs/01-INSTALL.md +611 -0
- package/deployment/docs/02-CONFIGURATION.md +404 -0
- package/deployment/docs/03-API.md +1691 -0
- package/deployment/docs/04-N8N-INTEGRATION.md +373 -0
- package/deployment/docs/05-TROUBLESHOOTING.md +429 -0
- package/deployment/docs/06-NOTEBOOK-LIBRARY.md +692 -0
- package/deployment/docs/07-AUTO-DISCOVERY.md +236 -0
- package/deployment/docs/08-WSL-USAGE.md +363 -0
- package/deployment/docs/09-MULTI-INTERFACE.md +293 -0
- package/deployment/docs/10-CONTENT-MANAGEMENT.md +421 -0
- package/deployment/docs/11-MULTI-ACCOUNT.md +295 -0
- package/deployment/docs/README.md +207 -0
- package/deployment/scripts/README.md +564 -0
- package/deployment/scripts/install.ps1 +114 -0
- package/deployment/scripts/setup-auth.ps1 +217 -0
- package/deployment/scripts/start-server.ps1 +72 -0
- package/deployment/scripts/stop-server.ps1 +51 -0
- package/deployment/scripts/test-api.ps1 +651 -0
- package/deployment/scripts/test-auth.ps1 +323 -0
- package/deployment/scripts/test-auto-discovery.ps1 +295 -0
- package/deployment/scripts/test-cors.ps1 +398 -0
- package/deployment/scripts/test-errors.ps1 +581 -0
- package/deployment/scripts/test-server.ps1 +140 -0
- package/deployment/scripts/test-sessions.ps1 +426 -0
- package/deployment/scripts/test-validation.ps1 +299 -0
- package/dist/accounts/account-manager.d.ts +163 -0
- package/dist/accounts/account-manager.d.ts.map +1 -0
- package/dist/accounts/account-manager.js +614 -0
- package/dist/accounts/account-manager.js.map +1 -0
- package/dist/accounts/auto-login-manager.d.ts +62 -0
- package/dist/accounts/auto-login-manager.d.ts.map +1 -0
- package/dist/accounts/auto-login-manager.js +537 -0
- package/dist/accounts/auto-login-manager.js.map +1 -0
- package/dist/accounts/crypto.d.ts +45 -0
- package/dist/accounts/crypto.d.ts.map +1 -0
- package/dist/accounts/crypto.js +138 -0
- package/dist/accounts/crypto.js.map +1 -0
- package/dist/accounts/index.d.ts +14 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +14 -0
- package/dist/accounts/index.js.map +1 -0
- package/dist/accounts/types.d.ts +103 -0
- package/dist/accounts/types.d.ts.map +1 -0
- package/dist/accounts/types.js +7 -0
- package/dist/accounts/types.js.map +1 -0
- package/dist/auth/auth-manager.d.ts +9 -2
- package/dist/auth/auth-manager.d.ts.map +1 -1
- package/dist/auth/auth-manager.js +60 -6
- package/dist/auth/auth-manager.js.map +1 -1
- package/dist/auto-discovery/auto-discovery.d.ts.map +1 -1
- package/dist/auto-discovery/auto-discovery.js +2 -1
- package/dist/auto-discovery/auto-discovery.js.map +1 -1
- package/dist/cli/accounts.d.ts +13 -0
- package/dist/cli/accounts.d.ts.map +1 -0
- package/dist/cli/accounts.js +195 -0
- package/dist/cli/accounts.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -0
- package/dist/config.js.map +1 -1
- package/dist/content/content-generator.d.ts +153 -0
- package/dist/content/content-generator.d.ts.map +1 -0
- package/dist/content/content-generator.js +637 -0
- package/dist/content/content-generator.js.map +1 -0
- package/dist/content/content-manager.d.ts +364 -0
- package/dist/content/content-manager.d.ts.map +1 -0
- package/dist/content/content-manager.js +3841 -0
- package/dist/content/content-manager.js.map +1 -0
- package/dist/content/content-templates.d.ts +183 -0
- package/dist/content/content-templates.d.ts.map +1 -0
- package/dist/content/content-templates.js +719 -0
- package/dist/content/content-templates.js.map +1 -0
- package/dist/content/index.d.ts +14 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +14 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/types.d.ts +285 -0
- package/dist/content/types.d.ts.map +1 -0
- package/dist/content/types.js +10 -0
- package/dist/content/types.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/http-wrapper.d.ts +7 -0
- package/dist/http-wrapper.d.ts.map +1 -1
- package/dist/http-wrapper.js +449 -29
- package/dist/http-wrapper.js.map +1 -1
- package/dist/i18n/en.json +120 -0
- package/dist/i18n/fr.json +120 -0
- package/dist/i18n/index.d.ts +168 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +213 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/library/notebook-library.d.ts +4 -0
- package/dist/library/notebook-library.d.ts.map +1 -1
- package/dist/library/notebook-library.js +20 -3
- package/dist/library/notebook-library.js.map +1 -1
- package/dist/session/browser-session.d.ts +35 -8
- package/dist/session/browser-session.d.ts.map +1 -1
- package/dist/session/browser-session.js +243 -28
- package/dist/session/browser-session.js.map +1 -1
- package/dist/session/session-manager.d.ts +6 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +46 -14
- package/dist/session/session-manager.js.map +1 -1
- package/dist/session/shared-context-manager.d.ts +3 -3
- package/dist/session/shared-context-manager.d.ts.map +1 -1
- package/dist/session/shared-context-manager.js +10 -7
- package/dist/session/shared-context-manager.js.map +1 -1
- package/dist/stdio-http-proxy.d.ts +24 -0
- package/dist/stdio-http-proxy.d.ts.map +1 -0
- package/dist/stdio-http-proxy.js +592 -0
- package/dist/stdio-http-proxy.js.map +1 -0
- package/dist/tools/index.d.ts +106 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1028 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/types.d.ts +81 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/citation-extractor.d.ts +66 -0
- package/dist/utils/citation-extractor.d.ts.map +1 -0
- package/dist/utils/citation-extractor.js +492 -0
- package/dist/utils/citation-extractor.js.map +1 -0
- package/dist/utils/page-utils.d.ts +8 -0
- package/dist/utils/page-utils.d.ts.map +1 -1
- package/dist/utils/page-utils.js +112 -8
- package/dist/utils/page-utils.js.map +1 -1
- package/docs/ADDING_A_LANGUAGE.md +209 -0
- package/docs/ARCHITECTURE_MIGRATION_STUDY.md +894 -0
- package/docs/CHROME_PROFILE_LIMITATION.md +15 -1
- package/docs/MULTI_ACCOUNT_SYSTEM.md +304 -0
- package/package.json +15 -12
- package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
- package/scripts/archive/add-new-notebook.ps1 +25 -0
- package/scripts/archive/add-rom1pey.ps1 +2 -0
- package/scripts/archive/add-rpmonster.ps1 +2 -0
- package/scripts/archive/add-source-debug.ps1 +11 -0
- package/scripts/archive/add-source-e2e.ps1 +28 -0
- package/scripts/archive/add-source-visible.ps1 +11 -0
- package/scripts/archive/add-test-notebook.ps1 +13 -0
- package/scripts/archive/add-test-source.ps1 +50 -0
- package/scripts/archive/capture-screen.ps1 +11 -0
- package/scripts/archive/change-language.mjs +45 -0
- package/scripts/archive/change-language.ts +44 -0
- package/scripts/archive/check-account.ps1 +19 -0
- package/scripts/archive/check-notebook-2.ps1 +8 -0
- package/scripts/archive/check-test-notebook.ps1 +11 -0
- package/scripts/archive/create-notebook-auto.ps1 +31 -0
- package/scripts/archive/create-notebook.ps1 +8 -0
- package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
- package/scripts/archive/create-rom1pey.ps1 +8 -0
- package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
- package/scripts/archive/create-test-notebook.ps1 +16 -0
- package/scripts/archive/debug-add-source-auto.ps1 +29 -0
- package/scripts/archive/debug-add-source.ps1 +19 -0
- package/scripts/archive/debug-add-text-source.ps1 +47 -0
- package/scripts/archive/debug-home.ps1 +10 -0
- package/scripts/archive/debug-selectors.ps1 +55 -0
- package/scripts/archive/debug-sources-panel.ps1 +22 -0
- package/scripts/archive/debug-ui.ps1 +17 -0
- package/scripts/archive/discover-home.ps1 +26 -0
- package/scripts/archive/kill-automation-chrome.ps1 +37 -0
- package/scripts/archive/list-my-notebooks.ps1 +27 -0
- package/scripts/archive/navigate-home-visible.ps1 +23 -0
- package/scripts/archive/navigate-home.ps1 +15 -0
- package/scripts/archive/run-e2e-english.ps1 +111 -0
- package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
- package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
- package/scripts/archive/setup-english-test.ps1 +36 -0
- package/scripts/archive/setup-test-notebook.ps1 +71 -0
- package/scripts/archive/simple-add-source.ps1 +14 -0
- package/scripts/archive/t10.ps1 +2 -0
- package/scripts/archive/t20.ps1 +4 -0
- package/scripts/archive/t30.ps1 +9 -0
- package/scripts/archive/t31.ps1 +11 -0
- package/scripts/archive/t32.ps1 +6 -0
- package/scripts/archive/t39.ps1 +5 -0
- package/scripts/archive/t40.ps1 +5 -0
- package/scripts/archive/t53.ps1 +12 -0
- package/scripts/archive/t54.ps1 +12 -0
- package/scripts/archive/t55.ps1 +11 -0
- package/scripts/archive/t9.ps1 +1 -0
- package/scripts/archive/test-access.ps1 +28 -0
- package/scripts/archive/test-add-delete-source.ps1 +64 -0
- package/scripts/archive/test-add-source-visible.ps1 +16 -0
- package/scripts/archive/test-add-source.ps1 +19 -0
- package/scripts/archive/test-add-text-debug.ps1 +28 -0
- package/scripts/archive/test-add-text-source.ps1 +8 -0
- package/scripts/archive/test-add-url-source.ps1 +7 -0
- package/scripts/archive/test-ask-ascii.ps1 +20 -0
- package/scripts/archive/test-ask-cnv.ps1 +20 -0
- package/scripts/archive/test-ask-headed.ps1 +51 -0
- package/scripts/archive/test-ask-ifs.ps1 +16 -0
- package/scripts/archive/test-ask-now.ps1 +24 -0
- package/scripts/archive/test-ask-real.ps1 +19 -0
- package/scripts/archive/test-ask-visible.ps1 +20 -0
- package/scripts/archive/test-create-notebook.ps1 +8 -0
- package/scripts/archive/test-create-then-add.ps1 +17 -0
- package/scripts/archive/test-delete-source.ps1 +41 -0
- package/scripts/archive/test-e2e-notebook.ps1 +21 -0
- package/scripts/archive/test-english-notebook.ps1 +20 -0
- package/scripts/archive/test-english.ps1 +7 -0
- package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
- package/scripts/archive/test-full-infographic.ps1 +34 -0
- package/scripts/archive/test-full-language.ps1 +21 -0
- package/scripts/archive/test-full-presentation.ps1 +85 -0
- package/scripts/archive/test-full-report.ps1 +34 -0
- package/scripts/archive/test-full-source-selection.ps1 +35 -0
- package/scripts/archive/test-full-video-brief.ps1 +22 -0
- package/scripts/archive/test-full-video-explainer.ps1 +22 -0
- package/scripts/archive/test-full-video-styles.ps1 +37 -0
- package/scripts/archive/test-generate-report.ps1 +15 -0
- package/scripts/archive/test-generate-study-guide.ps1 +11 -0
- package/scripts/archive/test-headed-ask.ps1 +13 -0
- package/scripts/archive/test-headed-now.ps1 +9 -0
- package/scripts/archive/test-headed.ps1 +9 -0
- package/scripts/archive/test-hello.ps1 +7 -0
- package/scripts/archive/test-i18n-studio.ps1 +8 -0
- package/scripts/archive/test-i18n.ps1 +7 -0
- package/scripts/archive/test-manual-headed.ps1 +26 -0
- package/scripts/archive/test-mathieu-quota.ps1 +8 -0
- package/scripts/archive/test-notebook-1.ps1 +10 -0
- package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
- package/scripts/archive/test-notebook1.ps1 +14 -0
- package/scripts/archive/test-personal-notebook.ps1 +14 -0
- package/scripts/archive/test-rate-limit.ps1 +19 -0
- package/scripts/archive/test-real-ask.ps1 +50 -0
- package/scripts/archive/test-real-ask2.ps1 +30 -0
- package/scripts/archive/test-rom1pey.ps1 +7 -0
- package/scripts/archive/test-rotation-complete.ps1 +14 -0
- package/scripts/archive/test-rotation.ps1 +8 -0
- package/scripts/archive/test-show-browser.ps1 +39 -0
- package/scripts/archive/test-update-notebook.ps1 +4 -0
- package/scripts/archive/verify-language-slow.ps1 +21 -0
- package/scripts/archive/verify-language.ps1 +15 -0
- package/scripts/check-server.ps1 +46 -0
- package/scripts/mcp-wsl-helper.sh +146 -0
- package/scripts/start-server.ps1 +94 -0
- package/scripts/stop-server.ps1 +30 -0
- package/scripts/switch-account-language.sh +191 -0
- package/scripts/test-account.ps1 +58 -0
- package/dist/__tests__/cleanup-manager.test.d.ts +0 -2
- package/dist/__tests__/cleanup-manager.test.d.ts.map +0 -1
- package/dist/__tests__/cleanup-manager.test.js +0 -341
- package/dist/__tests__/cleanup-manager.test.js.map +0 -1
- package/dist/__tests__/config-parsing.test.d.ts +0 -2
- package/dist/__tests__/config-parsing.test.d.ts.map +0 -1
- package/dist/__tests__/config-parsing.test.js +0 -338
- package/dist/__tests__/config-parsing.test.js.map +0 -1
- package/dist/__tests__/config.test.d.ts +0 -2
- package/dist/__tests__/config.test.d.ts.map +0 -1
- package/dist/__tests__/config.test.js +0 -267
- package/dist/__tests__/config.test.js.map +0 -1
- package/dist/__tests__/errors.test.d.ts +0 -2
- package/dist/__tests__/errors.test.d.ts.map +0 -1
- package/dist/__tests__/errors.test.js +0 -166
- package/dist/__tests__/errors.test.js.map +0 -1
- package/dist/__tests__/logger.test.d.ts +0 -2
- package/dist/__tests__/logger.test.d.ts.map +0 -1
- package/dist/__tests__/logger.test.js +0 -324
- package/dist/__tests__/logger.test.js.map +0 -1
- package/dist/__tests__/page-utils.test.d.ts +0 -2
- package/dist/__tests__/page-utils.test.d.ts.map +0 -1
- package/dist/__tests__/page-utils.test.js +0 -349
- package/dist/__tests__/page-utils.test.js.map +0 -1
- package/dist/__tests__/setup-verification.test.d.ts +0 -2
- package/dist/__tests__/setup-verification.test.d.ts.map +0 -1
- package/dist/__tests__/setup-verification.test.js +0 -15
- package/dist/__tests__/setup-verification.test.js.map +0 -1
- package/dist/__tests__/stealth-utils.test.d.ts +0 -2
- package/dist/__tests__/stealth-utils.test.d.ts.map +0 -1
- package/dist/__tests__/stealth-utils.test.js +0 -413
- package/dist/__tests__/stealth-utils.test.js.map +0 -1
- package/dist/__tests__/types.test.d.ts +0 -2
- package/dist/__tests__/types.test.d.ts.map +0 -1
- package/dist/__tests__/types.test.js +0 -461
- package/dist/__tests__/types.test.js.map +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# n8n Integration - NotebookLM MCP HTTP Server
|
|
2
|
+
|
|
3
|
+
> Complete guide for integrating NotebookLM into your n8n workflows
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Overview
|
|
8
|
+
|
|
9
|
+
This guide shows you how to query NotebookLM from n8n to create powerful automation workflows.
|
|
10
|
+
|
|
11
|
+
**What you'll learn:**
|
|
12
|
+
|
|
13
|
+
- HTTP Request node configuration
|
|
14
|
+
- Complete workflow examples
|
|
15
|
+
- Error handling
|
|
16
|
+
- Best practices
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📋 Prerequisites
|
|
21
|
+
|
|
22
|
+
1. ✅ NotebookLM MCP HTTP server running on your Windows PC
|
|
23
|
+
2. ✅ n8n installed (Docker, npm, or cloud)
|
|
24
|
+
3. ✅ Network: Windows PC and n8n server can communicate
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 🔧 Basic Configuration
|
|
29
|
+
|
|
30
|
+
### Step 1: Find the Server IP
|
|
31
|
+
|
|
32
|
+
On the Windows PC where the server is running:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
ipconfig
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Note the **IPv4** (e.g., `192.168.1.52`)
|
|
39
|
+
|
|
40
|
+
### Step 2: Test the Connection
|
|
41
|
+
|
|
42
|
+
From the n8n server:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
curl http://192.168.1.52:3000/health
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If it works, proceed to step 3. Otherwise, see [Troubleshooting](#-troubleshooting).
|
|
49
|
+
|
|
50
|
+
### Step 3: Create the HTTP Request Node in n8n
|
|
51
|
+
|
|
52
|
+
1. **Add a node** "HTTP Request"
|
|
53
|
+
2. **Configure:**
|
|
54
|
+
- **Method:** `POST`
|
|
55
|
+
- **URL:** `http://192.168.1.52:3000/ask`
|
|
56
|
+
- **Authentication:** None
|
|
57
|
+
- **Send Body:** Yes
|
|
58
|
+
- **Body Content Type:** JSON
|
|
59
|
+
- **Specify Body:** Using Fields Below
|
|
60
|
+
|
|
61
|
+
3. **Body Parameters (Add Field):**
|
|
62
|
+
- `question` → Type: String → Value: `{{ $json.query }}`
|
|
63
|
+
- `notebook_id` → Type: String → Value: `parents-numerique`
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 📚 Example Workflows
|
|
68
|
+
|
|
69
|
+
### Workflow 1: Webhook → NotebookLM → Response
|
|
70
|
+
|
|
71
|
+
**Use case:** REST API that queries NotebookLM
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
┌──────────────┐ ┌────────────────┐ ┌──────────────┐
|
|
75
|
+
│ Webhook │────▶│ HTTP Request │────▶│ Respond │
|
|
76
|
+
│ (Trigger) │ │ (NotebookLM) │ │ to Webhook │
|
|
77
|
+
└──────────────┘ └────────────────┘ └──────────────┘
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Webhook Configuration:**
|
|
81
|
+
|
|
82
|
+
- Method: POST
|
|
83
|
+
- Path: `/ask-notebooklm`
|
|
84
|
+
|
|
85
|
+
**HTTP Request Configuration:**
|
|
86
|
+
|
|
87
|
+
- URL: `http://192.168.1.52:3000/ask`
|
|
88
|
+
- Body:
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"question": "{{ $json.body.question }}",
|
|
92
|
+
"notebook_id": "{{ $json.body.notebook_id }}"
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Respond Configuration:**
|
|
97
|
+
|
|
98
|
+
- Response Code: 200
|
|
99
|
+
- Response Body:
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"answer": "{{ $json.data.answer }}",
|
|
103
|
+
"session_id": "{{ $json.data.session_id }}"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Test:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
curl -X POST http://n8n-server:5678/webhook/ask-notebooklm \
|
|
111
|
+
-H "Content-Type: application/json" \
|
|
112
|
+
-d '{"question":"Test","notebook_id":"parents-numerique"}'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Workflow 2: Schedule → NotebookLM → Email
|
|
118
|
+
|
|
119
|
+
**Use case:** Automatic daily report
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
┌──────────────┐ ┌────────────────┐ ┌──────────────┐
|
|
123
|
+
│ Schedule │────▶│ HTTP Request │────▶│ Send Email │
|
|
124
|
+
│ (Cron) │ │ (NotebookLM) │ │ │
|
|
125
|
+
└──────────────┘ └────────────────┘ └──────────────┘
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Schedule Configuration:**
|
|
129
|
+
|
|
130
|
+
- Trigger Times: Cron Expression
|
|
131
|
+
- Expression: `0 9 * * 1-5` (9am Monday to Friday)
|
|
132
|
+
|
|
133
|
+
**HTTP Request Configuration:**
|
|
134
|
+
|
|
135
|
+
- URL: `http://192.168.1.52:3000/ask`
|
|
136
|
+
- Body:
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"question": "Quels sont les principaux conseils pour les parents?",
|
|
140
|
+
"notebook_id": "parents-numerique"
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Email Configuration:**
|
|
145
|
+
|
|
146
|
+
- To: `team@example.com`
|
|
147
|
+
- Subject: `Rapport Parents & Numérique - {{ $now.format('DD/MM/YYYY') }}`
|
|
148
|
+
- Text: `{{ $json.data.answer }}`
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### Workflow 3: Form Submit → NotebookLM → Slack
|
|
153
|
+
|
|
154
|
+
**Use case:** Slack bot that answers questions
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
┌──────────────┐ ┌────────────────┐ ┌──────────────┐
|
|
158
|
+
│ Slack │────▶│ HTTP Request │────▶│ Slack │
|
|
159
|
+
│ (Trigger) │ │ (NotebookLM) │ │ (Send Msg) │
|
|
160
|
+
└──────────────┘ └────────────────┘ └──────────────┘
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Slack Trigger Configuration:**
|
|
164
|
+
|
|
165
|
+
- Event: App Mention
|
|
166
|
+
- Workspace: Your workspace
|
|
167
|
+
|
|
168
|
+
**HTTP Request Configuration:**
|
|
169
|
+
|
|
170
|
+
- URL: `http://192.168.1.52:3000/ask`
|
|
171
|
+
- Body:
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"question": "{{ $json.event.text }}",
|
|
175
|
+
"notebook_id": "parents-numerique"
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Slack Send Configuration:**
|
|
180
|
+
|
|
181
|
+
- Channel: `{{ $json.event.channel }}`
|
|
182
|
+
- Text: `{{ $('HTTP Request').item.json.data.answer }}`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 🔐 Security in n8n
|
|
187
|
+
|
|
188
|
+
### Option 1: IP Whitelisting (Recommended)
|
|
189
|
+
|
|
190
|
+
On the Windows PC, only allow the n8n IP:
|
|
191
|
+
|
|
192
|
+
```powershell
|
|
193
|
+
New-NetFirewallRule `
|
|
194
|
+
-DisplayName "NotebookLM (n8n only)" `
|
|
195
|
+
-Direction Inbound `
|
|
196
|
+
-LocalPort 3000 `
|
|
197
|
+
-Protocol TCP `
|
|
198
|
+
-Action Allow `
|
|
199
|
+
-RemoteAddress 192.168.1.100 # n8n IP
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Option 2: API Key
|
|
203
|
+
|
|
204
|
+
If you have enabled the API key (see [02-CONFIGURATION.md](./02-CONFIGURATION.md)):
|
|
205
|
+
|
|
206
|
+
**In the HTTP Request node, add a Header:**
|
|
207
|
+
|
|
208
|
+
- Name: `Authorization`
|
|
209
|
+
- Value: `Bearer votre-api-key-secrete`
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 🎨 Best Practices
|
|
214
|
+
|
|
215
|
+
### 1. Error Handling
|
|
216
|
+
|
|
217
|
+
Add an "Error Trigger" node after HTTP Request:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
HTTP Request ──✓──▶ Success Path
|
|
221
|
+
└─✗──▶ Error Trigger ──▶ Send Error Notification
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Error Trigger Configuration:**
|
|
225
|
+
|
|
226
|
+
- Error Message: `{{ $json.error }}`
|
|
227
|
+
- Action: Send notification, log, retry, etc.
|
|
228
|
+
|
|
229
|
+
### 2. Timeout
|
|
230
|
+
|
|
231
|
+
NotebookLM can take 30-60 seconds. Configure the timeout:
|
|
232
|
+
|
|
233
|
+
**HTTP Request → Settings:**
|
|
234
|
+
|
|
235
|
+
- Timeout: `120000` (120 seconds)
|
|
236
|
+
|
|
237
|
+
### 3. Rate Limiting
|
|
238
|
+
|
|
239
|
+
Free NotebookLM = 50 requests/day. Add a counter:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
┌────────────┐ ┌──────────────┐ ┌────────────┐
|
|
243
|
+
│ Check │────▶│ HTTP Request │────▶│ Increment │
|
|
244
|
+
│ Counter │ │ │ │ Counter │
|
|
245
|
+
└────────────┘ └──────────────┘ └────────────┘
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### 4. Reusing Sessions
|
|
249
|
+
|
|
250
|
+
For follow-up questions, pass the `session_id`:
|
|
251
|
+
|
|
252
|
+
**First question:**
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"question": "Quels conseils pour gérer le temps d'écran?"
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Follow-up questions:**
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"question": "Donne-moi un exemple",
|
|
265
|
+
"session_id": "{{ $('HTTP Request 1').item.json.data.session_id }}"
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 📊 Useful Variables in n8n
|
|
272
|
+
|
|
273
|
+
| Variable | Description | Example |
|
|
274
|
+
| --------------------------------------------- | ------------------- | ------------- |
|
|
275
|
+
| `{{ $json.data.answer }}` | NotebookLM response | Response text |
|
|
276
|
+
| `{{ $json.data.session_id }}` | Session ID | "9a580eee" |
|
|
277
|
+
| `{{ $json.data.session_info.message_count }}` | Message count | 3 |
|
|
278
|
+
| `{{ $json.success }}` | Success/failure | true/false |
|
|
279
|
+
| `{{ $json.error }}` | Error message | "Timeout..." |
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 🐛 Troubleshooting
|
|
284
|
+
|
|
285
|
+
### Problem 1: "ECONNREFUSED"
|
|
286
|
+
|
|
287
|
+
**Cause:** n8n cannot reach the server
|
|
288
|
+
|
|
289
|
+
**Solutions:**
|
|
290
|
+
|
|
291
|
+
1. Verify the server is running: `curl http://192.168.1.52:3000/health`
|
|
292
|
+
2. Check the IP (not `localhost` from remote n8n!)
|
|
293
|
+
3. Check Windows firewall
|
|
294
|
+
|
|
295
|
+
### Problem 2: "Timeout"
|
|
296
|
+
|
|
297
|
+
**Cause:** NotebookLM response too long
|
|
298
|
+
|
|
299
|
+
**Solutions:**
|
|
300
|
+
|
|
301
|
+
1. Increase timeout HTTP Request → Settings → Timeout: 120000
|
|
302
|
+
2. Verify NotebookLM responds: test with curl
|
|
303
|
+
|
|
304
|
+
### Problem 3: "403 Forbidden"
|
|
305
|
+
|
|
306
|
+
**Cause:** Invalid or missing API key
|
|
307
|
+
|
|
308
|
+
**Solutions:**
|
|
309
|
+
|
|
310
|
+
1. Check Authorization header
|
|
311
|
+
2. Check the API key value
|
|
312
|
+
|
|
313
|
+
### Problem 4: Empty Responses
|
|
314
|
+
|
|
315
|
+
**Cause:** Invalid `notebook_id` or notebook not configured
|
|
316
|
+
|
|
317
|
+
**Solutions:**
|
|
318
|
+
|
|
319
|
+
1. List notebooks: `GET /notebooks`
|
|
320
|
+
2. Use the correct ID or complete URL
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## 📖 Advanced Examples
|
|
325
|
+
|
|
326
|
+
### Multi-Notebook Workflow
|
|
327
|
+
|
|
328
|
+
Query multiple notebooks based on topic:
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
Webhook ──▶ Switch ──┬──▶ HTTP (Notebook Parents)
|
|
332
|
+
├──▶ HTTP (Notebook Génétique)
|
|
333
|
+
└──▶ HTTP (Notebook Shakespeare)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Switch Configuration:**
|
|
337
|
+
|
|
338
|
+
- Mode: Rules
|
|
339
|
+
- Rules:
|
|
340
|
+
- If `{{ $json.topic }}` equals "parents-numerique" → Output 1
|
|
341
|
+
- If `{{ $json.topic }}` equals "genetique-sante" → Output 2
|
|
342
|
+
- Otherwise → Output 3
|
|
343
|
+
|
|
344
|
+
### Workflow with Validation
|
|
345
|
+
|
|
346
|
+
Validate the question before querying NotebookLM:
|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
Webhook ──▶ Validate ──✓──▶ HTTP Request ──▶ Response
|
|
350
|
+
└─✗──▶ Error Response
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**Validate Configuration (Function node):**
|
|
354
|
+
|
|
355
|
+
```javascript
|
|
356
|
+
if (!items[0].json.question || items[0].json.question.length < 3) {
|
|
357
|
+
throw new Error('Question trop courte');
|
|
358
|
+
}
|
|
359
|
+
return items;
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## 🎓 Resources
|
|
365
|
+
|
|
366
|
+
- **API Documentation:** [03-API.md](./03-API.md)
|
|
367
|
+
- **Configuration:** [02-CONFIGURATION.md](./02-CONFIGURATION.md)
|
|
368
|
+
- **Troubleshooting:** [05-TROUBLESHOOTING.md](./05-TROUBLESHOOTING.md)
|
|
369
|
+
- **n8n Community:** https://community.n8n.io/
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
**n8n integration complete!** ✅
|