@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,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataExtractionBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class DataExtractionBestPractices {
6
- technique = categorization_1.WorkflowTechnique.DATA_EXTRACTION;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Data Extraction Workflows
9
-
10
- ## Node Selection by Data Type
11
-
12
- Choose the right node for your data source. Use Extract From File for CSV, Excel, PDF, and text files to convert binary data to JSON for further processing.
13
-
14
- Use Information Extractor or AI nodes for extracting structured data from unstructured text such as PDFs or emails using LLMs.
15
-
16
- For binary data, ensure you use nodes like Extract From File to handle files properly.
17
-
18
- ### Referencing Binary Data from Other Nodes
19
- When you need to reference binary data from a previous node, use this syntax:
20
- - Expression: '{{ $('Node Name').item.binary.property_name }}' or {{ $binary.property_name }} if previous item
21
- - Example for Gmail attachments: '{{ $('Gmail Trigger').item.binary.attachment_0 }}' or {{ $binary.attachment_0 }} if previous item
22
- - Example for webhook data: '{{ $('Webhook').item.binary.data }}' or {{ $binary.data }} if previous item
23
- - Important: The property name depends on how the previous node names the binary data
24
-
25
- ## Data Structure & Type Management
26
-
27
- Normalize data structure early in your workflow. Use transformation nodes like Split Out, Aggregate, or Set to ensure your data matches n8n's expected structure: an array of objects with a json key.
28
- Not transforming incoming data to n8n's expected format causes downstream node failures.
29
-
30
- When working with large amounts of information, n8n's display can be hard to view. Use the Edit Fields node to help organize and view data more clearly during development and debugging.
31
-
32
- ## Large File Handling
33
-
34
- Process files in batches or use sub-workflows to avoid memory issues. For large binary files, consider enabling filesystem mode (N8N_DEFAULT_BINARY_DATA_MODE=filesystem) if self-hosted, to store binary data on disk instead of memory.
35
-
36
- Processing too many items or large files at once can crash your instance. Always batch or split processing for large datasets to manage memory effectively.
37
-
38
- ## Binary Data Management
39
-
40
- Binary data can be lost if intermediate nodes (like Set or Code) do not have "Include Other Input Fields" enabled, especially in sub-workflows. Always verify binary data is preserved through your workflow pipeline.
41
-
42
- ## AI-Powered Extraction
43
-
44
- Leverage AI for unstructured data using nodes like Information Extractor or Summarization Chain to extract structured data from unstructured sources such as PDFs, emails, or web pages.
45
-
46
- ## Recommended Nodes
47
-
48
- ### Loop Over Items (n8n-nodes-base.splitInBatches)
49
-
50
- Purpose: Looping over a set of items extracted from a data set, for example if pulling a lot of data
51
- from a Google Sheet or database then looping over the items is required. This node MUST be used
52
- if the user mentions a large amount of data, it is necessary to batch the data to process all of it.
53
-
54
- ### Extract From File (n8n-nodes-base.extractFromFile)
55
-
56
- Purpose: Converts binary data from CSV, Excel, PDF, and text files to JSON for processing
57
-
58
- Pitfalls:
59
-
60
- - Ensure the correct binary field name is specified in the node configuration
61
- - Verify file format compatibility before extraction
62
-
63
- ### HTML Extract (n8n-nodes-base.htmlExtract)
64
-
65
- Purpose: Scrapes data from web pages using CSS selectors
66
-
67
- ### Split Out (n8n-nodes-base.splitOut)
68
-
69
- Purpose: Processes arrays of items individually for sequential operations.
70
- Example: If retrieving a JSON array using a HTTP request, this will return a single item,
71
- containing that array. If you wish to use a Loop Over Items (n8n-nodes-base.splitInBatches) node]
72
- then you will need to split out the array into items before looping over it. In a scenario like
73
- this a split out node MUST be used before looping over the items.
74
-
75
- ### Edit Fields (Set) (n8n-nodes-base.set)
76
-
77
- Purpose: Data transformation and mapping to normalize structure
78
-
79
- Pitfalls:
80
-
81
- - Enable "Include Other Input Fields" to preserve binary data
82
- - Pay attention to data types - mixing types causes unexpected failures
83
-
84
- ### Information Extractor (@n8n/n8n-nodes-langchain.informationExtractor)
85
-
86
- Purpose: AI-powered extraction of structured data from unstructured text
87
-
88
- Pitfalls:
89
-
90
- - Requires proper schema definition for extraction
91
-
92
- ### Summarization Chain (@n8n/n8n-nodes-langchain.chainSummarization)
93
-
94
- Purpose: Summarizes large text blocks using AI for condensed information extraction
95
-
96
- Pitfalls:
97
-
98
- - Context window limits may truncate very long documents
99
- - Verify summary quality matches requirements
100
-
101
- ### HTTP Request (n8n-nodes-base.httpRequest)
102
-
103
- Purpose: Fetches data from APIs or web pages for extraction
104
-
105
- ### Code (n8n-nodes-base.code)
106
-
107
- Purpose: Custom logic for complex data transformations
108
-
109
- ## Common Pitfalls to Avoid
110
-
111
- Data Type Confusion: People often mix up data types - n8n can be very lenient but it can lead to problems. Pay close attention to what type you are getting and ensure consistency throughout the workflow.
112
-
113
- Binary Data Loss: Binary data can be lost if intermediate nodes (Set, Code) do not have "Include Other Input Fields" enabled, especially in sub-workflows. Always verify binary data preservation.
114
-
115
- Large Data Display Issues: n8n displaying large amounts of information can be hard to view during development. Use the Edit Fields node to help organize and view data more clearly.
116
- `;
117
- getDocumentation() {
118
- return this.documentation;
119
- }
120
- }
121
- exports.DataExtractionBestPractices = DataExtractionBestPractices;
122
- //# sourceMappingURL=data-extraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-extraction.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-extraction.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,2BAA2B;IAC9B,SAAS,GAAG,kCAAiB,CAAC,eAAe,CAAC;IAC9C,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AArHD,kEAqHC"}
@@ -1,7 +0,0 @@
1
- import type { BestPracticesDocument } from '../../types/best-practices';
2
- export declare class DataPersistenceBestPractices implements BestPracticesDocument {
3
- readonly technique: "data_persistence";
4
- readonly version = "1.0.0";
5
- private readonly documentation;
6
- getDocumentation(): string;
7
- }
@@ -1,197 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataPersistenceBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class DataPersistenceBestPractices {
6
- technique = categorization_1.WorkflowTechnique.DATA_PERSISTENCE;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Data Persistence
9
-
10
- ## Overview
11
-
12
- Data persistence involves storing, updating, or retrieving records from durable storage systems. This technique is essential when you need to maintain data beyond the lifetime of a single workflow execution, or when you need to access existing data that users have stored in their spreadsheets, tables, or databases as part of your workflow logic.
13
-
14
- ## When to Use Data Persistence
15
-
16
- Use data persistence when you need to:
17
- - Store workflow results for later retrieval or audit trails
18
- - Maintain records that multiple workflows can access and update
19
- - Create a centralized data repository for your automation
20
- - Archive historical data for reporting or compliance
21
- - Build data that persists across workflow executions
22
- - Track changes or maintain state over time
23
- - Store raw form inputs
24
-
25
- ## Choosing the Right Storage Node
26
-
27
- ### Data Table (n8n-nodes-base.dataTable) - PREFERRED
28
-
29
- **Best for:** Quick setup, small to medium amounts of data
30
-
31
- Advantages:
32
- - No credentials or external configuration required
33
- - Built directly into n8n
34
- - Fast and reliable for small to medium datasets
35
- - Ideal for prototyping and internal workflows
36
- - No additional costs or external dependencies
37
-
38
- When to use:
39
- - Internal workflow data storage
40
- - Temporary or staging data
41
- - Admin/audit trails
42
- - Simple record keeping
43
- - Development and testing
44
-
45
- ### Google Sheets (n8n-nodes-base.googleSheets)
46
-
47
- **Best for:** Collaboration, reporting, easy data sharing
48
-
49
- Advantages:
50
- - Familiar spreadsheet interface for non-technical users
51
- - Easy to share and collaborate on data
52
- - Built-in visualization and formula capabilities
53
- - Good for reporting and dashboards
54
- - Accessible from anywhere
55
-
56
- When to use:
57
- - Data needs to be viewed/edited by multiple people
58
- - Non-technical users need access to data
59
- - Integration with other Google Workspace tools
60
- - Simple data structures without complex relationships
61
- - Workflow needs access to existing spreadsheets in Google Sheets
62
-
63
- Pitfalls:
64
- - API rate limits can affect high-volume workflows
65
- - Not suitable for frequently changing data
66
- - Performance degrades with very large datasets (>10k rows)
67
-
68
- ### Airtable (n8n-nodes-base.airtable)
69
-
70
- **Best for:** Structured data with relationships, rich field types
71
-
72
- Advantages:
73
- - Supports relationships between tables
74
- - Rich field types (attachments, select, links, etc.)
75
- - Better structure than spreadsheets
76
-
77
- When to use:
78
- - Data has relationships or references between records
79
- - Need structured database-like features
80
- - Managing projects, tasks, or inventory
81
- - Workflow needs access to existing data in Airtable
82
-
83
- Pitfalls:
84
- - Requires Airtable account and API key
85
- - Schema changes require careful planning
86
-
87
- ## Storage Patterns
88
-
89
- ### Immediate Storage Pattern
90
-
91
- Store data immediately after collection or generation:
92
-
93
- \`\`\`mermaid
94
- flowchart LR
95
- Trigger --> Process_Data["Process Data"]
96
- Process_Data --> Storage_Node["Storage Node"]
97
- Storage_Node --> Continue_Workflow["Continue Workflow"]
98
- \`\`\`
99
-
100
- Best for: Raw data preservation, audit trails, form submissions
101
-
102
- ### Batch Storage Pattern
103
-
104
- Collect multiple items and store them together:
105
-
106
- \`\`\`mermaid
107
- flowchart LR
108
- Trigger --> Loop_Split["Loop/Split"]
109
- Loop_Split --> Process["Process"]
110
- Process --> Aggregate["Aggregate"]
111
- Aggregate --> Storage_Node["Storage Node"]
112
- \`\`\`
113
-
114
- Best for: Processing lists, batch operations, scheduled aggregations
115
-
116
- ### Update Pattern
117
-
118
- Retrieve, modify, and update existing records:
119
-
120
- \`\`\`mermaid
121
- flowchart LR
122
- Trigger --> Retrieve["Retrieve from Storage"]
123
- Retrieve --> Modify["Modify"]
124
- Modify --> Update_Storage["Update Storage Node"]
125
- \`\`\`
126
-
127
- Best for: Maintaining state, updating records, tracking changes
128
-
129
- ### Lookup Pattern
130
-
131
- Query storage to retrieve specific records:
132
-
133
- \`\`\`mermaid
134
- flowchart LR
135
- Trigger --> Query_Storage["Query Storage Node"]
136
- Query_Storage --> Use_Data["Use Retrieved Data"]
137
- Use_Data --> Continue_Workflow["Continue Workflow"]
138
- \`\`\`
139
-
140
- Best for: Enrichment, validation, conditional logic based on stored data
141
-
142
- ## Key Considerations
143
-
144
- ### Data Structure
145
-
146
- - **Plan your schema ahead:** Define what fields you need before creating storage
147
- - **Use consistent field names:** Match field names across your workflow for easy mapping
148
- - **Consider data types:** Ensure your storage supports the data types you need
149
- - **Think about relationships:** If data is related, consider Airtable or use multiple tables
150
-
151
- ### Performance
152
-
153
- - **Batch operations when possible:** Multiple small writes are slower than batch operations
154
- - **Use appropriate operations:** Use "append" for new records, "update" for modifications
155
- - **Consider API limits:** Google Sheets has rate limits; plan accordingly for high-volume workflows
156
-
157
- ### Data Integrity
158
-
159
- - **Store raw data first:** Keep unmodified input before transformations
160
- - **Handle errors gracefully:** Use error handling to prevent data loss on failures
161
- - **Validate before storing:** Ensure data quality before persistence
162
- - **Avoid duplicates:** Use unique identifiers or upsert operations when appropriate
163
-
164
- ## Referencing Documents, Sheets, or Tables
165
-
166
- When configuring storage nodes, use ResourceLocator mode "list". This will allow users to select from existing documents, sheets, or tables rather than passing IDs dynamically.
167
- Use modes "id", "url" or "name" only when user specifically mentions it in their prompt.
168
-
169
- ## Important Distinctions
170
-
171
- ### Storage vs. Transformation
172
-
173
- - **Set/Merge nodes are NOT storage:** They transform data in memory only
174
- - **Storage happens explicitly:** Data won't persist unless you explicitly write it to storage
175
-
176
- ### Temporary vs. Persistent Storage
177
-
178
- - **NOT covered by this technique:** Redis, caching, session storage, in-memory operations
179
- - **This technique covers:** Durable storage that persists beyond workflow execution
180
- - **Focus on permanence:** Use these nodes when you need data to survive restarts and be queryable later
181
-
182
- ## Common Pitfalls to Avoid
183
-
184
- ### Not Handling Duplicates
185
-
186
- Without proper unique identifiers or upsert logic, you may create duplicate records. Use unique IDs or check for existing records before inserting.
187
-
188
- ### Ignoring Storage Limits
189
-
190
- Each storage system has limits (row counts, API rates, file sizes). Design your workflow to work within these constraints or implement pagination/batching.
191
- `;
192
- getDocumentation() {
193
- return this.documentation;
194
- }
195
- }
196
- exports.DataPersistenceBestPractices = DataPersistenceBestPractices;
197
- //# sourceMappingURL=data-persistence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-persistence.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-persistence.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,4BAA4B;IAC/B,SAAS,GAAG,kCAAiB,CAAC,gBAAgB,CAAC;IAC/C,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuLjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAhMD,oEAgMC"}
@@ -1,7 +0,0 @@
1
- import type { BestPracticesDocument } from '../../types/best-practices';
2
- export declare class DataTransformationBestPractices implements BestPracticesDocument {
3
- readonly technique: "data_transformation";
4
- readonly version = "1.0.0";
5
- private readonly documentation;
6
- getDocumentation(): string;
7
- }
@@ -1,146 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataTransformationBestPractices = void 0;
4
- const categorization_1 = require("../../types/categorization");
5
- class DataTransformationBestPractices {
6
- technique = categorization_1.WorkflowTechnique.DATA_TRANSFORMATION;
7
- version = '1.0.0';
8
- documentation = `# Best Practices: Data Transformation
9
-
10
- ## Workflow Design
11
-
12
- ### Core Principles
13
- - **Structure**: Always follow Input → Transform → Output pattern
14
- - **Optimization**: Filter and reduce data early to improve performance
15
-
16
- ### Design Best Practices
17
- - Plan transformation requirements in plain language before building
18
- - Use Modular Design: Create reusable sub-workflows for common tasks like "Data Cleaning" or "Error Handler"
19
- - Batch datasets over 100 items using Split In Batches node to prevent timeouts
20
-
21
- ## Recommended Nodes
22
-
23
- ### Essential Transformation Nodes
24
-
25
- #### Edit Fields (Set) (n8n-nodes-base.set)
26
-
27
- **Purpose**: Create, modify, rename fields; change data types
28
-
29
- **Key Setting**: "Keep Only Set" - drops all fields not explicitly defined (default: disabled)
30
-
31
- **Use Cases**:
32
- - Extract specific columns
33
- - Add calculated fields
34
- - Convert data types (string to number)
35
- - Format dates using expressions
36
-
37
- **Pitfalls**:
38
- - Not understanding "Keep Only Set" behavior can lead to data loss
39
- - Enabled: Drops all fields not explicitly defined (data loss risk)
40
- - Disabled: Carries forward all fields (potential bloat)
41
- - Always verify output structure after configuration
42
-
43
- **Testing tip**: When transforming data from a workflow trigger, you can set values with a fallback default e.g. set name to {{$json.name || 'Jane Doe'}} to help test the workflow.
44
-
45
- #### IF/Filter Nodes
46
-
47
- **IF Node** (n8n-nodes-base.if):
48
- - **Purpose**: Conditional processing and routing
49
- - **Best Practice**: Use early to validate inputs and remove bad data
50
- - **Example**: Check if required fields exist before processing
51
-
52
- **Filter Node** (n8n-nodes-base.filter):
53
- - **Purpose**: Filter items based on conditions
54
- - **Best Practice**: Use early in workflow to reduce data volume
55
-
56
- #### Merge Node (n8n-nodes-base.merge)
57
-
58
- **Purpose**: Combine two data streams
59
-
60
- **Modes**:
61
- - Merge by Key (like database join)
62
- - Merge by Index
63
- - Append
64
-
65
- **Pitfalls**:
66
- - **Missing Keys**: Trying to merge on non-existent fields
67
- - **Field Name Mismatch**: Different field names in sources
68
- - **Solution**: Use Edit Fields node to normalize field names before merging
69
-
70
- #### Code Node (n8n-nodes-base.code)
71
-
72
- **Execution Modes**:
73
- - "Run Once per Item": Process each item independently
74
- - "Run Once for All Items": Access entire dataset (for aggregation)
75
-
76
- **Return Format**: Must return array of objects with json property
77
- \`\`\`javascript
78
- return items; // or return [{ json: {...} }];
79
- \`\`\`
80
-
81
- **Pitfalls**:
82
- - Wrong return format: Not returning array of objects with json property
83
- - Overly complex: Stuffing entire workflow logic in one Code node
84
- - Keep code nodes focused on single transformation aspect
85
-
86
- #### Summarize Node (n8n-nodes-base.summarize)
87
-
88
- **Purpose**: Pivot table-style aggregations (count, sum, average, min/max)
89
-
90
- **Configuration**:
91
- - Fields to Summarize: Choose aggregation function
92
- - Fields to Split By: Grouping keys
93
-
94
- **Output**: Single item with summary or multiple items per group
95
-
96
- ### Data Restructuring Nodes
97
-
98
- - **Split Out** (n8n-nodes-base.splitOut): Convert single item with array into multiple items
99
- - **Aggregate** (n8n-nodes-base.aggregate): Combine multiple items into one
100
- - **Remove Duplicates** (n8n-nodes-base.removeDuplicates): Delete duplicate items based on field criteria
101
- - **Sort** (n8n-nodes-base.sort): Order items alphabetically/numerically
102
- - **Limit** (n8n-nodes-base.limit): Trim to maximum number of items
103
-
104
- ### Batch Processing
105
-
106
- **Split In Batches** (n8n-nodes-base.splitInBatches):
107
- - **Purpose**: Process large datasets in chunks
108
- - **Use When**: Handling 100+ items with expensive operations (API calls, AI)
109
-
110
- ## Input Data Validation
111
- - Validate external data before processing: check for nulls, empty values, and edge cases (special chars, empty arrays)
112
-
113
- ## Common Pitfalls to Avoid
114
-
115
- ### Critical Mistakes
116
-
117
- #### Edit Fields Node Issues
118
- - **Mistake**: Not understanding "Keep Only Set" behavior
119
- - Enabled: Drops all fields not explicitly defined (data loss risk)
120
- - Disabled: Carries forward all fields (potential bloat)
121
- - **Solution**: Always verify output structure after configuration
122
-
123
- #### Code Node Errors
124
- - **Wrong Return Format**: Not returning array of objects with json property
125
- - **Fix**: Always return \`items\` or \`[{ json: {...} }]\`
126
- - **Overly Complex**: Stuffing entire workflow logic in one Code node
127
- - **Fix**: Keep code nodes focused on single transformation aspect
128
-
129
- #### Merge Node Problems
130
- - **Field Name Mismatch**: Different field names in sources
131
- - **Fix**: Normalize field names with Edit Fields before merging
132
-
133
- ### Performance Pitfalls
134
- - Processing large datasets without batching → timeouts
135
- - Not filtering early → unnecessary processing overhead
136
- - Excessive node chaining → visual clutter and slow execution
137
-
138
- ### Data Validation Pitfalls
139
- - Assuming input data is always perfect → runtime errors
140
- `;
141
- getDocumentation() {
142
- return this.documentation;
143
- }
144
- }
145
- exports.DataTransformationBestPractices = DataTransformationBestPractices;
146
- //# sourceMappingURL=data-transformation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-transformation.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-transformation.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,+BAA+B;IAClC,SAAS,GAAG,kCAAiB,CAAC,mBAAmB,CAAC;IAClD,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoIjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA7ID,0EA6IC"}
@@ -1,7 +0,0 @@
1
- import type { BestPracticesDocument } from '../../types/best-practices';
2
- export declare class DocumentProcessingBestPractices implements BestPracticesDocument {
3
- readonly technique: "document_processing";
4
- readonly version = "1.0.0";
5
- private readonly documentation;
6
- getDocumentation(): string;
7
- }