@n8n/ai-workflow-builder 1.16.0 → 1.17.0

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 (133) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/code-builder/index.d.ts +1 -1
  3. package/dist/code-builder/index.js +4 -4
  4. package/dist/code-builder/index.js.map +1 -1
  5. package/dist/code-builder/prompts/index.js +4 -4
  6. package/dist/code-builder/prompts/index.js.map +1 -1
  7. package/dist/prompts/chains/parameter-updater/guides/index.d.ts +1 -11
  8. package/dist/prompts/chains/parameter-updater/guides/index.js +12 -22
  9. package/dist/prompts/chains/parameter-updater/guides/index.js.map +1 -1
  10. package/dist/prompts/chains/parameter-updater/types.d.ts +1 -18
  11. package/dist/prompts/shared/node-guidance/index.d.ts +1 -2
  12. package/dist/prompts/shared/node-guidance/index.js +3 -4
  13. package/dist/prompts/shared/node-guidance/index.js.map +1 -1
  14. package/dist/prompts/shared/node-recommendations/index.d.ts +2 -2
  15. package/dist/prompts/shared/node-recommendations/index.js +6 -11
  16. package/dist/prompts/shared/node-recommendations/index.js.map +1 -1
  17. package/dist/tools/best-practices/index.d.ts +1 -3
  18. package/dist/tools/best-practices/index.js +2 -30
  19. package/dist/tools/best-practices/index.js.map +1 -1
  20. package/dist/types/best-practices.d.ts +1 -6
  21. package/dist/types/categorization.d.ts +2 -20
  22. package/dist/types/categorization.js +3 -36
  23. package/dist/types/categorization.js.map +1 -1
  24. package/dist/types/node-guidance.d.ts +1 -7
  25. package/dist/types/node-recommendations.d.ts +1 -26
  26. package/dist/types/node-recommendations.js +3 -12
  27. package/dist/types/node-recommendations.js.map +1 -1
  28. package/package.json +8 -8
  29. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.d.ts +0 -2
  30. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js +0 -70
  31. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js.map +0 -1
  32. package/dist/prompts/chains/parameter-updater/guides/gmail.d.ts +0 -2
  33. package/dist/prompts/chains/parameter-updater/guides/gmail.js +0 -53
  34. package/dist/prompts/chains/parameter-updater/guides/gmail.js.map +0 -1
  35. package/dist/prompts/chains/parameter-updater/guides/http-request.d.ts +0 -2
  36. package/dist/prompts/chains/parameter-updater/guides/http-request.js +0 -139
  37. package/dist/prompts/chains/parameter-updater/guides/http-request.js.map +0 -1
  38. package/dist/prompts/chains/parameter-updater/guides/if-node.d.ts +0 -2
  39. package/dist/prompts/chains/parameter-updater/guides/if-node.js +0 -159
  40. package/dist/prompts/chains/parameter-updater/guides/if-node.js.map +0 -1
  41. package/dist/prompts/chains/parameter-updater/guides/predecessor-output.d.ts +0 -2
  42. package/dist/prompts/chains/parameter-updater/guides/predecessor-output.js +0 -25
  43. package/dist/prompts/chains/parameter-updater/guides/predecessor-output.js.map +0 -1
  44. package/dist/prompts/chains/parameter-updater/guides/resource-locator.d.ts +0 -2
  45. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js +0 -40
  46. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +0 -1
  47. package/dist/prompts/chains/parameter-updater/guides/set-node.d.ts +0 -2
  48. package/dist/prompts/chains/parameter-updater/guides/set-node.js +0 -94
  49. package/dist/prompts/chains/parameter-updater/guides/set-node.js.map +0 -1
  50. package/dist/prompts/chains/parameter-updater/guides/switch-node.d.ts +0 -2
  51. package/dist/prompts/chains/parameter-updater/guides/switch-node.js +0 -75
  52. package/dist/prompts/chains/parameter-updater/guides/switch-node.js.map +0 -1
  53. package/dist/prompts/chains/parameter-updater/guides/system-message.d.ts +0 -2
  54. package/dist/prompts/chains/parameter-updater/guides/system-message.js +0 -96
  55. package/dist/prompts/chains/parameter-updater/guides/system-message.js.map +0 -1
  56. package/dist/prompts/chains/parameter-updater/guides/text-fields.d.ts +0 -2
  57. package/dist/prompts/chains/parameter-updater/guides/text-fields.js +0 -31
  58. package/dist/prompts/chains/parameter-updater/guides/text-fields.js.map +0 -1
  59. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.d.ts +0 -2
  60. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js +0 -76
  61. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js.map +0 -1
  62. package/dist/prompts/shared/node-guidance/structured-output-parser.d.ts +0 -2
  63. package/dist/prompts/shared/node-guidance/structured-output-parser.js +0 -35
  64. package/dist/prompts/shared/node-guidance/structured-output-parser.js.map +0 -1
  65. package/dist/prompts/shared/node-guidance/webhook.d.ts +0 -2
  66. package/dist/prompts/shared/node-guidance/webhook.js +0 -38
  67. package/dist/prompts/shared/node-guidance/webhook.js.map +0 -1
  68. package/dist/prompts/shared/node-recommendations/audio-generation.d.ts +0 -2
  69. package/dist/prompts/shared/node-recommendations/audio-generation.js +0 -18
  70. package/dist/prompts/shared/node-recommendations/audio-generation.js.map +0 -1
  71. package/dist/prompts/shared/node-recommendations/image-generation.d.ts +0 -2
  72. package/dist/prompts/shared/node-recommendations/image-generation.js +0 -18
  73. package/dist/prompts/shared/node-recommendations/image-generation.js.map +0 -1
  74. package/dist/prompts/shared/node-recommendations/text-manipulation.d.ts +0 -2
  75. package/dist/prompts/shared/node-recommendations/text-manipulation.js +0 -27
  76. package/dist/prompts/shared/node-recommendations/text-manipulation.js.map +0 -1
  77. package/dist/prompts/shared/node-recommendations/utils/format-recommendation.d.ts +0 -2
  78. package/dist/prompts/shared/node-recommendations/utils/format-recommendation.js +0 -24
  79. package/dist/prompts/shared/node-recommendations/utils/format-recommendation.js.map +0 -1
  80. package/dist/prompts/shared/node-recommendations/video-generation.d.ts +0 -2
  81. package/dist/prompts/shared/node-recommendations/video-generation.js +0 -15
  82. package/dist/prompts/shared/node-recommendations/video-generation.js.map +0 -1
  83. package/dist/shared/code-builder-and-mcp-prompt-constants.d.ts +0 -3
  84. package/dist/shared/code-builder-and-mcp-prompt-constants.js +0 -57
  85. package/dist/shared/code-builder-and-mcp-prompt-constants.js.map +0 -1
  86. package/dist/tools/best-practices/chatbot.d.ts +0 -7
  87. package/dist/tools/best-practices/chatbot.js +0 -118
  88. package/dist/tools/best-practices/chatbot.js.map +0 -1
  89. package/dist/tools/best-practices/content-generation.d.ts +0 -7
  90. package/dist/tools/best-practices/content-generation.js +0 -115
  91. package/dist/tools/best-practices/content-generation.js.map +0 -1
  92. package/dist/tools/best-practices/data-analysis.d.ts +0 -7
  93. package/dist/tools/best-practices/data-analysis.js +0 -367
  94. package/dist/tools/best-practices/data-analysis.js.map +0 -1
  95. package/dist/tools/best-practices/data-extraction.d.ts +0 -7
  96. package/dist/tools/best-practices/data-extraction.js +0 -122
  97. package/dist/tools/best-practices/data-extraction.js.map +0 -1
  98. package/dist/tools/best-practices/data-persistence.d.ts +0 -7
  99. package/dist/tools/best-practices/data-persistence.js +0 -197
  100. package/dist/tools/best-practices/data-persistence.js.map +0 -1
  101. package/dist/tools/best-practices/data-transformation.d.ts +0 -7
  102. package/dist/tools/best-practices/data-transformation.js +0 -146
  103. package/dist/tools/best-practices/data-transformation.js.map +0 -1
  104. package/dist/tools/best-practices/document-processing.d.ts +0 -7
  105. package/dist/tools/best-practices/document-processing.js +0 -332
  106. package/dist/tools/best-practices/document-processing.js.map +0 -1
  107. package/dist/tools/best-practices/enrichment.d.ts +0 -7
  108. package/dist/tools/best-practices/enrichment.js +0 -271
  109. package/dist/tools/best-practices/enrichment.js.map +0 -1
  110. package/dist/tools/best-practices/form-input.d.ts +0 -7
  111. package/dist/tools/best-practices/form-input.js +0 -173
  112. package/dist/tools/best-practices/form-input.js.map +0 -1
  113. package/dist/tools/best-practices/human-in-the-loop.d.ts +0 -7
  114. package/dist/tools/best-practices/human-in-the-loop.js +0 -268
  115. package/dist/tools/best-practices/human-in-the-loop.js.map +0 -1
  116. package/dist/tools/best-practices/knowledge-base.d.ts +0 -7
  117. package/dist/tools/best-practices/knowledge-base.js +0 -268
  118. package/dist/tools/best-practices/knowledge-base.js.map +0 -1
  119. package/dist/tools/best-practices/monitoring.d.ts +0 -7
  120. package/dist/tools/best-practices/monitoring.js +0 -171
  121. package/dist/tools/best-practices/monitoring.js.map +0 -1
  122. package/dist/tools/best-practices/notification.d.ts +0 -7
  123. package/dist/tools/best-practices/notification.js +0 -135
  124. package/dist/tools/best-practices/notification.js.map +0 -1
  125. package/dist/tools/best-practices/scheduling.d.ts +0 -7
  126. package/dist/tools/best-practices/scheduling.js +0 -152
  127. package/dist/tools/best-practices/scheduling.js.map +0 -1
  128. package/dist/tools/best-practices/scraping-and-research.d.ts +0 -7
  129. package/dist/tools/best-practices/scraping-and-research.js +0 -158
  130. package/dist/tools/best-practices/scraping-and-research.js.map +0 -1
  131. package/dist/tools/best-practices/triage.d.ts +0 -7
  132. package/dist/tools/best-practices/triage.js +0 -149
  133. package/dist/tools/best-practices/triage.js.map +0 -1
@@ -1,152 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchedulingBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class SchedulingBestPractices {
6
- technique = categorization_1.WorkflowTechnique.SCHEDULING;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Scheduling Workflows
9
-
10
- ## Workflow Design
11
-
12
- Structure scheduled workflows to perform focused, well-defined tasks.
13
-
14
- For recurring tasks, use Schedule Trigger node with clear naming (e.g., "Daily 08:00 Trigger", "Every 6h Cron").
15
-
16
- Prevent overlapping executions by ensuring worst-case execution time < schedule interval. For frequent schedules, implement mutex/lock mechanisms using external systems if needed.
17
-
18
- ## Scheduling Patterns
19
-
20
- ### Recurring Schedules
21
-
22
- Use Schedule Trigger in two modes:
23
- - **Interval Mode**: User-friendly dropdowns for common schedules (every X minutes, daily at 09:00, weekly on Mondays)
24
- - **Cron Expression Mode**: Complex patterns using 5-field syntax (m h dom mon dow) with optional seconds field. Example: \`0 9 * * 1\` triggers every Monday at 09:00
25
-
26
- Multiple schedules can be combined in single Schedule Trigger node using multiple Trigger Rules. Useful when same logic applies to different timings.
27
-
28
- ### One-Time Events
29
-
30
- For event-relative scheduling, use Wait node to pause workflow until specified time/date.
31
-
32
- Note: Cron expressions with specific dates (e.g., \`0 12 22 10 *\` for Oct 22 at 12:00) will repeat annually on that date.
33
-
34
- ### Conditional Scheduling
35
-
36
- PREFER conditional logic over complex cron expressions. Use IF/Switch nodes after Schedule Trigger for runtime conditions:
37
- - Check if today is last day of month before running monthly reports
38
- - Skip execution on holidays by checking against a holiday list in a data table
39
- - Route to "weekday" vs "weekend" processing based on current day
40
-
41
- This approach is more readable and maintainable than complex cron patterns.
42
-
43
- ## Time Zone Handling
44
-
45
- When building scheduled workflows:
46
- - If user specifies a timezone, set it in the Schedule Trigger node's timezone parameter
47
- - If user mentions times without timezone, use the schedule as specified (instance default will apply)
48
- - For Wait nodes, be aware they use server system time, not workflow timezone
49
-
50
- ## Recommended Nodes
51
-
52
- ### Schedule Trigger (n8n-nodes-base.scheduleTrigger)
53
-
54
- Primary node for running workflows on schedule. Supports interval mode for simple schedules and cron mode for complex patterns.
55
-
56
- ### Wait (n8n-nodes-base.wait)
57
-
58
- Pause workflow execution until specified time or duration.
59
-
60
- Use Cases:
61
- - Delay actions relative to events
62
- - One-off timers per data item
63
- - Follow-up actions after specific duration
64
-
65
- Best Practices:
66
- - Use n8n Data Tables for waits longer than 24 hours (store scheduled time, check periodically)
67
- - Avoid wait times longer than 7 days - use a polling pattern instead
68
-
69
- ### IF (n8n-nodes-base.if)
70
-
71
- Add conditional logic to scheduled workflows.
72
-
73
- Use Cases:
74
- - Check date conditions (last day of month using expression: \`{{ $now.day === $now.endOf('month').day }}\`)
75
- - Skip execution based on external data (e.g., holiday check)
76
- - Route to different actions conditionally
77
-
78
- Best Practices:
79
- - Enable "Convert types where required" for comparisons
80
- - Prefer IF nodes over complex cron expressions for readability
81
-
82
- ### Switch (n8n-nodes-base.switch)
83
-
84
- Multiple conditional branches for complex routing.
85
-
86
- Use Cases:
87
- - Different actions based on day of week (e.g., \`{{ $now.weekday }}\` returns 1-7)
88
- - Time-based routing (morning vs afternoon processing)
89
- - Multi-path conditional execution
90
-
91
- ### n8n Data Tables (n8n-nodes-base.n8nTables)
92
-
93
- Purpose: Store scheduling state and pending tasks
94
-
95
- Use Cases:
96
- - Track last execution time for catch-up logic
97
- - Store list of pending one-time tasks with scheduled times
98
- - Implement custom scheduling queue with polling
99
-
100
- Best Practices:
101
- - Query efficiently with proper filters
102
- - Clean up completed tasks periodically
103
-
104
- ## Common Pitfalls to Avoid
105
-
106
- ### Missed Schedules During Downtime
107
-
108
- **Problem**: Scheduled runs missed when n8n instance is down. No automatic catch-up for missed triggers.
109
-
110
- **Solution**: Design idempotent workflows with catch-up logic:
111
- - Store last successful run timestamp in n8n Data Tables
112
- - On each run, check if enough time has passed since last run
113
- - Example: For a task that should run once per 24 hours, schedule it every 4 hours but only execute if last run was >20 hours ago
114
-
115
- ### Overlapping Executions
116
-
117
- **Problem**: Next scheduled run starts before previous completes, causing race conditions or resource conflicts.
118
-
119
- **Solution**:
120
- - Increase interval to exceed worst-case execution time
121
- - Implement mutex/lock using n8n Data Tables (check/set "running" flag at start, clear at end)
122
- - Add execution check at workflow start
123
-
124
- ### Wait Node Timezone Confusion
125
-
126
- **Problem**: Wait node uses server system time, ignoring workflow timezone setting. Wait until "10:00" may not match expected timezone.
127
-
128
- **Solution**:
129
- - Account for server timezone when setting Wait times
130
- - Use relative durations (e.g., "wait 2 hours") instead of absolute times when possible
131
- - Prefer Schedule Trigger for timezone-aware scheduling
132
-
133
- ### First Execution Timing
134
-
135
- **Problem**: First execution after activation doesn't match expected schedule. Activation time affects next run calculation.
136
-
137
- **Solution**:
138
- - Use manual execution for immediate first run if needed
139
- - Understand that schedule recalculates from activation moment
140
-
141
- ### Cron Syntax
142
-
143
- n8n supports both 5-field and 6-field (with seconds) cron syntax. Use 6 fields if you want to specify seconds (e.g., prefix with 0 for seconds: \`0 0 9 * * *\` for 9 AM daily).
144
-
145
- For simple schedules, prefer Interval mode over cron for better readability.
146
- `;
147
- getDocumentation() {
148
- return this.documentation;
149
- }
150
- }
151
- exports.SchedulingBestPractices = SchedulingBestPractices;
152
- //# sourceMappingURL=scheduling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scheduling.js","sourceRoot":"","sources":["../../../src/tools/best-practices/scheduling.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,uBAAuB;IAC1B,SAAS,GAAG,kCAAiB,CAAC,UAAU,CAAC;IACzC,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0IjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAnJD,0DAmJC"}
@@ -1,7 +0,0 @@
1
- import type { BestPracticesDocument } from '../../types/best-practices';
2
- export declare class ScrapingAndResearchBestPractices implements BestPracticesDocument {
3
- readonly technique: "scraping_and_research";
4
- readonly version = "1.0.0";
5
- private readonly documentation;
6
- getDocumentation(): string;
7
- }
@@ -1,158 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScrapingAndResearchBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class ScrapingAndResearchBestPractices {
6
- technique = categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Scraping & Research Workflows
9
-
10
- ## Performance & Resource Management
11
-
12
- Batch requests and introduce delays to avoid hitting API rate limits or overloading target servers. Use Wait nodes and
13
- batching options in HTTP Request nodes. When 429 rate limiting errors occur due to receiving too many requests,
14
- implement batching to reduce request frequency or use the "Retry on Fail" feature to automatically handle throttled
15
- responses.
16
-
17
- Workflows processing large datasets can crash due to memory constraints. Use the Split In Batches node to process 200
18
- rows at a time to reduce memory usage, leverage built-in nodes instead of custom code, and increase execution timeouts
19
- via environment variables for better resource management.
20
-
21
- ## Looping & Pagination
22
-
23
- Implement robust looping for paginated data. Use Set, IF, and Code nodes to manage page numbers and loop conditions,
24
- ensuring you don't miss data or create infinite loops. Leverage n8n's built-in mechanisms rather than manual approaches:
25
- use the $runIndex variable to track iterations without additional code nodes, and employ workflow static data or node
26
- run indexes to maintain state across loop cycles.
27
-
28
- ## Recommended Nodes
29
-
30
- ### HTTP Request (n8n-nodes-base.httpRequest)
31
-
32
- Purpose: Fetches web pages or API data for scraping and research workflows
33
-
34
- Pitfalls:
35
-
36
- - Depending on the data which the user wishes to scrape/research, it maybe against the terms of service to attempt to
37
- fetch it from the site directly. Using scraping nodes is the best way to get around this
38
- - Double-check URL formatting, query parameters, and ensure all required fields are present to avoid bad request errors
39
- - Be aware of 429 rate limiting errors when the service receives too many requests - implement batching or use "Retry on
40
- Fail" feature
41
- - Refresh expired tokens, verify API keys, and ensure correct permissions to avoid authentication failures
42
-
43
- ### SerpAPI (@n8n/n8n-nodes-langchain.toolSerpApi)
44
-
45
- Purpose: Give an agent the ability to search for research materials and fact-checking results that have been retrieved
46
- from other sources.
47
-
48
- ### Perplexity (n8n-nodes-base.perplexityTool)
49
-
50
- Purpose: Give an agent the ability to search utilising Perplexity, a powerful tool for finding sources/material for
51
- generating reports and information.
52
-
53
- ### HTML Extract (n8n-nodes-base.htmlExtract)
54
-
55
- Purpose: Parses HTML and extracts data using CSS selectors for web scraping
56
-
57
- Pitfalls:
58
-
59
- - Some sites use JavaScript to render content, which may not be accessible via simple HTTP requests. Consider using
60
- browser automation tools or APIs if the HTML appears empty
61
- - Validate that the CSS selectors match the actual page structure to avoid extraction failures
62
-
63
- ### Split Out (n8n-nodes-base.splitOut)
64
-
65
- Purpose: Processes lists of items one by one for sequential operations
66
-
67
- Pitfalls:
68
- - Can cause performance issues with very large datasets - consider using Split In Batches instead
69
-
70
- ### Loop Over Items (Split in Batches) (n8n-nodes-base.splitInBatches)
71
-
72
- Purpose: Processes lists of items in batches to manage memory and performance
73
-
74
- Pitfalls:
75
- - Ensure proper loop configuration to avoid infinite loops or skipped data. The index 0
76
- (first connection) of the loop is treated as the done state, while the index 1 (second connection)
77
- is the connection that loops.
78
- - Use appropriate batch sizes (e.g., 200 rows) to balance memory usage and performance
79
-
80
- ### Edit Fields (Set) (n8n-nodes-base.set)
81
-
82
- Purpose: Manipulates data, sets variables for loop control and state management
83
-
84
- ### Code (n8n-nodes-base.code)
85
-
86
- Purpose: Implements custom logic for complex data transformations or pagination
87
-
88
- Pitfalls:
89
-
90
- - Prefer built-in nodes over custom code to reduce memory usage and improve maintainability
91
- - Avoid processing very large datasets in a single code execution - use batching
92
-
93
- ### If (n8n-nodes-base.if)
94
-
95
- Purpose: Adds conditional logic for error handling, loop control, or data filtering
96
-
97
- Pitfalls:
98
- - Validate expressions carefully to avoid unexpected branching behavior
99
-
100
- ### Wait (n8n-nodes-base.wait)
101
-
102
- Purpose: Introduces delays to respect rate limits and avoid overloading servers
103
-
104
- ### Data Tables (n8n-nodes-base.dataTable)
105
-
106
- Purpose: Stores scraped data in n8n's built-in persistent data storage
107
-
108
- ### Google Sheets (n8n-nodes-base.googleSheets)
109
-
110
- Purpose: Stores scraped data in spreadsheets for easy access and sharing
111
-
112
- ### Microsoft Excel 365 (n8n-nodes-base.microsoftExcel)
113
-
114
- Purpose: Stores scraped data in Excel files for offline analysis
115
-
116
- ### Airtable (n8n-nodes-base.airtable)
117
-
118
- Purpose: Saves structured data to a database with rich data types and relationships
119
-
120
- ### AI Agent (@n8n/n8n-nodes-langchain.agent)
121
-
122
- Purpose: For research, summarization, and advanced data extraction. AI agents can autonomously gather information
123
- from websites, analyze content, and organize findings into structured formats, integrating tools for web scraping,
124
- content analysis, and database storage
125
-
126
- ### Scraping Nodes
127
-
128
- - Phantombuster (n8n-nodes-base.phantombuster)
129
- - Apify (use HTTP Request or community node)
130
- - BrightData (use HTTP Request or community node)
131
-
132
- Purpose: If the user wishes to scrap data from sites like LinkedIn, Facebook, Instagram, Twitter/X, Indeed, Glassdoor
133
- or any other service similar to these large providers it is better to use a node designed for this. The scraping
134
- nodes provide access to these datasets while avoiding issues like rate limiting or breaking terms of service for
135
- sites like these.
136
-
137
- ## Common Pitfalls to Avoid
138
-
139
- Bad Request Errors: Double-check URL formatting, query parameters, and ensure all required fields are present to
140
- avoid 400 errors when making HTTP requests.
141
-
142
- Rate Limits: Use batching and Wait nodes to avoid 429 errors. When the service receives too many requests, implement
143
- batching to reduce request frequency or use the "Retry on Fail" feature.
144
-
145
- Memory Issues: Avoid processing very large datasets in a single run; use batching and increase server resources if
146
- needed. Use Split In Batches node to process 200 rows at a time, leverage built-in nodes instead of custom code, and
147
- increase execution timeouts via environment variables.
148
-
149
- Empty or Unexpected Data: Some sites use JavaScript to render content, which may not be accessible via simple HTTP
150
- requests. Standard HTTP and HTML parsing nodes fail because sites load data asynchronously via JavaScript, leaving the
151
- initial HTML empty of actual content. Web scraping nodes can be used to avoid this.
152
- `;
153
- getDocumentation() {
154
- return this.documentation;
155
- }
156
- }
157
- exports.ScrapingAndResearchBestPractices = ScrapingAndResearchBestPractices;
158
- //# sourceMappingURL=scraping-and-research.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scraping-and-research.js","sourceRoot":"","sources":["../../../src/tools/best-practices/scraping-and-research.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,gCAAgC;IACnC,SAAS,GAAG,kCAAiB,CAAC,qBAAqB,CAAC;IACpD,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAzJD,4EAyJC"}
@@ -1,7 +0,0 @@
1
- import type { BestPracticesDocument } from '../../types/best-practices';
2
- export declare class TriageBestPractices implements BestPracticesDocument {
3
- readonly technique: "triage";
4
- readonly version = "1.0.0";
5
- private readonly documentation;
6
- getDocumentation(): string;
7
- }
@@ -1,149 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TriageBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class TriageBestPractices {
6
- technique = categorization_1.WorkflowTechnique.TRIAGE;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Triage Workflows
9
-
10
- ## Workflow Design
11
-
12
- Triage workflows automatically classify incoming data and route it based on priority or category. Common use cases include sorting support tickets by urgency, categorizing emails for follow-up, or scoring leads for sales routing.
13
-
14
- Define clear categories and outcomes before building. Design in logical stages:
15
-
16
- 1. **Trigger & Input**: Capture incoming items (webhook, email trigger, form submission, schedule)
17
- 2. **Preprocessing**: Fetch additional data if needed (CRM lookup, field normalization)
18
- 3. **Classification**: Assign categories via rules or AI
19
- 4. **Routing**: Direct items to appropriate branches using Switch node or Text Classifier Node
20
- 5. **Actions**: Execute category-specific tasks (create tasks, send alerts, update records)
21
- 6. **Logging**: Track outcomes for monitoring and analysis
22
-
23
- Include a default/fallback path to catch unclassified items so data is tracked rather than dropped silently.
24
-
25
- ## Classification Strategies
26
-
27
- ### Rule-Based Classification
28
- Use IF/Switch nodes for keyword detection, sender addresses, or numeric thresholds. Chain multiple conditions or use Switch for multi-way branching.
29
-
30
- Example: IF email contains "urgent" → High Priority branch
31
-
32
- ### AI-Powered Classification
33
- For unstructured text or nuanced decisions, use AI nodes with clear prompts and defined output labels.
34
-
35
- Example prompt: "Classify this email as INTERESTED, NOT_INTERESTED, or QUESTION"
36
-
37
- Best practices:
38
- - Use structured output format (JSON with specific fields)
39
- - Set low temperature parameter of the model (0-0.2) for consistency
40
- - Include few-shot examples of input + classification
41
- - Implement error handling for unexpected outputs
42
-
43
- #### Text Classifier Node
44
- Use the Text Classifier node (@n8n/n8n-nodes-langchain.textClassifier) for straightforward text classification tasks. Configure with predefined category labels and descriptions for accurate results.
45
-
46
- Example workflow pattern:
47
- \`\`\`mermaid
48
- flowchart LR
49
- A[Webhook Trigger] --> B[Set: Normalize Data]
50
- B --> C[Text Classifier]
51
- C --> D{Switch: Route by Category}
52
- D -->|High Priority| E[Slack: Alert Team]
53
- D -->|Medium Priority| F[Create Task]
54
- D -->|Low Priority| G[Log to Sheet]
55
- D -->|Default| H[Manual Review]
56
- \`\`\`
57
-
58
- ### Combined Approach
59
- For robust triage, combine rule-based and AI classification. Use AI Agent node with structured output to assign categories, scores, or tags, then route with Switch nodes.
60
- When using AI with structured output, always add reasoning field alongside category or score to aid debugging.
61
-
62
- Example workflow pattern:
63
- \`\`\`mermaid
64
- flowchart LR
65
- A[Email Trigger] --> B[Set: Extract Fields]
66
- B --> C{IF: Contains Keywords}
67
- C -->|Yes| D[Set: Rule-based Category]
68
- C -->|No| E[AI Agent: Classify with Structured Output]
69
- D --> F[Merge]
70
- E --> F
71
- F --> G{Switch: Route by Category}
72
- G -->|Category A| H[Action A]
73
- G -->|Category B| I[Action B]
74
- G -->|Default| J[Manual Review]
75
- \`\`\`
76
-
77
- **Structured Output Schema Example:**
78
- \`\`\`json
79
- {
80
- "category": "INTERESTED | NOT_INTERESTED | QUESTION",
81
- "confidence": 0.95,
82
- "reasoning": "Customer asked about pricing and availability"
83
- }
84
- \`\`\`
85
-
86
- ## Routing & Branching
87
-
88
- Use Switch node as primary traffic controller:
89
- - Configure cases for each classification value
90
- - Always define Default case for unexpected values
91
- - Each item follows exactly one branch
92
-
93
- Avoid parallel IF nodes that could match multiple conditions - use Switch node.
94
-
95
- ## Recommended Nodes
96
-
97
- **IF** (n8n-nodes-base.if):
98
- - Purpose: Simple binary decisions
99
- - Use when: Two-way branching based on conditions
100
- - Example: Check if priority field equals "high"
101
-
102
- **Switch** (n8n-nodes-base.switch):
103
- - Purpose: Multi-way branching based on field values
104
- - Use when: Multiple categories (3+ outcomes)
105
- - Configure Default output for unmatched items
106
-
107
- **Merge** (n8n-nodes-base.merge):
108
- - Purpose: Consolidate branches for unified logging
109
- - Use after: Category-specific actions before final logging step
110
-
111
- **Text Classifier** (@n8n/n8n-nodes-langchain.textClassifier):
112
- - Purpose: AI-powered text classification with predefined labels
113
- - Use when: Need to assign categories to unstructured text
114
- - Configure "When No Clear Match" option to output items to "Other" branch
115
-
116
- **AI Agent** (@n8n/n8n-nodes-langchain.agent):
117
- - Purpose: Complex classification or scoring requiring multiple steps or tool use
118
- - Use when: Classification needs context lookup, multi-step reasoning with tools, numerical scoring or other complex outputs
119
- - Use structured output format (JSON schema)
120
-
121
- For all AI nodes (Text Classifier, AI Agent):
122
- - Set low temperature of the model (0-0.2) for consistency
123
- - Include few-shot examples in prompts
124
-
125
- ## Common Pitfalls to Avoid
126
-
127
- ### No Default Path
128
- **Problem**: Every Switch must have a Default output. Unmatched items should go to manual review or logging, never drop silently.
129
-
130
- **Solution**: Always configure Default case to route unclassified items to a fallback action (e.g., manual review queue, admin notification)
131
-
132
- ### No "Other" Branch in Text Classifier
133
- **Problem**: Items that don't match any category get dropped if "When No Clear Match" isn't set.
134
-
135
- **Solution**: In Text Classifier node, set "When No Clear Match" to "Output on Extra, 'Other' Branch" to capture unmatched items.
136
-
137
- ### Overlapping Conditions
138
- **Problem**: Categories must be mutually exclusive. Items matching multiple conditions cause unpredictable routing.
139
-
140
- **Solution**:
141
- - Order checks from most specific to general
142
- - Use Switch with distinct values instead of multiple IF nodes
143
- `;
144
- getDocumentation() {
145
- return this.documentation;
146
- }
147
- }
148
- exports.TriageBestPractices = TriageBestPractices;
149
- //# sourceMappingURL=triage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"triage.js","sourceRoot":"","sources":["../../../src/tools/best-practices/triage.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,mBAAmB;IACtB,SAAS,GAAG,kCAAiB,CAAC,MAAM,CAAC;IACrC,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAhJD,kDAgJC"}