@n8n/workflow-sdk 0.9.0 → 0.11.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 (190) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/codegen/parse-workflow-code.js +12 -1
  3. package/dist/codegen/parse-workflow-code.js.map +1 -1
  4. package/dist/generate-types/generate-types.js +1 -1
  5. package/dist/generate-types/generate-types.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +4 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompts/best-practices/guides/chatbot.d.ts +7 -0
  10. package/dist/prompts/best-practices/guides/chatbot.js +120 -0
  11. package/dist/prompts/best-practices/guides/chatbot.js.map +1 -0
  12. package/dist/prompts/best-practices/guides/content-generation.d.ts +7 -0
  13. package/dist/prompts/best-practices/guides/content-generation.js +117 -0
  14. package/dist/prompts/best-practices/guides/content-generation.js.map +1 -0
  15. package/dist/prompts/best-practices/guides/data-analysis.d.ts +7 -0
  16. package/dist/prompts/best-practices/guides/data-analysis.js +369 -0
  17. package/dist/prompts/best-practices/guides/data-analysis.js.map +1 -0
  18. package/dist/prompts/best-practices/guides/data-extraction.d.ts +7 -0
  19. package/dist/prompts/best-practices/guides/data-extraction.js +124 -0
  20. package/dist/prompts/best-practices/guides/data-extraction.js.map +1 -0
  21. package/dist/prompts/best-practices/guides/data-persistence.d.ts +7 -0
  22. package/dist/prompts/best-practices/guides/data-persistence.js +199 -0
  23. package/dist/prompts/best-practices/guides/data-persistence.js.map +1 -0
  24. package/dist/prompts/best-practices/guides/data-transformation.d.ts +7 -0
  25. package/dist/prompts/best-practices/guides/data-transformation.js +148 -0
  26. package/dist/prompts/best-practices/guides/data-transformation.js.map +1 -0
  27. package/dist/prompts/best-practices/guides/document-processing.d.ts +7 -0
  28. package/dist/prompts/best-practices/guides/document-processing.js +334 -0
  29. package/dist/prompts/best-practices/guides/document-processing.js.map +1 -0
  30. package/dist/prompts/best-practices/guides/enrichment.d.ts +7 -0
  31. package/dist/prompts/best-practices/guides/enrichment.js +273 -0
  32. package/dist/prompts/best-practices/guides/enrichment.js.map +1 -0
  33. package/dist/prompts/best-practices/guides/form-input.d.ts +7 -0
  34. package/dist/prompts/best-practices/guides/form-input.js +175 -0
  35. package/dist/prompts/best-practices/guides/form-input.js.map +1 -0
  36. package/dist/prompts/best-practices/guides/human-in-the-loop.d.ts +7 -0
  37. package/dist/prompts/best-practices/guides/human-in-the-loop.js +270 -0
  38. package/dist/prompts/best-practices/guides/human-in-the-loop.js.map +1 -0
  39. package/dist/prompts/best-practices/guides/knowledge-base.d.ts +7 -0
  40. package/dist/prompts/best-practices/guides/knowledge-base.js +270 -0
  41. package/dist/prompts/best-practices/guides/knowledge-base.js.map +1 -0
  42. package/dist/prompts/best-practices/guides/monitoring.d.ts +7 -0
  43. package/dist/prompts/best-practices/guides/monitoring.js +173 -0
  44. package/dist/prompts/best-practices/guides/monitoring.js.map +1 -0
  45. package/dist/prompts/best-practices/guides/notification.d.ts +7 -0
  46. package/dist/prompts/best-practices/guides/notification.js +137 -0
  47. package/dist/prompts/best-practices/guides/notification.js.map +1 -0
  48. package/dist/prompts/best-practices/guides/scheduling.d.ts +7 -0
  49. package/dist/prompts/best-practices/guides/scheduling.js +154 -0
  50. package/dist/prompts/best-practices/guides/scheduling.js.map +1 -0
  51. package/dist/prompts/best-practices/guides/scraping-and-research.d.ts +7 -0
  52. package/dist/prompts/best-practices/guides/scraping-and-research.js +160 -0
  53. package/dist/prompts/best-practices/guides/scraping-and-research.js.map +1 -0
  54. package/dist/prompts/best-practices/guides/triage.d.ts +7 -0
  55. package/dist/prompts/best-practices/guides/triage.js +151 -0
  56. package/dist/prompts/best-practices/guides/triage.js.map +1 -0
  57. package/dist/prompts/best-practices/index.d.ts +20 -0
  58. package/dist/prompts/best-practices/index.js +69 -0
  59. package/dist/prompts/best-practices/index.js.map +1 -0
  60. package/dist/prompts/best-practices/types.d.ts +25 -0
  61. package/dist/prompts/best-practices/types.js +40 -0
  62. package/dist/prompts/best-practices/types.js.map +1 -0
  63. package/dist/prompts/index.d.ts +3 -0
  64. package/dist/prompts/index.js +25 -0
  65. package/dist/prompts/index.js.map +1 -0
  66. package/dist/prompts/node-guidance/index.d.ts +3 -0
  67. package/dist/prompts/node-guidance/index.js +20 -0
  68. package/dist/prompts/node-guidance/index.js.map +1 -0
  69. package/dist/prompts/node-guidance/node-recommendations/audio-generation.d.ts +2 -0
  70. package/dist/prompts/node-guidance/node-recommendations/audio-generation.js +18 -0
  71. package/dist/prompts/node-guidance/node-recommendations/audio-generation.js.map +1 -0
  72. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.d.ts +2 -0
  73. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.js +27 -0
  74. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.js.map +1 -0
  75. package/dist/prompts/node-guidance/node-recommendations/image-generation.d.ts +2 -0
  76. package/dist/prompts/node-guidance/node-recommendations/image-generation.js +18 -0
  77. package/dist/prompts/node-guidance/node-recommendations/image-generation.js.map +1 -0
  78. package/dist/prompts/node-guidance/node-recommendations/index.d.ts +6 -0
  79. package/dist/prompts/node-guidance/node-recommendations/index.js +17 -0
  80. package/dist/prompts/node-guidance/node-recommendations/index.js.map +1 -0
  81. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.d.ts +2 -0
  82. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.js +27 -0
  83. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.js.map +1 -0
  84. package/dist/prompts/node-guidance/node-recommendations/types.d.ts +26 -0
  85. package/dist/prompts/node-guidance/node-recommendations/types.js +16 -0
  86. package/dist/prompts/node-guidance/node-recommendations/types.js.map +1 -0
  87. package/dist/prompts/node-guidance/node-recommendations/video-generation.d.ts +2 -0
  88. package/dist/prompts/node-guidance/node-recommendations/video-generation.js +15 -0
  89. package/dist/prompts/node-guidance/node-recommendations/video-generation.js.map +1 -0
  90. package/dist/prompts/node-guidance/node-tips/index.d.ts +3 -0
  91. package/dist/prompts/node-guidance/node-tips/index.js +8 -0
  92. package/dist/prompts/node-guidance/node-tips/index.js.map +1 -0
  93. package/dist/prompts/node-guidance/node-tips/structured-output-parser.d.ts +2 -0
  94. package/dist/prompts/node-guidance/node-tips/structured-output-parser.js +35 -0
  95. package/dist/prompts/node-guidance/node-tips/structured-output-parser.js.map +1 -0
  96. package/dist/prompts/node-guidance/node-tips/types.d.ts +7 -0
  97. package/dist/prompts/node-guidance/node-tips/types.js +3 -0
  98. package/dist/prompts/node-guidance/node-tips/types.js.map +1 -0
  99. package/dist/prompts/node-guidance/node-tips/webhook.d.ts +2 -0
  100. package/dist/prompts/node-guidance/node-tips/webhook.js +38 -0
  101. package/dist/prompts/node-guidance/node-tips/webhook.js.map +1 -0
  102. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.d.ts +2 -0
  103. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.js +70 -0
  104. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.js.map +1 -0
  105. package/dist/prompts/node-guidance/parameter-guides/gmail.d.ts +2 -0
  106. package/dist/prompts/node-guidance/parameter-guides/gmail.js +53 -0
  107. package/dist/prompts/node-guidance/parameter-guides/gmail.js.map +1 -0
  108. package/dist/prompts/node-guidance/parameter-guides/http-request.d.ts +2 -0
  109. package/dist/prompts/node-guidance/parameter-guides/http-request.js +139 -0
  110. package/dist/prompts/node-guidance/parameter-guides/http-request.js.map +1 -0
  111. package/dist/prompts/node-guidance/parameter-guides/if-node.d.ts +2 -0
  112. package/dist/prompts/node-guidance/parameter-guides/if-node.js +159 -0
  113. package/dist/prompts/node-guidance/parameter-guides/if-node.js.map +1 -0
  114. package/dist/prompts/node-guidance/parameter-guides/index.d.ts +12 -0
  115. package/dist/prompts/node-guidance/parameter-guides/index.js +26 -0
  116. package/dist/prompts/node-guidance/parameter-guides/index.js.map +1 -0
  117. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.d.ts +2 -0
  118. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.js +25 -0
  119. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.js.map +1 -0
  120. package/dist/prompts/node-guidance/parameter-guides/resource-locator.d.ts +2 -0
  121. package/dist/prompts/node-guidance/parameter-guides/resource-locator.js +40 -0
  122. package/dist/prompts/node-guidance/parameter-guides/resource-locator.js.map +1 -0
  123. package/dist/prompts/node-guidance/parameter-guides/set-node.d.ts +2 -0
  124. package/dist/prompts/node-guidance/parameter-guides/set-node.js +94 -0
  125. package/dist/prompts/node-guidance/parameter-guides/set-node.js.map +1 -0
  126. package/dist/prompts/node-guidance/parameter-guides/switch-node.d.ts +2 -0
  127. package/dist/prompts/node-guidance/parameter-guides/switch-node.js +75 -0
  128. package/dist/prompts/node-guidance/parameter-guides/switch-node.js.map +1 -0
  129. package/dist/prompts/node-guidance/parameter-guides/system-message.d.ts +2 -0
  130. package/dist/prompts/node-guidance/parameter-guides/system-message.js +96 -0
  131. package/dist/prompts/node-guidance/parameter-guides/system-message.js.map +1 -0
  132. package/dist/prompts/node-guidance/parameter-guides/text-fields.d.ts +2 -0
  133. package/dist/prompts/node-guidance/parameter-guides/text-fields.js +31 -0
  134. package/dist/prompts/node-guidance/parameter-guides/text-fields.js.map +1 -0
  135. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.d.ts +2 -0
  136. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.js +76 -0
  137. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.js.map +1 -0
  138. package/dist/prompts/node-guidance/parameter-guides/types.d.ts +18 -0
  139. package/dist/prompts/node-guidance/parameter-guides/types.js +3 -0
  140. package/dist/prompts/node-guidance/parameter-guides/types.js.map +1 -0
  141. package/dist/prompts/node-selection/ai-nodes.d.ts +2 -0
  142. package/dist/prompts/node-selection/ai-nodes.js +35 -0
  143. package/dist/prompts/node-selection/ai-nodes.js.map +1 -0
  144. package/dist/prompts/node-selection/connection-parameters.d.ts +1 -0
  145. package/dist/prompts/node-selection/connection-parameters.js +13 -0
  146. package/dist/prompts/node-selection/connection-parameters.js.map +1 -0
  147. package/dist/prompts/node-selection/index.d.ts +5 -0
  148. package/dist/prompts/node-selection/index.js +16 -0
  149. package/dist/prompts/node-selection/index.js.map +1 -0
  150. package/dist/prompts/node-selection/native-preference.d.ts +1 -0
  151. package/dist/prompts/node-selection/native-preference.js +18 -0
  152. package/dist/prompts/node-selection/native-preference.js.map +1 -0
  153. package/dist/prompts/node-selection/trigger-selection.d.ts +1 -0
  154. package/dist/prompts/node-selection/trigger-selection.js +23 -0
  155. package/dist/prompts/node-selection/trigger-selection.js.map +1 -0
  156. package/dist/prompts/node-selection/use-case-patterns.d.ts +2 -0
  157. package/dist/prompts/node-selection/use-case-patterns.js +58 -0
  158. package/dist/prompts/node-selection/use-case-patterns.js.map +1 -0
  159. package/dist/prompts/sdk-reference/additional-functions.d.ts +1 -0
  160. package/dist/prompts/sdk-reference/additional-functions.js +20 -0
  161. package/dist/prompts/sdk-reference/additional-functions.js.map +1 -0
  162. package/dist/prompts/sdk-reference/expressions.d.ts +1 -0
  163. package/dist/prompts/sdk-reference/expressions.js +34 -0
  164. package/dist/prompts/sdk-reference/expressions.js.map +1 -0
  165. package/dist/prompts/sdk-reference/index.d.ts +5 -0
  166. package/dist/prompts/sdk-reference/index.js +14 -0
  167. package/dist/prompts/sdk-reference/index.js.map +1 -0
  168. package/dist/prompts/sdk-reference/workflow-patterns-detailed.d.ts +1 -0
  169. package/dist/prompts/sdk-reference/workflow-patterns-detailed.js +398 -0
  170. package/dist/prompts/sdk-reference/workflow-patterns-detailed.js.map +1 -0
  171. package/dist/prompts/sdk-reference/workflow-patterns.d.ts +2 -0
  172. package/dist/prompts/sdk-reference/workflow-patterns.js +479 -0
  173. package/dist/prompts/sdk-reference/workflow-patterns.js.map +1 -0
  174. package/dist/prompts/sdk-reference/workflow-rules.d.ts +1 -0
  175. package/dist/prompts/sdk-reference/workflow-rules.js +23 -0
  176. package/dist/prompts/sdk-reference/workflow-rules.js.map +1 -0
  177. package/dist/typeguards.d.ts +3 -0
  178. package/dist/typeguards.js +14 -0
  179. package/dist/typeguards.js.map +1 -0
  180. package/dist/workflow-builder/plugins/defaults.js +1 -0
  181. package/dist/workflow-builder/plugins/defaults.js.map +1 -1
  182. package/dist/workflow-builder/plugins/validators/filter-node-validator.d.ts +2 -0
  183. package/dist/workflow-builder/plugins/validators/filter-node-validator.js +90 -0
  184. package/dist/workflow-builder/plugins/validators/filter-node-validator.js.map +1 -0
  185. package/dist/workflow-builder/plugins/validators/index.d.ts +1 -0
  186. package/dist/workflow-builder/plugins/validators/index.js +3 -1
  187. package/dist/workflow-builder/plugins/validators/index.js.map +1 -1
  188. package/dist/workflow-builder.js +15 -0
  189. package/dist/workflow-builder.js.map +1 -1
  190. package/package.json +48 -2
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchedulingBestPractices = void 0;
4
+ const types_1 = require("../types");
5
+ class SchedulingBestPractices {
6
+ constructor() {
7
+ this.technique = types_1.WorkflowTechnique.SCHEDULING;
8
+ this.version = '1.0.0';
9
+ this.documentation = `# Best Practices: Scheduling Workflows
10
+
11
+ ## Workflow Design
12
+
13
+ Structure scheduled workflows to perform focused, well-defined tasks.
14
+
15
+ For recurring tasks, use Schedule Trigger node with clear naming (e.g., "Daily 08:00 Trigger", "Every 6h Cron").
16
+
17
+ Prevent overlapping executions by ensuring worst-case execution time < schedule interval. For frequent schedules, implement mutex/lock mechanisms using external systems if needed.
18
+
19
+ ## Scheduling Patterns
20
+
21
+ ### Recurring Schedules
22
+
23
+ Use Schedule Trigger in two modes:
24
+ - **Interval Mode**: User-friendly dropdowns for common schedules (every X minutes, daily at 09:00, weekly on Mondays)
25
+ - **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
26
+
27
+ Multiple schedules can be combined in single Schedule Trigger node using multiple Trigger Rules. Useful when same logic applies to different timings.
28
+
29
+ ### One-Time Events
30
+
31
+ For event-relative scheduling, use Wait node to pause workflow until specified time/date.
32
+
33
+ Note: Cron expressions with specific dates (e.g., \`0 12 22 10 *\` for Oct 22 at 12:00) will repeat annually on that date.
34
+
35
+ ### Conditional Scheduling
36
+
37
+ PREFER conditional logic over complex cron expressions. Use IF/Switch nodes after Schedule Trigger for runtime conditions:
38
+ - Check if today is last day of month before running monthly reports
39
+ - Skip execution on holidays by checking against a holiday list in a data table
40
+ - Route to "weekday" vs "weekend" processing based on current day
41
+
42
+ This approach is more readable and maintainable than complex cron patterns.
43
+
44
+ ## Time Zone Handling
45
+
46
+ When building scheduled workflows:
47
+ - If user specifies a timezone, set it in the Schedule Trigger node's timezone parameter
48
+ - If user mentions times without timezone, use the schedule as specified (instance default will apply)
49
+ - For Wait nodes, be aware they use server system time, not workflow timezone
50
+
51
+ ## Recommended Nodes
52
+
53
+ ### Schedule Trigger (n8n-nodes-base.scheduleTrigger)
54
+
55
+ Primary node for running workflows on schedule. Supports interval mode for simple schedules and cron mode for complex patterns.
56
+
57
+ ### Wait (n8n-nodes-base.wait)
58
+
59
+ Pause workflow execution until specified time or duration.
60
+
61
+ Use Cases:
62
+ - Delay actions relative to events
63
+ - One-off timers per data item
64
+ - Follow-up actions after specific duration
65
+
66
+ Best Practices:
67
+ - Use n8n Data Tables for waits longer than 24 hours (store scheduled time, check periodically)
68
+ - Avoid wait times longer than 7 days - use a polling pattern instead
69
+
70
+ ### IF (n8n-nodes-base.if)
71
+
72
+ Add conditional logic to scheduled workflows.
73
+
74
+ Use Cases:
75
+ - Check date conditions (last day of month using expression: \`{{ $now.day === $now.endOf('month').day }}\`)
76
+ - Skip execution based on external data (e.g., holiday check)
77
+ - Route to different actions conditionally
78
+
79
+ Best Practices:
80
+ - Enable "Convert types where required" for comparisons
81
+ - Prefer IF nodes over complex cron expressions for readability
82
+
83
+ ### Switch (n8n-nodes-base.switch)
84
+
85
+ Multiple conditional branches for complex routing.
86
+
87
+ Use Cases:
88
+ - Different actions based on day of week (e.g., \`{{ $now.weekday }}\` returns 1-7)
89
+ - Time-based routing (morning vs afternoon processing)
90
+ - Multi-path conditional execution
91
+
92
+ ### n8n Data Tables (n8n-nodes-base.n8nTables)
93
+
94
+ Purpose: Store scheduling state and pending tasks
95
+
96
+ Use Cases:
97
+ - Track last execution time for catch-up logic
98
+ - Store list of pending one-time tasks with scheduled times
99
+ - Implement custom scheduling queue with polling
100
+
101
+ Best Practices:
102
+ - Query efficiently with proper filters
103
+ - Clean up completed tasks periodically
104
+
105
+ ## Common Pitfalls to Avoid
106
+
107
+ ### Missed Schedules During Downtime
108
+
109
+ **Problem**: Scheduled runs missed when n8n instance is down. No automatic catch-up for missed triggers.
110
+
111
+ **Solution**: Design idempotent workflows with catch-up logic:
112
+ - Store last successful run timestamp in n8n Data Tables
113
+ - On each run, check if enough time has passed since last run
114
+ - 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
115
+
116
+ ### Overlapping Executions
117
+
118
+ **Problem**: Next scheduled run starts before previous completes, causing race conditions or resource conflicts.
119
+
120
+ **Solution**:
121
+ - Increase interval to exceed worst-case execution time
122
+ - Implement mutex/lock using n8n Data Tables (check/set "running" flag at start, clear at end)
123
+ - Add execution check at workflow start
124
+
125
+ ### Wait Node Timezone Confusion
126
+
127
+ **Problem**: Wait node uses server system time, ignoring workflow timezone setting. Wait until "10:00" may not match expected timezone.
128
+
129
+ **Solution**:
130
+ - Account for server timezone when setting Wait times
131
+ - Use relative durations (e.g., "wait 2 hours") instead of absolute times when possible
132
+ - Prefer Schedule Trigger for timezone-aware scheduling
133
+
134
+ ### First Execution Timing
135
+
136
+ **Problem**: First execution after activation doesn't match expected schedule. Activation time affects next run calculation.
137
+
138
+ **Solution**:
139
+ - Use manual execution for immediate first run if needed
140
+ - Understand that schedule recalculates from activation moment
141
+
142
+ ### Cron Syntax
143
+
144
+ 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).
145
+
146
+ For simple schedules, prefer Interval mode over cron for better readability.
147
+ `;
148
+ }
149
+ getDocumentation() {
150
+ return this.documentation;
151
+ }
152
+ }
153
+ exports.SchedulingBestPractices = SchedulingBestPractices;
154
+ //# sourceMappingURL=scheduling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduling.js","sourceRoot":"","sources":["../../../../src/prompts/best-practices/guides/scheduling.ts"],"names":[],"mappings":";;;AACA,oCAA6C;AAE7C,MAAa,uBAAuB;IAApC;QACU,cAAS,GAAG,yBAAiB,CAAC,UAAU,CAAC;QACzC,YAAO,GAAG,OAAO,CAAC;QAEV,kBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0IjC,CAAC;IAKF,CAAC;IAHA,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAnJD,0DAmJC"}
@@ -0,0 +1,7 @@
1
+ import type { BestPracticesDocument } from '../types';
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
+ }
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScrapingAndResearchBestPractices = void 0;
4
+ const types_1 = require("../types");
5
+ class ScrapingAndResearchBestPractices {
6
+ constructor() {
7
+ this.technique = types_1.WorkflowTechnique.SCRAPING_AND_RESEARCH;
8
+ this.version = '1.0.0';
9
+ this.documentation = `# Best Practices: Scraping & Research Workflows
10
+
11
+ ## Performance & Resource Management
12
+
13
+ Batch requests and introduce delays to avoid hitting API rate limits or overloading target servers. Use Wait nodes and
14
+ batching options in HTTP Request nodes. When 429 rate limiting errors occur due to receiving too many requests,
15
+ implement batching to reduce request frequency or use the "Retry on Fail" feature to automatically handle throttled
16
+ responses.
17
+
18
+ Workflows processing large datasets can crash due to memory constraints. Use the Split In Batches node to process 200
19
+ rows at a time to reduce memory usage, leverage built-in nodes instead of custom code, and increase execution timeouts
20
+ via environment variables for better resource management.
21
+
22
+ ## Looping & Pagination
23
+
24
+ Implement robust looping for paginated data. Use Set, IF, and Code nodes to manage page numbers and loop conditions,
25
+ ensuring you don't miss data or create infinite loops. Leverage n8n's built-in mechanisms rather than manual approaches:
26
+ use the $runIndex variable to track iterations without additional code nodes, and employ workflow static data or node
27
+ run indexes to maintain state across loop cycles.
28
+
29
+ ## Recommended Nodes
30
+
31
+ ### HTTP Request (n8n-nodes-base.httpRequest)
32
+
33
+ Purpose: Fetches web pages or API data for scraping and research workflows
34
+
35
+ Pitfalls:
36
+
37
+ - Depending on the data which the user wishes to scrape/research, it maybe against the terms of service to attempt to
38
+ fetch it from the site directly. Using scraping nodes is the best way to get around this
39
+ - Double-check URL formatting, query parameters, and ensure all required fields are present to avoid bad request errors
40
+ - Be aware of 429 rate limiting errors when the service receives too many requests - implement batching or use "Retry on
41
+ Fail" feature
42
+ - Refresh expired tokens, verify API keys, and ensure correct permissions to avoid authentication failures
43
+
44
+ ### SerpAPI (@n8n/n8n-nodes-langchain.toolSerpApi)
45
+
46
+ Purpose: Give an agent the ability to search for research materials and fact-checking results that have been retrieved
47
+ from other sources.
48
+
49
+ ### Perplexity (n8n-nodes-base.perplexityTool)
50
+
51
+ Purpose: Give an agent the ability to search utilising Perplexity, a powerful tool for finding sources/material for
52
+ generating reports and information.
53
+
54
+ ### HTML Extract (n8n-nodes-base.htmlExtract)
55
+
56
+ Purpose: Parses HTML and extracts data using CSS selectors for web scraping
57
+
58
+ Pitfalls:
59
+
60
+ - Some sites use JavaScript to render content, which may not be accessible via simple HTTP requests. Consider using
61
+ browser automation tools or APIs if the HTML appears empty
62
+ - Validate that the CSS selectors match the actual page structure to avoid extraction failures
63
+
64
+ ### Split Out (n8n-nodes-base.splitOut)
65
+
66
+ Purpose: Processes lists of items one by one for sequential operations
67
+
68
+ Pitfalls:
69
+ - Can cause performance issues with very large datasets - consider using Split In Batches instead
70
+
71
+ ### Loop Over Items (Split in Batches) (n8n-nodes-base.splitInBatches)
72
+
73
+ Purpose: Processes lists of items in batches to manage memory and performance
74
+
75
+ Pitfalls:
76
+ - Ensure proper loop configuration to avoid infinite loops or skipped data. The index 0
77
+ (first connection) of the loop is treated as the done state, while the index 1 (second connection)
78
+ is the connection that loops.
79
+ - Use appropriate batch sizes (e.g., 200 rows) to balance memory usage and performance
80
+
81
+ ### Edit Fields (Set) (n8n-nodes-base.set)
82
+
83
+ Purpose: Manipulates data, sets variables for loop control and state management
84
+
85
+ ### Code (n8n-nodes-base.code)
86
+
87
+ Purpose: Implements custom logic for complex data transformations or pagination
88
+
89
+ Pitfalls:
90
+
91
+ - Prefer built-in nodes over custom code to reduce memory usage and improve maintainability
92
+ - Avoid processing very large datasets in a single code execution - use batching
93
+
94
+ ### If (n8n-nodes-base.if)
95
+
96
+ Purpose: Adds conditional logic for error handling, loop control, or data filtering
97
+
98
+ Pitfalls:
99
+ - Validate expressions carefully to avoid unexpected branching behavior
100
+
101
+ ### Wait (n8n-nodes-base.wait)
102
+
103
+ Purpose: Introduces delays to respect rate limits and avoid overloading servers
104
+
105
+ ### Data Tables (n8n-nodes-base.dataTable)
106
+
107
+ Purpose: Stores scraped data in n8n's built-in persistent data storage
108
+
109
+ ### Google Sheets (n8n-nodes-base.googleSheets)
110
+
111
+ Purpose: Stores scraped data in spreadsheets for easy access and sharing
112
+
113
+ ### Microsoft Excel 365 (n8n-nodes-base.microsoftExcel)
114
+
115
+ Purpose: Stores scraped data in Excel files for offline analysis
116
+
117
+ ### Airtable (n8n-nodes-base.airtable)
118
+
119
+ Purpose: Saves structured data to a database with rich data types and relationships
120
+
121
+ ### AI Agent (@n8n/n8n-nodes-langchain.agent)
122
+
123
+ Purpose: For research, summarization, and advanced data extraction. AI agents can autonomously gather information
124
+ from websites, analyze content, and organize findings into structured formats, integrating tools for web scraping,
125
+ content analysis, and database storage
126
+
127
+ ### Scraping Nodes
128
+
129
+ - Phantombuster (n8n-nodes-base.phantombuster)
130
+ - Apify (use HTTP Request or community node)
131
+ - BrightData (use HTTP Request or community node)
132
+
133
+ Purpose: If the user wishes to scrap data from sites like LinkedIn, Facebook, Instagram, Twitter/X, Indeed, Glassdoor
134
+ or any other service similar to these large providers it is better to use a node designed for this. The scraping
135
+ nodes provide access to these datasets while avoiding issues like rate limiting or breaking terms of service for
136
+ sites like these.
137
+
138
+ ## Common Pitfalls to Avoid
139
+
140
+ Bad Request Errors: Double-check URL formatting, query parameters, and ensure all required fields are present to
141
+ avoid 400 errors when making HTTP requests.
142
+
143
+ Rate Limits: Use batching and Wait nodes to avoid 429 errors. When the service receives too many requests, implement
144
+ batching to reduce request frequency or use the "Retry on Fail" feature.
145
+
146
+ Memory Issues: Avoid processing very large datasets in a single run; use batching and increase server resources if
147
+ needed. Use Split In Batches node to process 200 rows at a time, leverage built-in nodes instead of custom code, and
148
+ increase execution timeouts via environment variables.
149
+
150
+ Empty or Unexpected Data: Some sites use JavaScript to render content, which may not be accessible via simple HTTP
151
+ requests. Standard HTTP and HTML parsing nodes fail because sites load data asynchronously via JavaScript, leaving the
152
+ initial HTML empty of actual content. Web scraping nodes can be used to avoid this.
153
+ `;
154
+ }
155
+ getDocumentation() {
156
+ return this.documentation;
157
+ }
158
+ }
159
+ exports.ScrapingAndResearchBestPractices = ScrapingAndResearchBestPractices;
160
+ //# sourceMappingURL=scraping-and-research.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scraping-and-research.js","sourceRoot":"","sources":["../../../../src/prompts/best-practices/guides/scraping-and-research.ts"],"names":[],"mappings":";;;AACA,oCAA6C;AAE7C,MAAa,gCAAgC;IAA7C;QACU,cAAS,GAAG,yBAAiB,CAAC,qBAAqB,CAAC;QACpD,YAAO,GAAG,OAAO,CAAC;QAEV,kBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJjC,CAAC;IAKF,CAAC;IAHA,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAzJD,4EAyJC"}
@@ -0,0 +1,7 @@
1
+ import type { BestPracticesDocument } from '../types';
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
+ }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TriageBestPractices = void 0;
4
+ const types_1 = require("../types");
5
+ class TriageBestPractices {
6
+ constructor() {
7
+ this.technique = types_1.WorkflowTechnique.TRIAGE;
8
+ this.version = '1.0.0';
9
+ this.documentation = `# Best Practices: Triage Workflows
10
+
11
+ ## Workflow Design
12
+
13
+ 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.
14
+
15
+ Define clear categories and outcomes before building. Design in logical stages:
16
+
17
+ 1. **Trigger & Input**: Capture incoming items (webhook, email trigger, form submission, schedule)
18
+ 2. **Preprocessing**: Fetch additional data if needed (CRM lookup, field normalization)
19
+ 3. **Classification**: Assign categories via rules or AI
20
+ 4. **Routing**: Direct items to appropriate branches using Switch node or Text Classifier Node
21
+ 5. **Actions**: Execute category-specific tasks (create tasks, send alerts, update records)
22
+ 6. **Logging**: Track outcomes for monitoring and analysis
23
+
24
+ Include a default/fallback path to catch unclassified items so data is tracked rather than dropped silently.
25
+
26
+ ## Classification Strategies
27
+
28
+ ### Rule-Based Classification
29
+ Use IF/Switch nodes for keyword detection, sender addresses, or numeric thresholds. Chain multiple conditions or use Switch for multi-way branching.
30
+
31
+ Example: IF email contains "urgent" → High Priority branch
32
+
33
+ ### AI-Powered Classification
34
+ For unstructured text or nuanced decisions, use AI nodes with clear prompts and defined output labels.
35
+
36
+ Example prompt: "Classify this email as INTERESTED, NOT_INTERESTED, or QUESTION"
37
+
38
+ Best practices:
39
+ - Use structured output format (JSON with specific fields)
40
+ - Set low temperature parameter of the model (0-0.2) for consistency
41
+ - Include few-shot examples of input + classification
42
+ - Implement error handling for unexpected outputs
43
+
44
+ #### Text Classifier Node
45
+ 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.
46
+
47
+ Example workflow pattern:
48
+ \`\`\`mermaid
49
+ flowchart LR
50
+ A[Webhook Trigger] --> B[Set: Normalize Data]
51
+ B --> C[Text Classifier]
52
+ C --> D{Switch: Route by Category}
53
+ D -->|High Priority| E[Slack: Alert Team]
54
+ D -->|Medium Priority| F[Create Task]
55
+ D -->|Low Priority| G[Log to Sheet]
56
+ D -->|Default| H[Manual Review]
57
+ \`\`\`
58
+
59
+ ### Combined Approach
60
+ 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.
61
+ When using AI with structured output, always add reasoning field alongside category or score to aid debugging.
62
+
63
+ Example workflow pattern:
64
+ \`\`\`mermaid
65
+ flowchart LR
66
+ A[Email Trigger] --> B[Set: Extract Fields]
67
+ B --> C{IF: Contains Keywords}
68
+ C -->|Yes| D[Set: Rule-based Category]
69
+ C -->|No| E[AI Agent: Classify with Structured Output]
70
+ D --> F[Merge]
71
+ E --> F
72
+ F --> G{Switch: Route by Category}
73
+ G -->|Category A| H[Action A]
74
+ G -->|Category B| I[Action B]
75
+ G -->|Default| J[Manual Review]
76
+ \`\`\`
77
+
78
+ **Structured Output Schema Example:**
79
+ \`\`\`json
80
+ {
81
+ "category": "INTERESTED | NOT_INTERESTED | QUESTION",
82
+ "confidence": 0.95,
83
+ "reasoning": "Customer asked about pricing and availability"
84
+ }
85
+ \`\`\`
86
+
87
+ ## Routing & Branching
88
+
89
+ Use Switch node as primary traffic controller:
90
+ - Configure cases for each classification value
91
+ - Always define Default case for unexpected values
92
+ - Each item follows exactly one branch
93
+
94
+ Avoid parallel IF nodes that could match multiple conditions - use Switch node.
95
+
96
+ ## Recommended Nodes
97
+
98
+ **IF** (n8n-nodes-base.if):
99
+ - Purpose: Simple binary decisions
100
+ - Use when: Two-way branching based on conditions
101
+ - Example: Check if priority field equals "high"
102
+
103
+ **Switch** (n8n-nodes-base.switch):
104
+ - Purpose: Multi-way branching based on field values
105
+ - Use when: Multiple categories (3+ outcomes)
106
+ - Configure Default output for unmatched items
107
+
108
+ **Merge** (n8n-nodes-base.merge):
109
+ - Purpose: Consolidate branches for unified logging
110
+ - Use after: Category-specific actions before final logging step
111
+
112
+ **Text Classifier** (@n8n/n8n-nodes-langchain.textClassifier):
113
+ - Purpose: AI-powered text classification with predefined labels
114
+ - Use when: Need to assign categories to unstructured text
115
+ - Configure "When No Clear Match" option to output items to "Other" branch
116
+
117
+ **AI Agent** (@n8n/n8n-nodes-langchain.agent):
118
+ - Purpose: Complex classification or scoring requiring multiple steps or tool use
119
+ - Use when: Classification needs context lookup, multi-step reasoning with tools, numerical scoring or other complex outputs
120
+ - Use structured output format (JSON schema)
121
+
122
+ For all AI nodes (Text Classifier, AI Agent):
123
+ - Set low temperature of the model (0-0.2) for consistency
124
+ - Include few-shot examples in prompts
125
+
126
+ ## Common Pitfalls to Avoid
127
+
128
+ ### No Default Path
129
+ **Problem**: Every Switch must have a Default output. Unmatched items should go to manual review or logging, never drop silently.
130
+
131
+ **Solution**: Always configure Default case to route unclassified items to a fallback action (e.g., manual review queue, admin notification)
132
+
133
+ ### No "Other" Branch in Text Classifier
134
+ **Problem**: Items that don't match any category get dropped if "When No Clear Match" isn't set.
135
+
136
+ **Solution**: In Text Classifier node, set "When No Clear Match" to "Output on Extra, 'Other' Branch" to capture unmatched items.
137
+
138
+ ### Overlapping Conditions
139
+ **Problem**: Categories must be mutually exclusive. Items matching multiple conditions cause unpredictable routing.
140
+
141
+ **Solution**:
142
+ - Order checks from most specific to general
143
+ - Use Switch with distinct values instead of multiple IF nodes
144
+ `;
145
+ }
146
+ getDocumentation() {
147
+ return this.documentation;
148
+ }
149
+ }
150
+ exports.TriageBestPractices = TriageBestPractices;
151
+ //# sourceMappingURL=triage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage.js","sourceRoot":"","sources":["../../../../src/prompts/best-practices/guides/triage.ts"],"names":[],"mappings":";;;AACA,oCAA6C;AAE7C,MAAa,mBAAmB;IAAhC;QACU,cAAS,GAAG,yBAAiB,CAAC,MAAM,CAAC;QACrC,YAAO,GAAG,OAAO,CAAC;QAEV,kBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIjC,CAAC;IAKF,CAAC;IAHA,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAhJD,kDAgJC"}
@@ -0,0 +1,20 @@
1
+ export { WorkflowTechnique, TechniqueDescription } from './types';
2
+ export type { WorkflowTechniqueType, BestPracticesDocument } from './types';
3
+ export { ChatbotBestPractices } from './guides/chatbot';
4
+ export { ContentGenerationBestPractices } from './guides/content-generation';
5
+ export { DataAnalysisBestPractices } from './guides/data-analysis';
6
+ export { DataExtractionBestPractices } from './guides/data-extraction';
7
+ export { DataPersistenceBestPractices } from './guides/data-persistence';
8
+ export { DataTransformationBestPractices } from './guides/data-transformation';
9
+ export { DocumentProcessingBestPractices } from './guides/document-processing';
10
+ export { EnrichmentBestPractices } from './guides/enrichment';
11
+ export { FormInputBestPractices } from './guides/form-input';
12
+ export { HumanInTheLoopBestPractices } from './guides/human-in-the-loop';
13
+ export { KnowledgeBaseBestPractices } from './guides/knowledge-base';
14
+ export { MonitoringBestPractices } from './guides/monitoring';
15
+ export { NotificationBestPractices } from './guides/notification';
16
+ export { SchedulingBestPractices } from './guides/scheduling';
17
+ export { ScrapingAndResearchBestPractices } from './guides/scraping-and-research';
18
+ export { TriageBestPractices } from './guides/triage';
19
+ import type { WorkflowTechniqueType, BestPracticesDocument } from './types';
20
+ export declare const bestPracticesRegistry: Record<WorkflowTechniqueType, BestPracticesDocument | undefined>;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bestPracticesRegistry = exports.TriageBestPractices = exports.ScrapingAndResearchBestPractices = exports.SchedulingBestPractices = exports.NotificationBestPractices = exports.MonitoringBestPractices = exports.KnowledgeBaseBestPractices = exports.HumanInTheLoopBestPractices = exports.FormInputBestPractices = exports.EnrichmentBestPractices = exports.DocumentProcessingBestPractices = exports.DataTransformationBestPractices = exports.DataPersistenceBestPractices = exports.DataExtractionBestPractices = exports.DataAnalysisBestPractices = exports.ContentGenerationBestPractices = exports.ChatbotBestPractices = exports.TechniqueDescription = exports.WorkflowTechnique = void 0;
4
+ var types_1 = require("./types");
5
+ Object.defineProperty(exports, "WorkflowTechnique", { enumerable: true, get: function () { return types_1.WorkflowTechnique; } });
6
+ Object.defineProperty(exports, "TechniqueDescription", { enumerable: true, get: function () { return types_1.TechniqueDescription; } });
7
+ var chatbot_1 = require("./guides/chatbot");
8
+ Object.defineProperty(exports, "ChatbotBestPractices", { enumerable: true, get: function () { return chatbot_1.ChatbotBestPractices; } });
9
+ var content_generation_1 = require("./guides/content-generation");
10
+ Object.defineProperty(exports, "ContentGenerationBestPractices", { enumerable: true, get: function () { return content_generation_1.ContentGenerationBestPractices; } });
11
+ var data_analysis_1 = require("./guides/data-analysis");
12
+ Object.defineProperty(exports, "DataAnalysisBestPractices", { enumerable: true, get: function () { return data_analysis_1.DataAnalysisBestPractices; } });
13
+ var data_extraction_1 = require("./guides/data-extraction");
14
+ Object.defineProperty(exports, "DataExtractionBestPractices", { enumerable: true, get: function () { return data_extraction_1.DataExtractionBestPractices; } });
15
+ var data_persistence_1 = require("./guides/data-persistence");
16
+ Object.defineProperty(exports, "DataPersistenceBestPractices", { enumerable: true, get: function () { return data_persistence_1.DataPersistenceBestPractices; } });
17
+ var data_transformation_1 = require("./guides/data-transformation");
18
+ Object.defineProperty(exports, "DataTransformationBestPractices", { enumerable: true, get: function () { return data_transformation_1.DataTransformationBestPractices; } });
19
+ var document_processing_1 = require("./guides/document-processing");
20
+ Object.defineProperty(exports, "DocumentProcessingBestPractices", { enumerable: true, get: function () { return document_processing_1.DocumentProcessingBestPractices; } });
21
+ var enrichment_1 = require("./guides/enrichment");
22
+ Object.defineProperty(exports, "EnrichmentBestPractices", { enumerable: true, get: function () { return enrichment_1.EnrichmentBestPractices; } });
23
+ var form_input_1 = require("./guides/form-input");
24
+ Object.defineProperty(exports, "FormInputBestPractices", { enumerable: true, get: function () { return form_input_1.FormInputBestPractices; } });
25
+ var human_in_the_loop_1 = require("./guides/human-in-the-loop");
26
+ Object.defineProperty(exports, "HumanInTheLoopBestPractices", { enumerable: true, get: function () { return human_in_the_loop_1.HumanInTheLoopBestPractices; } });
27
+ var knowledge_base_1 = require("./guides/knowledge-base");
28
+ Object.defineProperty(exports, "KnowledgeBaseBestPractices", { enumerable: true, get: function () { return knowledge_base_1.KnowledgeBaseBestPractices; } });
29
+ var monitoring_1 = require("./guides/monitoring");
30
+ Object.defineProperty(exports, "MonitoringBestPractices", { enumerable: true, get: function () { return monitoring_1.MonitoringBestPractices; } });
31
+ var notification_1 = require("./guides/notification");
32
+ Object.defineProperty(exports, "NotificationBestPractices", { enumerable: true, get: function () { return notification_1.NotificationBestPractices; } });
33
+ var scheduling_1 = require("./guides/scheduling");
34
+ Object.defineProperty(exports, "SchedulingBestPractices", { enumerable: true, get: function () { return scheduling_1.SchedulingBestPractices; } });
35
+ var scraping_and_research_1 = require("./guides/scraping-and-research");
36
+ Object.defineProperty(exports, "ScrapingAndResearchBestPractices", { enumerable: true, get: function () { return scraping_and_research_1.ScrapingAndResearchBestPractices; } });
37
+ var triage_1 = require("./guides/triage");
38
+ Object.defineProperty(exports, "TriageBestPractices", { enumerable: true, get: function () { return triage_1.TriageBestPractices; } });
39
+ const chatbot_2 = require("./guides/chatbot");
40
+ const content_generation_2 = require("./guides/content-generation");
41
+ const data_extraction_2 = require("./guides/data-extraction");
42
+ const data_persistence_2 = require("./guides/data-persistence");
43
+ const data_transformation_2 = require("./guides/data-transformation");
44
+ const document_processing_2 = require("./guides/document-processing");
45
+ const form_input_2 = require("./guides/form-input");
46
+ const notification_2 = require("./guides/notification");
47
+ const scheduling_2 = require("./guides/scheduling");
48
+ const scraping_and_research_2 = require("./guides/scraping-and-research");
49
+ const triage_2 = require("./guides/triage");
50
+ const types_2 = require("./types");
51
+ exports.bestPracticesRegistry = {
52
+ [types_2.WorkflowTechnique.SCHEDULING]: new scheduling_2.SchedulingBestPractices(),
53
+ [types_2.WorkflowTechnique.CHATBOT]: new chatbot_2.ChatbotBestPractices(),
54
+ [types_2.WorkflowTechnique.FORM_INPUT]: new form_input_2.FormInputBestPractices(),
55
+ [types_2.WorkflowTechnique.SCRAPING_AND_RESEARCH]: new scraping_and_research_2.ScrapingAndResearchBestPractices(),
56
+ [types_2.WorkflowTechnique.MONITORING]: undefined,
57
+ [types_2.WorkflowTechnique.ENRICHMENT]: undefined,
58
+ [types_2.WorkflowTechnique.TRIAGE]: new triage_2.TriageBestPractices(),
59
+ [types_2.WorkflowTechnique.CONTENT_GENERATION]: new content_generation_2.ContentGenerationBestPractices(),
60
+ [types_2.WorkflowTechnique.DOCUMENT_PROCESSING]: new document_processing_2.DocumentProcessingBestPractices(),
61
+ [types_2.WorkflowTechnique.DATA_EXTRACTION]: new data_extraction_2.DataExtractionBestPractices(),
62
+ [types_2.WorkflowTechnique.DATA_ANALYSIS]: undefined,
63
+ [types_2.WorkflowTechnique.DATA_TRANSFORMATION]: new data_transformation_2.DataTransformationBestPractices(),
64
+ [types_2.WorkflowTechnique.DATA_PERSISTENCE]: new data_persistence_2.DataPersistenceBestPractices(),
65
+ [types_2.WorkflowTechnique.NOTIFICATION]: new notification_2.NotificationBestPractices(),
66
+ [types_2.WorkflowTechnique.KNOWLEDGE_BASE]: undefined,
67
+ [types_2.WorkflowTechnique.HUMAN_IN_THE_LOOP]: undefined,
68
+ };
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/best-practices/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkE;AAAzD,0GAAA,iBAAiB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAGhD,4CAAwD;AAA/C,+GAAA,oBAAoB,OAAA;AAC7B,kEAA6E;AAApE,oIAAA,8BAA8B,OAAA;AACvC,wDAAmE;AAA1D,0HAAA,yBAAyB,OAAA;AAClC,4DAAuE;AAA9D,8HAAA,2BAA2B,OAAA;AACpC,8DAAyE;AAAhE,gIAAA,4BAA4B,OAAA;AACrC,oEAA+E;AAAtE,sIAAA,+BAA+B,OAAA;AACxC,oEAA+E;AAAtE,sIAAA,+BAA+B,OAAA;AACxC,kDAA8D;AAArD,qHAAA,uBAAuB,OAAA;AAChC,kDAA6D;AAApD,oHAAA,sBAAsB,OAAA;AAC/B,gEAAyE;AAAhE,gIAAA,2BAA2B,OAAA;AACpC,0DAAqE;AAA5D,4HAAA,0BAA0B,OAAA;AACnC,kDAA8D;AAArD,qHAAA,uBAAuB,OAAA;AAChC,sDAAkE;AAAzD,yHAAA,yBAAyB,OAAA;AAClC,kDAA8D;AAArD,qHAAA,uBAAuB,OAAA;AAChC,wEAAkF;AAAzE,yIAAA,gCAAgC,OAAA;AACzC,0CAAsD;AAA7C,6GAAA,mBAAmB,OAAA;AAE5B,8CAAwD;AACxD,oEAA6E;AAC7E,8DAAuE;AACvE,gEAAyE;AACzE,sEAA+E;AAC/E,sEAA+E;AAC/E,oDAA6D;AAC7D,wDAAkE;AAClE,oDAA8D;AAC9D,0EAAkF;AAClF,4CAAsD;AAEtD,mCAA4C;AAE/B,QAAA,qBAAqB,GAG9B;IACH,CAAC,yBAAiB,CAAC,UAAU,CAAC,EAAE,IAAI,oCAAuB,EAAE;IAC7D,CAAC,yBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,8BAAoB,EAAE;IACvD,CAAC,yBAAiB,CAAC,UAAU,CAAC,EAAE,IAAI,mCAAsB,EAAE;IAC5D,CAAC,yBAAiB,CAAC,qBAAqB,CAAC,EAAE,IAAI,wDAAgC,EAAE;IACjF,CAAC,yBAAiB,CAAC,UAAU,CAAC,EAAE,SAAS;IACzC,CAAC,yBAAiB,CAAC,UAAU,CAAC,EAAE,SAAS;IACzC,CAAC,yBAAiB,CAAC,MAAM,CAAC,EAAE,IAAI,4BAAmB,EAAE;IACrD,CAAC,yBAAiB,CAAC,kBAAkB,CAAC,EAAE,IAAI,mDAA8B,EAAE;IAC5E,CAAC,yBAAiB,CAAC,mBAAmB,CAAC,EAAE,IAAI,qDAA+B,EAAE;IAC9E,CAAC,yBAAiB,CAAC,eAAe,CAAC,EAAE,IAAI,6CAA2B,EAAE;IACtE,CAAC,yBAAiB,CAAC,aAAa,CAAC,EAAE,SAAS;IAC5C,CAAC,yBAAiB,CAAC,mBAAmB,CAAC,EAAE,IAAI,qDAA+B,EAAE;IAC9E,CAAC,yBAAiB,CAAC,gBAAgB,CAAC,EAAE,IAAI,+CAA4B,EAAE;IACxE,CAAC,yBAAiB,CAAC,YAAY,CAAC,EAAE,IAAI,wCAAyB,EAAE;IACjE,CAAC,yBAAiB,CAAC,cAAc,CAAC,EAAE,SAAS;IAC7C,CAAC,yBAAiB,CAAC,iBAAiB,CAAC,EAAE,SAAS;CAChD,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const WorkflowTechnique: {
2
+ readonly SCHEDULING: "scheduling";
3
+ readonly CHATBOT: "chatbot";
4
+ readonly FORM_INPUT: "form_input";
5
+ readonly SCRAPING_AND_RESEARCH: "scraping_and_research";
6
+ readonly MONITORING: "monitoring";
7
+ readonly ENRICHMENT: "enrichment";
8
+ readonly TRIAGE: "triage";
9
+ readonly CONTENT_GENERATION: "content_generation";
10
+ readonly DOCUMENT_PROCESSING: "document_processing";
11
+ readonly DATA_EXTRACTION: "data_extraction";
12
+ readonly DATA_ANALYSIS: "data_analysis";
13
+ readonly DATA_TRANSFORMATION: "data_transformation";
14
+ readonly DATA_PERSISTENCE: "data_persistence";
15
+ readonly NOTIFICATION: "notification";
16
+ readonly KNOWLEDGE_BASE: "knowledge_base";
17
+ readonly HUMAN_IN_THE_LOOP: "human_in_the_loop";
18
+ };
19
+ export type WorkflowTechniqueType = (typeof WorkflowTechnique)[keyof typeof WorkflowTechnique];
20
+ export declare const TechniqueDescription: Record<WorkflowTechniqueType, string>;
21
+ export interface BestPracticesDocument {
22
+ readonly technique: WorkflowTechniqueType;
23
+ readonly version: string;
24
+ getDocumentation(): string;
25
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TechniqueDescription = exports.WorkflowTechnique = void 0;
4
+ exports.WorkflowTechnique = {
5
+ SCHEDULING: 'scheduling',
6
+ CHATBOT: 'chatbot',
7
+ FORM_INPUT: 'form_input',
8
+ SCRAPING_AND_RESEARCH: 'scraping_and_research',
9
+ MONITORING: 'monitoring',
10
+ ENRICHMENT: 'enrichment',
11
+ TRIAGE: 'triage',
12
+ CONTENT_GENERATION: 'content_generation',
13
+ DOCUMENT_PROCESSING: 'document_processing',
14
+ DATA_EXTRACTION: 'data_extraction',
15
+ DATA_ANALYSIS: 'data_analysis',
16
+ DATA_TRANSFORMATION: 'data_transformation',
17
+ DATA_PERSISTENCE: 'data_persistence',
18
+ NOTIFICATION: 'notification',
19
+ KNOWLEDGE_BASE: 'knowledge_base',
20
+ HUMAN_IN_THE_LOOP: 'human_in_the_loop',
21
+ };
22
+ exports.TechniqueDescription = {
23
+ [exports.WorkflowTechnique.SCHEDULING]: 'Running an action at a specific time or interval',
24
+ [exports.WorkflowTechnique.CHATBOT]: 'Receiving chat messages and replying (built-in chat, Telegram, Slack, MS Teams, etc.)',
25
+ [exports.WorkflowTechnique.FORM_INPUT]: 'Gathering data from users via forms',
26
+ [exports.WorkflowTechnique.SCRAPING_AND_RESEARCH]: 'Methodically collecting information from websites or APIs to compile structured data',
27
+ [exports.WorkflowTechnique.MONITORING]: 'Repeatedly checking service/website status and taking action when conditions are met',
28
+ [exports.WorkflowTechnique.ENRICHMENT]: 'Adding extra details to existing data by merging information from other sources',
29
+ [exports.WorkflowTechnique.TRIAGE]: 'Classifying data for routing or prioritization',
30
+ [exports.WorkflowTechnique.CONTENT_GENERATION]: 'Creating text, images, audio, video, etc.',
31
+ [exports.WorkflowTechnique.DOCUMENT_PROCESSING]: 'Taking action on content within files (PDFs, Word docs, images)',
32
+ [exports.WorkflowTechnique.DATA_EXTRACTION]: 'Pulling specific information from structured or unstructured inputs',
33
+ [exports.WorkflowTechnique.DATA_ANALYSIS]: 'Examining data to find patterns, trends, anomalies, or insights',
34
+ [exports.WorkflowTechnique.DATA_TRANSFORMATION]: 'Cleaning, formatting, or restructuring data (including summarization)',
35
+ [exports.WorkflowTechnique.DATA_PERSISTENCE]: 'Storing, updating, or retrieving records from persistent storage (Google Sheets, Airtable, built-in Data Tables)',
36
+ [exports.WorkflowTechnique.NOTIFICATION]: 'Sending alerts or updates via email, chat, SMS when events occur',
37
+ [exports.WorkflowTechnique.KNOWLEDGE_BASE]: 'Building or using a centralized information collection (usually vector database for LLM use)',
38
+ [exports.WorkflowTechnique.HUMAN_IN_THE_LOOP]: 'Pausing for human decision/input before resuming',
39
+ };
40
+ //# sourceMappingURL=types.js.map