bps-kit 1.2.2 → 1.3.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.
Files changed (51) hide show
  1. package/.bps-kit.json +4 -4
  2. package/README.md +3 -0
  3. package/implementation_plan.md.resolved +37 -0
  4. package/package.json +2 -2
  5. package/templates/agents-template/ARCHITECTURE.md +21 -9
  6. package/templates/agents-template/agents/automation-specialist.md +157 -0
  7. package/templates/agents-template/rules/GEMINI.md +2 -10
  8. package/templates/agents-template/workflows/automate.md +153 -0
  9. package/templates/skills_normal/n8n-code-javascript/BUILTIN_FUNCTIONS.md +764 -0
  10. package/templates/skills_normal/n8n-code-javascript/COMMON_PATTERNS.md +1110 -0
  11. package/templates/skills_normal/n8n-code-javascript/DATA_ACCESS.md +782 -0
  12. package/templates/skills_normal/n8n-code-javascript/ERROR_PATTERNS.md +763 -0
  13. package/templates/skills_normal/n8n-code-javascript/README.md +350 -0
  14. package/templates/skills_normal/n8n-code-javascript/SKILL.md +699 -0
  15. package/templates/skills_normal/n8n-code-python/COMMON_PATTERNS.md +794 -0
  16. package/templates/skills_normal/n8n-code-python/DATA_ACCESS.md +702 -0
  17. package/templates/skills_normal/n8n-code-python/ERROR_PATTERNS.md +601 -0
  18. package/templates/skills_normal/n8n-code-python/README.md +386 -0
  19. package/templates/skills_normal/n8n-code-python/SKILL.md +748 -0
  20. package/templates/skills_normal/n8n-code-python/STANDARD_LIBRARY.md +974 -0
  21. package/templates/skills_normal/n8n-expression-syntax/COMMON_MISTAKES.md +393 -0
  22. package/templates/skills_normal/n8n-expression-syntax/EXAMPLES.md +483 -0
  23. package/templates/skills_normal/n8n-expression-syntax/README.md +93 -0
  24. package/templates/skills_normal/n8n-expression-syntax/SKILL.md +516 -0
  25. package/templates/skills_normal/n8n-mcp-tools-expert/README.md +99 -0
  26. package/templates/skills_normal/n8n-mcp-tools-expert/SEARCH_GUIDE.md +374 -0
  27. package/templates/skills_normal/n8n-mcp-tools-expert/SKILL.md +642 -0
  28. package/templates/skills_normal/n8n-mcp-tools-expert/VALIDATION_GUIDE.md +442 -0
  29. package/templates/skills_normal/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md +618 -0
  30. package/templates/skills_normal/n8n-node-configuration/DEPENDENCIES.md +789 -0
  31. package/templates/skills_normal/n8n-node-configuration/OPERATION_PATTERNS.md +913 -0
  32. package/templates/skills_normal/n8n-node-configuration/README.md +364 -0
  33. package/templates/skills_normal/n8n-node-configuration/SKILL.md +785 -0
  34. package/templates/skills_normal/n8n-validation-expert/ERROR_CATALOG.md +943 -0
  35. package/templates/skills_normal/n8n-validation-expert/FALSE_POSITIVES.md +720 -0
  36. package/templates/skills_normal/n8n-validation-expert/README.md +290 -0
  37. package/templates/skills_normal/n8n-validation-expert/SKILL.md +689 -0
  38. package/templates/skills_normal/n8n-workflow-patterns/README.md +251 -0
  39. package/templates/skills_normal/n8n-workflow-patterns/SKILL.md +411 -0
  40. package/templates/skills_normal/n8n-workflow-patterns/ai_agent_workflow.md +784 -0
  41. package/templates/skills_normal/n8n-workflow-patterns/database_operations.md +785 -0
  42. package/templates/skills_normal/n8n-workflow-patterns/http_api_integration.md +734 -0
  43. package/templates/skills_normal/n8n-workflow-patterns/scheduled_tasks.md +773 -0
  44. package/templates/skills_normal/n8n-workflow-patterns/webhook_processing.md +545 -0
  45. package/templates/vault/n8n-code-javascript/SKILL.md +10 -10
  46. package/templates/vault/n8n-code-python/SKILL.md +11 -11
  47. package/templates/vault/n8n-expression-syntax/SKILL.md +4 -4
  48. package/templates/vault/n8n-mcp-tools-expert/SKILL.md +9 -9
  49. package/templates/vault/n8n-node-configuration/SKILL.md +2 -2
  50. package/templates/vault/n8n-validation-expert/SKILL.md +3 -3
  51. package/templates/vault/n8n-workflow-patterns/SKILL.md +11 -11
@@ -0,0 +1,618 @@
1
+ # Workflow Management Tools Guide
2
+
3
+ Complete guide for creating, updating, and managing n8n workflows.
4
+
5
+ ---
6
+
7
+ ## Tool Availability
8
+
9
+ **Requires n8n API**: All tools in this guide need `N8N_API_URL` and `N8N_API_KEY` configured.
10
+
11
+ If unavailable, use template examples and validation-only workflows.
12
+
13
+ ---
14
+
15
+ ## n8n_create_workflow
16
+
17
+ **Speed**: 100-500ms
18
+
19
+ **Use when**: Creating new workflows from scratch
20
+
21
+ **Syntax**:
22
+ ```javascript
23
+ n8n_create_workflow({
24
+ name: "Webhook to Slack", // Required
25
+ nodes: [...], // Required: array of nodes
26
+ connections: {...}, // Required: connections object
27
+ settings: {...} // Optional: workflow settings
28
+ })
29
+ ```
30
+
31
+ **Returns**: Created workflow with ID
32
+
33
+ **Example**:
34
+ ```javascript
35
+ n8n_create_workflow({
36
+ name: "Webhook to Slack",
37
+ nodes: [
38
+ {
39
+ id: "webhook-1",
40
+ name: "Webhook",
41
+ type: "n8n-nodes-base.webhook", // Full prefix!
42
+ typeVersion: 2,
43
+ position: [250, 300],
44
+ parameters: {
45
+ path: "slack-notify",
46
+ httpMethod: "POST"
47
+ }
48
+ },
49
+ {
50
+ id: "slack-1",
51
+ name: "Slack",
52
+ type: "n8n-nodes-base.slack",
53
+ typeVersion: 2,
54
+ position: [450, 300],
55
+ parameters: {
56
+ resource: "message",
57
+ operation: "post",
58
+ channel: "#general",
59
+ text: "={{$json.body.message}}"
60
+ }
61
+ }
62
+ ],
63
+ connections: {
64
+ "Webhook": {
65
+ "main": [[{node: "Slack", type: "main", index: 0}]]
66
+ }
67
+ }
68
+ })
69
+ ```
70
+
71
+ **Notes**:
72
+ - Workflows created **inactive** (activate with `activateWorkflow` operation)
73
+ - Auto-sanitization runs on creation
74
+ - Validate before creating for best results
75
+
76
+ ---
77
+
78
+ ## n8n_update_partial_workflow (MOST USED!)
79
+
80
+ **Speed**: 50-200ms | **Uses**: 38,287 (most used tool!)
81
+
82
+ **Use when**: Making incremental changes to workflows
83
+
84
+ **Common pattern**: 56s average between edits (iterative building!)
85
+
86
+ ### 17 Operation Types
87
+
88
+ **Node Operations** (6 types):
89
+ 1. `addNode` - Add new node
90
+ 2. `removeNode` - Remove node by ID or name
91
+ 3. `updateNode` - Update node properties (use dot notation)
92
+ 4. `moveNode` - Change position
93
+ 5. `enableNode` - Enable disabled node
94
+ 6. `disableNode` - Disable active node
95
+
96
+ **Connection Operations** (5 types):
97
+ 7. `addConnection` - Connect nodes (supports smart params)
98
+ 8. `removeConnection` - Remove connection (supports ignoreErrors)
99
+ 9. `rewireConnection` - Change connection target
100
+ 10. `cleanStaleConnections` - Auto-remove broken connections
101
+ 11. `replaceConnections` - Replace entire connections object
102
+
103
+ **Metadata Operations** (4 types):
104
+ 12. `updateSettings` - Workflow settings
105
+ 13. `updateName` - Rename workflow
106
+ 14. `addTag` - Add tag
107
+ 15. `removeTag` - Remove tag
108
+
109
+ **Activation Operations** (2 types):
110
+ 16. `activateWorkflow` - Activate workflow for automatic execution
111
+ 17. `deactivateWorkflow` - Deactivate workflow
112
+
113
+ ### Intent Parameter (IMPORTANT!)
114
+
115
+ Always include `intent` for better responses:
116
+
117
+ ```javascript
118
+ n8n_update_partial_workflow({
119
+ id: "workflow-id",
120
+ intent: "Add error handling for API failures", // Describe what you're doing
121
+ operations: [...]
122
+ })
123
+ ```
124
+
125
+ ### Smart Parameters
126
+
127
+ **IF nodes** - Use semantic branch names:
128
+ ```javascript
129
+ {
130
+ type: "addConnection",
131
+ source: "IF",
132
+ target: "True Handler",
133
+ branch: "true" // Instead of sourceIndex: 0
134
+ }
135
+
136
+ {
137
+ type: "addConnection",
138
+ source: "IF",
139
+ target: "False Handler",
140
+ branch: "false" // Instead of sourceIndex: 1
141
+ }
142
+ ```
143
+
144
+ **Switch nodes** - Use semantic case numbers:
145
+ ```javascript
146
+ {
147
+ type: "addConnection",
148
+ source: "Switch",
149
+ target: "Handler A",
150
+ case: 0
151
+ }
152
+
153
+ {
154
+ type: "addConnection",
155
+ source: "Switch",
156
+ target: "Handler B",
157
+ case: 1
158
+ }
159
+ ```
160
+
161
+ ### AI Connection Types (8 types)
162
+
163
+ **Full support** for AI workflows:
164
+
165
+ ```javascript
166
+ // Language Model
167
+ {
168
+ type: "addConnection",
169
+ source: "OpenAI Chat Model",
170
+ target: "AI Agent",
171
+ sourceOutput: "ai_languageModel"
172
+ }
173
+
174
+ // Tool
175
+ {
176
+ type: "addConnection",
177
+ source: "HTTP Request Tool",
178
+ target: "AI Agent",
179
+ sourceOutput: "ai_tool"
180
+ }
181
+
182
+ // Memory
183
+ {
184
+ type: "addConnection",
185
+ source: "Window Buffer Memory",
186
+ target: "AI Agent",
187
+ sourceOutput: "ai_memory"
188
+ }
189
+
190
+ // All 8 types:
191
+ // - ai_languageModel
192
+ // - ai_tool
193
+ // - ai_memory
194
+ // - ai_outputParser
195
+ // - ai_embedding
196
+ // - ai_vectorStore
197
+ // - ai_document
198
+ // - ai_textSplitter
199
+ ```
200
+
201
+ ### Property Removal with undefined
202
+
203
+ Remove properties by setting them to `undefined`:
204
+
205
+ ```javascript
206
+ // Remove a property
207
+ {
208
+ type: "updateNode",
209
+ nodeName: "HTTP Request",
210
+ updates: { onError: undefined }
211
+ }
212
+
213
+ // Migrate from deprecated property
214
+ {
215
+ type: "updateNode",
216
+ nodeName: "HTTP Request",
217
+ updates: {
218
+ continueOnFail: undefined, // Remove old
219
+ onError: "continueErrorOutput" // Add new
220
+ }
221
+ }
222
+ ```
223
+
224
+ ### Activation Operations
225
+
226
+ ```javascript
227
+ // Activate workflow
228
+ n8n_update_partial_workflow({
229
+ id: "workflow-id",
230
+ intent: "Activate workflow for production",
231
+ operations: [{type: "activateWorkflow"}]
232
+ })
233
+
234
+ // Deactivate workflow
235
+ n8n_update_partial_workflow({
236
+ id: "workflow-id",
237
+ intent: "Deactivate workflow for maintenance",
238
+ operations: [{type: "deactivateWorkflow"}]
239
+ })
240
+ ```
241
+
242
+ ### Example Usage
243
+
244
+ ```javascript
245
+ n8n_update_partial_workflow({
246
+ id: "workflow-id",
247
+ intent: "Add transform node after IF condition",
248
+ operations: [
249
+ // Add node
250
+ {
251
+ type: "addNode",
252
+ node: {
253
+ name: "Transform",
254
+ type: "n8n-nodes-base.set",
255
+ position: [400, 300],
256
+ parameters: {}
257
+ }
258
+ },
259
+ // Connect it (smart parameter)
260
+ {
261
+ type: "addConnection",
262
+ source: "IF",
263
+ target: "Transform",
264
+ branch: "true" // Clear and semantic!
265
+ }
266
+ ]
267
+ })
268
+ ```
269
+
270
+ ### Cleanup & Recovery
271
+
272
+ **cleanStaleConnections** - Remove broken connections:
273
+ ```javascript
274
+ {type: "cleanStaleConnections"}
275
+ ```
276
+
277
+ **rewireConnection** - Change target atomically:
278
+ ```javascript
279
+ {
280
+ type: "rewireConnection",
281
+ source: "Webhook",
282
+ from: "Old Handler",
283
+ to: "New Handler"
284
+ }
285
+ ```
286
+
287
+ **Best-effort mode** - Apply what works:
288
+ ```javascript
289
+ n8n_update_partial_workflow({
290
+ id: "workflow-id",
291
+ operations: [...],
292
+ continueOnError: true // Don't fail if some operations fail
293
+ })
294
+ ```
295
+
296
+ **Validate before applying**:
297
+ ```javascript
298
+ n8n_update_partial_workflow({
299
+ id: "workflow-id",
300
+ operations: [...],
301
+ validateOnly: true // Preview without applying
302
+ })
303
+ ```
304
+
305
+ ---
306
+
307
+ ## n8n_deploy_template (QUICK START!)
308
+
309
+ **Speed**: 200-500ms
310
+
311
+ **Use when**: Deploying a template directly to n8n instance
312
+
313
+ ```javascript
314
+ n8n_deploy_template({
315
+ templateId: 2947, // Required: from n8n.io
316
+ name: "My Weather to Slack", // Optional: custom name
317
+ autoFix: true, // Default: auto-fix common issues
318
+ autoUpgradeVersions: true, // Default: upgrade node versions
319
+ stripCredentials: true // Default: remove credential refs
320
+ })
321
+ ```
322
+
323
+ **Returns**:
324
+ - Workflow ID
325
+ - Required credentials
326
+ - Fixes applied
327
+
328
+ **Example**:
329
+ ```javascript
330
+ // Deploy a webhook to Slack template
331
+ const result = n8n_deploy_template({
332
+ templateId: 2947,
333
+ name: "Production Slack Notifier"
334
+ });
335
+
336
+ // Result includes:
337
+ // - id: "new-workflow-id"
338
+ // - requiredCredentials: ["slack"]
339
+ // - fixesApplied: ["typeVersion upgraded", "expression format fixed"]
340
+ ```
341
+
342
+ ---
343
+
344
+ ## n8n_workflow_versions (VERSION CONTROL)
345
+
346
+ **Use when**: Managing workflow history, rollback, cleanup
347
+
348
+ ### List Versions
349
+ ```javascript
350
+ n8n_workflow_versions({
351
+ mode: "list",
352
+ workflowId: "workflow-id",
353
+ limit: 10
354
+ })
355
+ ```
356
+
357
+ ### Get Specific Version
358
+ ```javascript
359
+ n8n_workflow_versions({
360
+ mode: "get",
361
+ versionId: 123
362
+ })
363
+ ```
364
+
365
+ ### Rollback to Previous Version
366
+ ```javascript
367
+ n8n_workflow_versions({
368
+ mode: "rollback",
369
+ workflowId: "workflow-id",
370
+ versionId: 123, // Optional: specific version
371
+ validateBefore: true // Default: validate before rollback
372
+ })
373
+ ```
374
+
375
+ ### Delete Versions
376
+ ```javascript
377
+ // Delete specific version
378
+ n8n_workflow_versions({
379
+ mode: "delete",
380
+ workflowId: "workflow-id",
381
+ versionId: 123
382
+ })
383
+
384
+ // Delete all versions for workflow
385
+ n8n_workflow_versions({
386
+ mode: "delete",
387
+ workflowId: "workflow-id",
388
+ deleteAll: true
389
+ })
390
+ ```
391
+
392
+ ### Prune Old Versions
393
+ ```javascript
394
+ n8n_workflow_versions({
395
+ mode: "prune",
396
+ workflowId: "workflow-id",
397
+ maxVersions: 10 // Keep 10 most recent
398
+ })
399
+ ```
400
+
401
+ ---
402
+
403
+ ## n8n_test_workflow (TRIGGER EXECUTION)
404
+
405
+ **Use when**: Testing workflow execution
406
+
407
+ **Auto-detects** trigger type (webhook, form, chat)
408
+
409
+ ```javascript
410
+ // Test webhook workflow
411
+ n8n_test_workflow({
412
+ workflowId: "workflow-id",
413
+ triggerType: "webhook", // Optional: auto-detected
414
+ httpMethod: "POST",
415
+ data: {message: "Hello!"},
416
+ waitForResponse: true,
417
+ timeout: 120000
418
+ })
419
+
420
+ // Test chat workflow
421
+ n8n_test_workflow({
422
+ workflowId: "workflow-id",
423
+ triggerType: "chat",
424
+ message: "Hello, AI agent!",
425
+ sessionId: "session-123" // For conversation continuity
426
+ })
427
+ ```
428
+
429
+ ---
430
+
431
+ ## n8n_validate_workflow (by ID)
432
+
433
+ **Use when**: Validating workflow stored in n8n
434
+
435
+ ```javascript
436
+ n8n_validate_workflow({
437
+ id: "workflow-id",
438
+ options: {
439
+ validateNodes: true,
440
+ validateConnections: true,
441
+ validateExpressions: true,
442
+ profile: "runtime"
443
+ }
444
+ })
445
+ ```
446
+
447
+ ---
448
+
449
+ ## n8n_get_workflow
450
+
451
+ **Use when**: Retrieving workflow details
452
+
453
+ **Modes**:
454
+ - `full` (default) - Complete workflow JSON
455
+ - `details` - Full + execution stats
456
+ - `structure` - Nodes + connections only
457
+ - `minimal` - ID, name, active, tags
458
+
459
+ ```javascript
460
+ // Full workflow
461
+ n8n_get_workflow({id: "workflow-id"})
462
+
463
+ // Just structure
464
+ n8n_get_workflow({id: "workflow-id", mode: "structure"})
465
+
466
+ // Minimal metadata
467
+ n8n_get_workflow({id: "workflow-id", mode: "minimal"})
468
+ ```
469
+
470
+ ---
471
+
472
+ ## n8n_executions (EXECUTION MANAGEMENT)
473
+
474
+ **Use when**: Managing workflow executions
475
+
476
+ ### Get Execution Details
477
+ ```javascript
478
+ n8n_executions({
479
+ action: "get",
480
+ id: "execution-id",
481
+ mode: "summary" // preview, summary, filtered, full, error
482
+ })
483
+
484
+ // Error mode for debugging
485
+ n8n_executions({
486
+ action: "get",
487
+ id: "execution-id",
488
+ mode: "error",
489
+ includeStackTrace: true
490
+ })
491
+ ```
492
+
493
+ ### List Executions
494
+ ```javascript
495
+ n8n_executions({
496
+ action: "list",
497
+ workflowId: "workflow-id",
498
+ status: "error", // success, error, waiting
499
+ limit: 100
500
+ })
501
+ ```
502
+
503
+ ### Delete Execution
504
+ ```javascript
505
+ n8n_executions({
506
+ action: "delete",
507
+ id: "execution-id"
508
+ })
509
+ ```
510
+
511
+ ---
512
+
513
+ ## Workflow Lifecycle
514
+
515
+ **Standard pattern**:
516
+ ```
517
+ 1. CREATE
518
+ n8n_create_workflow({...})
519
+ → Returns workflow ID
520
+
521
+ 2. VALIDATE
522
+ n8n_validate_workflow({id})
523
+ → Check for errors
524
+
525
+ 3. EDIT (iterative! 56s avg between edits)
526
+ n8n_update_partial_workflow({id, intent: "...", operations: [...]})
527
+ → Make changes
528
+
529
+ 4. VALIDATE AGAIN
530
+ n8n_validate_workflow({id})
531
+ → Verify changes
532
+
533
+ 5. ACTIVATE
534
+ n8n_update_partial_workflow({
535
+ id,
536
+ intent: "Activate workflow",
537
+ operations: [{type: "activateWorkflow"}]
538
+ })
539
+ → Workflow now runs on triggers!
540
+
541
+ 6. MONITOR
542
+ n8n_executions({action: "list", workflowId: id})
543
+ n8n_executions({action: "get", id: execution_id})
544
+ ```
545
+
546
+ ---
547
+
548
+ ## Common Patterns from Telemetry
549
+
550
+ ### Pattern 1: Edit → Validate (7,841 occurrences)
551
+ ```javascript
552
+ n8n_update_partial_workflow({...})
553
+ // ↓ 23s (thinking about what to validate)
554
+ n8n_validate_workflow({id})
555
+ ```
556
+
557
+ ### Pattern 2: Validate → Fix (7,266 occurrences)
558
+ ```javascript
559
+ n8n_validate_workflow({id})
560
+ // ↓ 58s (fixing errors)
561
+ n8n_update_partial_workflow({...})
562
+ ```
563
+
564
+ ### Pattern 3: Iterative Building (31,464 occurrences)
565
+ ```javascript
566
+ update → update → update → ... (56s avg between edits)
567
+ ```
568
+
569
+ **This shows**: Workflows are built **iteratively**, not in one shot!
570
+
571
+ ---
572
+
573
+ ## Best Practices
574
+
575
+ ### Do
576
+
577
+ - Build workflows **iteratively** (avg 56s between edits)
578
+ - Include **intent** parameter for better responses
579
+ - Use **smart parameters** (branch, case) for clarity
580
+ - Validate **after** significant changes
581
+ - Use **atomic mode** (default) for critical updates
582
+ - Specify **sourceOutput** for AI connections
583
+ - Clean stale connections after node renames/deletions
584
+ - Use `n8n_deploy_template` for quick starts
585
+ - Activate workflows via API when ready
586
+
587
+ ### Don't
588
+
589
+ - Try to build workflows in one shot
590
+ - Skip the intent parameter
591
+ - Use sourceIndex when branch/case available
592
+ - Skip validation before activation
593
+ - Forget to test workflows after creation
594
+ - Ignore auto-sanitization behavior
595
+
596
+ ---
597
+
598
+ ## Summary
599
+
600
+ **Most Important**:
601
+ 1. **n8n_update_partial_workflow** is most-used tool (38,287 uses)
602
+ 2. Include **intent** parameter for better responses
603
+ 3. Workflows built **iteratively** (56s avg between edits)
604
+ 4. Use **smart parameters** (branch="true", case=0) for clarity
605
+ 5. **AI connections** supported (8 types with sourceOutput)
606
+ 6. **Workflow activation** supported via API (`activateWorkflow` operation)
607
+ 7. **Auto-sanitization** runs on all operations
608
+ 8. Use **n8n_deploy_template** for quick starts
609
+
610
+ **New Tools**:
611
+ - `n8n_deploy_template` - Deploy templates directly
612
+ - `n8n_workflow_versions` - Version control & rollback
613
+ - `n8n_test_workflow` - Trigger execution
614
+ - `n8n_executions` - Manage executions
615
+
616
+ **Related**:
617
+ - [SEARCH_GUIDE.md](SEARCH_GUIDE.md) - Find nodes to add
618
+ - [VALIDATION_GUIDE.md](VALIDATION_GUIDE.md) - Validate workflows