@n8n/ai-workflow-builder 1.3.1 → 1.4.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.
- package/dist/build.tsbuildinfo +1 -1
- package/dist/multi-agent-workflow-subgraphs.d.ts +1 -0
- package/dist/multi-agent-workflow-subgraphs.js +6 -1
- package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
- package/dist/prompts/agents/builder.prompt.js +5 -17
- package/dist/prompts/agents/builder.prompt.js.map +1 -1
- package/dist/prompts/agents/configurator.prompt.js +36 -5
- package/dist/prompts/agents/configurator.prompt.js.map +1 -1
- package/dist/prompts/agents/discovery.prompt.js +63 -10
- package/dist/prompts/agents/discovery.prompt.js.map +1 -1
- package/dist/prompts/chains/categorization.prompt.d.ts +5 -2
- package/dist/prompts/chains/categorization.prompt.js +14 -5
- package/dist/prompts/chains/categorization.prompt.js.map +1 -1
- package/dist/prompts/legacy-agent.prompt.js +2 -9
- package/dist/prompts/legacy-agent.prompt.js.map +1 -1
- package/dist/prompts/shared/node-guidance/index.d.ts +1 -0
- package/dist/prompts/shared/node-guidance/index.js +6 -0
- package/dist/prompts/shared/node-guidance/index.js.map +1 -0
- package/dist/prompts/shared/node-guidance/structured-output-parser.d.ts +2 -0
- package/dist/prompts/shared/node-guidance/structured-output-parser.js +35 -0
- package/dist/prompts/shared/node-guidance/structured-output-parser.js.map +1 -0
- package/dist/tools/best-practices/data-persistence.d.ts +7 -0
- package/dist/tools/best-practices/data-persistence.js +192 -0
- package/dist/tools/best-practices/data-persistence.js.map +1 -0
- package/dist/tools/best-practices/data-transformation.js +0 -16
- package/dist/tools/best-practices/data-transformation.js.map +1 -1
- package/dist/tools/best-practices/document-processing.js +3 -6
- package/dist/tools/best-practices/document-processing.js.map +1 -1
- package/dist/tools/best-practices/index.js +6 -2
- package/dist/tools/best-practices/index.js.map +1 -1
- package/dist/tools/best-practices/notification.js +35 -129
- package/dist/tools/best-practices/notification.js.map +1 -1
- package/dist/tools/best-practices/scraping-and-research.js +1 -4
- package/dist/tools/best-practices/scraping-and-research.js.map +1 -1
- package/dist/tools/best-practices/triage.js +66 -128
- package/dist/tools/best-practices/triage.js.map +1 -1
- package/dist/tools/get-best-practices.tool.d.ts +4 -3
- package/dist/types/categorization.d.ts +1 -0
- package/dist/types/categorization.js +2 -0
- package/dist/types/categorization.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/node-guidance.d.ts +7 -0
- package/dist/types/node-guidance.js +3 -0
- package/dist/types/node-guidance.js.map +1 -0
- package/dist/workflow-builder-agent.js +1 -0
- package/dist/workflow-builder-agent.js.map +1 -1
- package/package.json +5 -5
|
@@ -12,6 +12,7 @@ export interface MultiAgentSubgraphConfig {
|
|
|
12
12
|
checkpointer?: MemorySaver;
|
|
13
13
|
autoCompactThresholdTokens?: number;
|
|
14
14
|
featureFlags?: BuilderFeatureFlags;
|
|
15
|
+
onGenerationSuccess?: () => Promise<void>;
|
|
15
16
|
}
|
|
16
17
|
export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgentSubgraphConfig): import("@langchain/langgraph").CompiledStateGraph<{
|
|
17
18
|
messages: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[];
|
|
@@ -60,7 +60,7 @@ function createSubgraphNodeHandler(subgraph, compiledGraph, name, logger, recurs
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
function createMultiAgentWorkflowWithSubgraphs(config) {
|
|
63
|
-
const { parsedNodeTypes, llmComplexTask, logger, instanceUrl, checkpointer, autoCompactThresholdTokens = constants_1.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS, featureFlags, } = config;
|
|
63
|
+
const { parsedNodeTypes, llmComplexTask, logger, instanceUrl, checkpointer, autoCompactThresholdTokens = constants_1.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS, featureFlags, onGenerationSuccess, } = config;
|
|
64
64
|
const supervisorAgent = new supervisor_agent_1.SupervisorAgent({ llm: llmComplexTask });
|
|
65
65
|
const responderAgent = new responder_agent_1.ResponderAgent({ llm: llmComplexTask });
|
|
66
66
|
const discoverySubgraph = new discovery_subgraph_1.DiscoverySubgraph();
|
|
@@ -105,6 +105,11 @@ function createMultiAgentWorkflowWithSubgraphs(config) {
|
|
|
105
105
|
workflowJSON: state.workflowJSON,
|
|
106
106
|
previousSummary: state.previousSummary,
|
|
107
107
|
});
|
|
108
|
+
if (onGenerationSuccess && !(0, coordination_log_1.hasErrorInLog)(state.coordinationLog)) {
|
|
109
|
+
void Promise.resolve(onGenerationSuccess()).catch((error) => {
|
|
110
|
+
logger?.warn('Failed to execute onGenerationSuccess callback', { error });
|
|
111
|
+
});
|
|
112
|
+
}
|
|
108
113
|
return {
|
|
109
114
|
messages: [response],
|
|
110
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-agent-workflow-subgraphs.js","sourceRoot":"","sources":["../src/multi-agent-workflow-subgraphs.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"multi-agent-workflow-subgraphs.js","sourceRoot":"","sources":["../src/multi-agent-workflow-subgraphs.ts"],"names":[],"mappings":";;AAyHA,sFA2LC;AAnTD,uDAAwD;AACxD,oDAAgF;AAIhF,8DAA0D;AAC1D,gEAA4D;AAC5D,2CAKqB;AACrB,6DAAwD;AACxD,mEAA+D;AAC/D,6EAAyE;AACzE,uEAAmE;AAGnE,uDAA2D;AAC3D,+DAA8E;AAC9E,uEAAiE;AACjE,2DAOgC;AAOhC,SAAS,WAAW,CAAC,IAAY;IAChC,MAAM,WAAW,GAA2B;QAC3C,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,oBAAoB;QAC/B,OAAO,EAAE,kBAAkB;QAC3B,YAAY,EAAE,uBAAuB;KACrC,CAAC;IACF,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC;AACzC,CAAC;AAmBD,SAA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@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildBuilderPrompt = buildBuilderPrompt;
|
|
4
4
|
const builder_1 = require("../builder");
|
|
5
|
+
const node_guidance_1 = require("../shared/node-guidance");
|
|
5
6
|
const BUILDER_ROLE = 'You are a Builder Agent specialized in constructing n8n workflows.';
|
|
6
7
|
const EXECUTION_SEQUENCE = `You MUST follow these steps IN ORDER. Do not skip any step.
|
|
7
8
|
|
|
@@ -38,14 +39,12 @@ Placement rules:
|
|
|
38
39
|
- Connect: Trigger → Workflow Configuration → First processing node
|
|
39
40
|
- Name it "Workflow Configuration"`;
|
|
40
41
|
const DATA_PARSING = `Code nodes are slower than core n8n nodes (like Edit Fields, If, Switch, etc.) as they run in a sandboxed environment. Use Code nodes as a last resort for custom business logic.
|
|
41
|
-
|
|
42
|
+
|
|
43
|
+
${node_guidance_1.structuredOutputParser.recommendation}
|
|
42
44
|
|
|
43
45
|
For AI-generated structured data, use a Structured Output Parser node. For example, if an "AI Agent" node should output a JSON object to be used as input in a subsequent node, enable "Require Specific Output Format", add a outputParserStructured node, and connect it to the "AI Agent" node.
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
1. Create the Structured Output Parser node
|
|
47
|
-
2. Set AI Agent's hasOutputParser: true in connectionParameters
|
|
48
|
-
3. Connect: Structured Output Parser → AI Agent (ai_outputParser connection)`;
|
|
47
|
+
${node_guidance_1.structuredOutputParser.connections}`;
|
|
49
48
|
const PROACTIVE_DESIGN = `Anticipate workflow needs:
|
|
50
49
|
- Switch or If nodes for conditional logic when multiple outcomes exist
|
|
51
50
|
- Edit Fields nodes for data transformation between incompatible formats
|
|
@@ -68,12 +67,7 @@ const CONNECTION_PARAMETERS = `- Static nodes (HTTP Request, Set, Code): reasoni
|
|
|
68
67
|
- Vector Store insert for AI Agent: reasoning="Vector store will be used for AI Agent needs retrieve-as-tool mode", parameters={{ mode: "retrieve-as-tool" }}
|
|
69
68
|
- Document Loader custom: reasoning="Custom mode enables text splitter input", parameters={{ textSplittingMode: "custom" }}
|
|
70
69
|
- Switch with routing rules: reasoning="Switch needs N outputs, creating N rules.values entries with outputKeys", parameters={{ mode: "rules", rules: {{ values: [...] }} }} - see <switch_node_pattern> for full structure`;
|
|
71
|
-
const STRUCTURED_OUTPUT_PARSER =
|
|
72
|
-
- Discovery found Structured Output Parser node → MUST set hasOutputParser: true
|
|
73
|
-
- AI output will be used in conditions (IF/Switch nodes checking $json.field)
|
|
74
|
-
- AI output will be formatted/displayed (HTML emails, reports with specific sections)
|
|
75
|
-
- AI output will be stored in database/data tables with specific fields
|
|
76
|
-
- AI is classifying, scoring, or extracting specific data fields`;
|
|
70
|
+
const STRUCTURED_OUTPUT_PARSER = node_guidance_1.structuredOutputParser.configuration;
|
|
77
71
|
const AI_CONNECTIONS = `n8n connections flow from SOURCE (output) to TARGET (input).
|
|
78
72
|
|
|
79
73
|
Regular "main" connections flow: Source → Target (data flows forward)
|
|
@@ -277,11 +271,6 @@ COMMON MISTAKES TO AVOID:
|
|
|
277
271
|
✅ Calculator Tool → AI Agent (CORRECT)
|
|
278
272
|
✅ Window Buffer Memory → AI Agent (CORRECT)
|
|
279
273
|
</connection_type_reference>`;
|
|
280
|
-
const DATA_TABLES = `**Data Tables VS 3rd party services**
|
|
281
|
-
- Data Tables provide built-in data storage within n8n, allowing you to persist and manage data directly in your workflows without external databases.
|
|
282
|
-
- Use the Data table node (n8n-nodes-base.dataTable) in workflows to retrieve, insert, update, or delete records.
|
|
283
|
-
- When storing, retrieving, or managing structured data within workflows, always prefer using n8n's native Data tables over external services like Google Sheets, Airtable, or other third-party databases if not specified otherwise.
|
|
284
|
-
`;
|
|
285
274
|
const RESTRICTIONS = `- Respond before calling validate_structure
|
|
286
275
|
- Skip validation even if you think structure is correct
|
|
287
276
|
- Add commentary between tool calls - execute tools silently
|
|
@@ -312,7 +301,6 @@ function buildBuilderPrompt() {
|
|
|
312
301
|
.section('switch_node_pattern', SWITCH_NODE_PATTERN)
|
|
313
302
|
.section('node_connection_examples', NODE_CONNECTION_EXAMPLES)
|
|
314
303
|
.section('connection_type_examples', CONNECTION_TYPES)
|
|
315
|
-
.section('data_tables', DATA_TABLES)
|
|
316
304
|
.section('do_not', RESTRICTIONS)
|
|
317
305
|
.section('response_format', RESPONSE_FORMAT)
|
|
318
306
|
.build();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/builder.prompt.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"builder.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/builder.prompt.ts"],"names":[],"mappings":";;AAoTA,gDAsBC;AAnUD,wCAAoC;AACpC,2DAAiE;AAEjE,MAAM,YAAY,GAAG,oEAAoE,CAAC;AAE1F,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;mEAoBwC,CAAC;AAEpE,MAAM,aAAa,GAAG;;;;oFAI8D,CAAC;AAErF,MAAM,oBAAoB,GAAG;;;;;;;mCAOM,CAAC;AAEpC,MAAM,YAAY,GAAG;;EAEnB,sCAAsB,CAAC,cAAc;;;;EAIrC,sCAAsB,CAAC,WAAW,EAAE,CAAC;AAEvC,MAAM,gBAAgB,GAAG;;;;;;;kCAOS,CAAC;AAEnC,MAAM,aAAa,GAAG;;;;;;;mEAO6C,CAAC;AAEpE,MAAM,qBAAqB,GAAG;;;;;4NAK8L,CAAC;AAE7N,MAAM,wBAAwB,GAAG,sCAAsB,CAAC,aAAa,CAAC;AAEtE,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA6BmD,CAAC;AAE3E,MAAM,SAAS,GAAG;iLAC+J,CAAC;AAElL,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BsB,CAAC;AAEvC,MAAM,sBAAsB,GAAG;;;;;;;;;;;mIAWoG,CAAC;AAEpI,MAAM,WAAW,GAAG;;;;;;;;;;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AAY,CAAC;SAC/B,OAAO,CAAC,iBAAiB,EAAE,eAAe,CAAC;SAC3C,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -46,6 +46,29 @@ Examples in parameter configuration:
|
|
|
46
46
|
- "Set field to ={{ $json.fieldName }}"
|
|
47
47
|
- "Set value to ={{ $('Previous Node').item.json.value }}"
|
|
48
48
|
- "Set message to ={{ $('HTTP Request').item.json.message }}"`;
|
|
49
|
+
const EXPRESSION_TECHNIQUES = `Expressions support JavaScript methods
|
|
50
|
+
|
|
51
|
+
Regex operations:
|
|
52
|
+
- Test pattern: ={{ /pattern/.test($json.text) }}
|
|
53
|
+
- Extract match: ={{ $json.text.match(/pattern/)?.[1] }}
|
|
54
|
+
- Replace text: ={{ $json.text.replace(/pattern/, 'replacement') }}
|
|
55
|
+
- Split by pattern: ={{ $json.text.split(/pattern/) }}
|
|
56
|
+
|
|
57
|
+
String operations:
|
|
58
|
+
- Uppercase: ={{ $json.text.toUpperCase() }}
|
|
59
|
+
- Trim whitespace: ={{ $json.text.trim() }}
|
|
60
|
+
- Substring: ={{ $json.text.substring(0, 10) }}
|
|
61
|
+
|
|
62
|
+
Array operations:
|
|
63
|
+
- First item: ={{ $json.items[0] }}
|
|
64
|
+
- Filter: ={{ $json.items.filter(i => i.active) }}
|
|
65
|
+
- Map: ={{ $json.items.map(i => i.name) }}
|
|
66
|
+
- Join: ={{ $json.items.join(', ') }}
|
|
67
|
+
|
|
68
|
+
Generating items from expressions (use with Split Out node):
|
|
69
|
+
- Create array from comma string: ={{ $json.text.split(',') }}
|
|
70
|
+
- Generate range: ={{ Array.from({{length: 5}}, (_, i) => i + 1) }}
|
|
71
|
+
- Use with Split Out node to create multiple output items from a single input`;
|
|
49
72
|
const TOOL_NODE_EXPRESSIONS = `Tool nodes (types ending in "Tool") support $fromAI expressions:
|
|
50
73
|
- "Set sendTo to ={{ $fromAI('to') }}"
|
|
51
74
|
- "Set subject to ={{ $fromAI('subject') }}"
|
|
@@ -64,10 +87,17 @@ const CRITICAL_PARAMETERS = `- HTTP Request: URL, method, headers (if auth neede
|
|
|
64
87
|
- Document Loader: dataType parameter ('binary' for files like PDF, 'json' for JSON data)
|
|
65
88
|
- AI nodes: Prompts, models, configurations
|
|
66
89
|
- Tool nodes: Use $fromAI for dynamic recipient/subject/message fields`;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
90
|
+
const DEFAULT_VALUES_GUIDE = `PRINCIPLE: User requests ALWAYS take precedence. When user specifies a model, parameter, or value - use exactly what they requested.
|
|
91
|
+
|
|
92
|
+
SAFE DEFAULTS - Trust these unless user specifies otherwise:
|
|
93
|
+
- Chat Model nodes (lmChat*): Model defaults are maintained and current by n8n. Only set model parameter when user requests a specific model.
|
|
94
|
+
- Embedding nodes (embeddings*): Model defaults are maintained and current by n8n. Only set model parameter when user requests a specific model.
|
|
95
|
+
- LLM parameters (temperature, topP, maxTokens): Node defaults are sensible. Only configure when user explicitly requests specific values.
|
|
96
|
+
|
|
97
|
+
UNSAFE DEFAULTS - Always set based on workflow context:
|
|
98
|
+
- Document Loader dataType: Defaults to 'json' but MUST be 'binary' when processing files (PDF, DOCX, images, etc.)
|
|
99
|
+
- HTTP Request method: Defaults to GET. Set the request method based on API requirements.
|
|
100
|
+
- Vector Store mode: Context-dependent. Set explicitly: 'insert' for storing documents, 'retrieve' for querying, 'retrieve-as-tool' when used with AI Agent`;
|
|
71
101
|
const SWITCH_NODE_CONFIGURATION = `Switch nodes require configuring rules.values[] array - each entry creates one output:
|
|
72
102
|
|
|
73
103
|
Structure per rule:
|
|
@@ -144,9 +174,10 @@ function buildConfiguratorPrompt() {
|
|
|
144
174
|
.section('workflow_json_detection', WORKFLOW_JSON_DETECTION)
|
|
145
175
|
.section('parameter_configuration', PARAMETER_CONFIGURATION)
|
|
146
176
|
.section('data_referencing', DATA_REFERENCING)
|
|
177
|
+
.section('expression_techniques', EXPRESSION_TECHNIQUES)
|
|
147
178
|
.section('tool_node_expressions', TOOL_NODE_EXPRESSIONS)
|
|
148
179
|
.section('critical_parameters', CRITICAL_PARAMETERS)
|
|
149
|
-
.section('
|
|
180
|
+
.section('default_values_guide', DEFAULT_VALUES_GUIDE)
|
|
150
181
|
.section('switch_node_configuration', SWITCH_NODE_CONFIGURATION)
|
|
151
182
|
.section('node_configuration_examples', NODE_CONFIGURATION_EXAMPLES)
|
|
152
183
|
.section('response_format', RESPONSE_FORMAT)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurator.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/configurator.prompt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"configurator.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/configurator.prompt.ts"],"names":[],"mappings":";;;AAoLA,4DAaC;AAED,0DAgBC;AA5MD,wCAAoC;AAEpC,MAAM,iBAAiB,GACtB,6EAA6E,CAAC;AAE/E,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;uEAoB4C,CAAC;AAExE,MAAM,uBAAuB,GAAG;;iGAEiE,CAAC;AAElG,MAAM,uBAAuB,GAAG;;;;8CAIc,CAAC;AAE/C,MAAM,gBAAgB,GAAG;;;;;;;;;;;8DAWqC,CAAC;AAE/D,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;8EAsBgD,CAAC;AAE/E,MAAM,qBAAqB,GAAG;;;;;;;;;+DASiC,CAAC;AAEhE,MAAM,mBAAmB,GAAG;;;;;;;uEAO2C,CAAC;AAExE,MAAM,oBAAoB,GAAG;;;;;;;;;;4JAU+H,CAAC;AAE7J,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;wEAwBsC,CAAC;AAEzE,MAAM,2BAA2B,GAAG;;;;;;;;;;;;6DAYyB,CAAC;AAE9D,MAAM,eAAe,GAAG;;;8GAGsF,CAAC;AAE/G,MAAM,YAAY,GAAG;;6DAEwC,CAAC;AAGjD,QAAA,mBAAmB,GAAG;;;;;;;;;;;CAWlC,CAAC;AAMF,SAAgB,wBAAwB,CAAC,SAAiB,EAAE,SAAmB;IAC9E,OAAO,CACN,qCAAqC;QACrC,+BAA+B;QAC/B,uBAAuB,SAAS,QAAQ,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,yCAAyC;QACpI,mCAAmC;QACnC,6FAA6F;QAC7F,sDAAsD;QACtD,sGAAsG;QACtG,6EAA6E;QAC7E,wEAAwE;QACxE,wDAAwD,CACxD,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB;IACtC,OAAO,IAAA,gBAAM,GAAE;SACb,OAAO,CAAC,MAAM,EAAE,iBAAiB,CAAC;SAClC,OAAO,CAAC,8BAA8B,EAAE,kBAAkB,CAAC;SAC3D,OAAO,CAAC,yBAAyB,EAAE,uBAAuB,CAAC;SAC3D,OAAO,CAAC,yBAAyB,EAAE,uBAAuB,CAAC;SAC3D,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;SAC7C,OAAO,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;SACvD,OAAO,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;SACvD,OAAO,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;SACnD,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;SACrD,OAAO,CAAC,2BAA2B,EAAE,yBAAyB,CAAC;SAC/D,OAAO,CAAC,6BAA6B,EAAE,2BAA2B,CAAC;SACnE,OAAO,CAAC,iBAAiB,EAAE,eAAe,CAAC;SAC3C,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC/B,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -6,6 +6,7 @@ exports.formatExampleCategorizations = formatExampleCategorizations;
|
|
|
6
6
|
exports.buildDiscoveryPrompt = buildDiscoveryPrompt;
|
|
7
7
|
const categorization_1 = require("../../types/categorization");
|
|
8
8
|
const builder_1 = require("../builder");
|
|
9
|
+
const node_guidance_1 = require("../shared/node-guidance");
|
|
9
10
|
exports.exampleCategorizations = [
|
|
10
11
|
{
|
|
11
12
|
prompt: 'Monitor social channels for product mentions and auto-respond with campaign messages',
|
|
@@ -188,25 +189,76 @@ const SUB_NODES_SEARCHES = `When searching for AI nodes, ALSO search for their r
|
|
|
188
189
|
- "AI Agent" → also search for "Chat Model", "Memory", "Output Parser"
|
|
189
190
|
- "Basic LLM Chain" → also search for "Chat Model", "Output Parser"
|
|
190
191
|
- "Vector Store" → also search for "Embeddings", "Document Loader"`;
|
|
191
|
-
const STRUCTURED_OUTPUT_PARSER =
|
|
192
|
-
|
|
193
|
-
- AI needs to extract specific fields (e.g., score, category, priority, action items)
|
|
194
|
-
- AI needs to classify/categorize data into defined categories
|
|
195
|
-
- Downstream nodes need to access specific fields from AI response (e.g., $json.score, $json.category)
|
|
196
|
-
- Output will be displayed in a formatted way (e.g., HTML email with specific sections)
|
|
197
|
-
- Data needs validation against a schema before processing
|
|
192
|
+
const STRUCTURED_OUTPUT_PARSER = node_guidance_1.structuredOutputParser.usage;
|
|
193
|
+
const CODE_NODE_ALTERNATIVES = `CRITICAL: Prefer native n8n nodes over Code node. Code nodes are slower (sandboxed environment).
|
|
198
194
|
|
|
199
|
-
|
|
195
|
+
**Edit Fields (Set) with expressions is your go-to node for data manipulation:**
|
|
196
|
+
- Adding new fields with values or expressions
|
|
197
|
+
- Renaming or removing fields
|
|
198
|
+
- Mapping data from one structure to another
|
|
199
|
+
- Massaging/transforming field values using expressions
|
|
200
|
+
- Restructuring JSON objects
|
|
201
|
+
- Setting variables or constants
|
|
202
|
+
- Creating hardcoded values, lists and objects
|
|
203
|
+
|
|
204
|
+
**Native node alternatives - use INSTEAD of Code node:**
|
|
205
|
+
|
|
206
|
+
| Task | Use This |
|
|
207
|
+
|------|----------|
|
|
208
|
+
| Add/modify/rename fields | Edit Fields (Set) |
|
|
209
|
+
| Set hardcoded values/config/objects/lists | Edit Fields (Set) |
|
|
210
|
+
| Map/massage/transform data | Edit Fields (Set) |
|
|
211
|
+
| Generate list of items | Edit Fields (Set) + Split Out |
|
|
212
|
+
| Filter items by condition | Filter |
|
|
213
|
+
| Route by condition | If or Switch |
|
|
214
|
+
| Split array into items | Split Out |
|
|
215
|
+
| Combine multiple items | Aggregate |
|
|
216
|
+
| Merge data from branches | Merge |
|
|
217
|
+
| Summarize/pivot data | Summarize |
|
|
218
|
+
| Sort items | Sort |
|
|
219
|
+
| Remove duplicates | Remove Duplicates |
|
|
220
|
+
| Limit items | Limit |
|
|
221
|
+
| Format as HTML | HTML |
|
|
222
|
+
| Parse AI output | Structured Output Parser |
|
|
223
|
+
| Date/time operations | Date & Time |
|
|
224
|
+
| Compare datasets | Compare Datasets |
|
|
225
|
+
| Throw errors | Stop and Error |
|
|
226
|
+
| Regex pattern matching | If node with expression |
|
|
227
|
+
| Extract text with regex | Edit Fields (Set) with expression |
|
|
228
|
+
| Validate text format | If node with regex expression |
|
|
229
|
+
| Parse/extract fields from text | Edit Fields (Set) |
|
|
230
|
+
|
|
231
|
+
**Regex works in expressions - no Code node needed:**
|
|
232
|
+
- Test pattern
|
|
233
|
+
- Extract match
|
|
234
|
+
- Replace text
|
|
235
|
+
- Split by pattern
|
|
236
|
+
|
|
237
|
+
**Code node is ONLY appropriate for:**
|
|
238
|
+
- Complex multi-step algorithms that cannot be expressed in single expressions
|
|
239
|
+
- Operations requiring external libraries or complex data structures
|
|
240
|
+
- Mathematical calculations beyond simple expressions
|
|
241
|
+
|
|
242
|
+
**NEVER use Code node for:**
|
|
243
|
+
- Simple data transformations (use Edit Fields)
|
|
244
|
+
- Setting hardcoded values or configuration (use Edit Fields)
|
|
245
|
+
- Filtering/routing (use Filter, If, Switch)
|
|
246
|
+
- Array operations (use Split Out, Aggregate)
|
|
247
|
+
- Basic data restructuring (use Edit Fields + expressions)
|
|
248
|
+
- Regex operations (use expressions in If or Edit Fields nodes)
|
|
249
|
+
- Text extraction or parsing (use Edit Fields with expressions)
|
|
250
|
+
- Logging using console.log unless user explicitly asks - only useful for debugging, not production`;
|
|
200
251
|
const CRITICAL_RULES = `- NEVER ask clarifying questions
|
|
201
252
|
- ALWAYS call get_best_practices first
|
|
202
253
|
- THEN Call search_nodes to learn about available nodes and their inputs and outputs
|
|
203
|
-
- FINALLY call get_node_details IN PARALLEL for speed to get more details about
|
|
254
|
+
- FINALLY call get_node_details IN PARALLEL for speed to get more details about RELEVANT node
|
|
204
255
|
- ALWAYS extract version number from <version> tag in node details
|
|
205
256
|
- NEVER guess node versions - always use search_nodes to find exact versions
|
|
206
257
|
- ONLY flag connectionChangingParameters if they appear in <input> or <output> expressions
|
|
207
258
|
- If no parameters appear in connection expressions, return empty array []
|
|
208
259
|
- Output ONLY: nodesFound with {{ nodeName, version, reasoning, connectionChangingParameters }}
|
|
209
|
-
- When user specifies a model name (e.g., 'gpt-4.1-mini') try to use this if it is a valid option
|
|
260
|
+
- When user specifies a model name (e.g., 'gpt-4.1-mini') try to use this if it is a valid option
|
|
261
|
+
- PREFER native n8n nodes (especially Edit Fields) over Code node`;
|
|
210
262
|
const RESTRICTIONS = `- Output text commentary between tool calls
|
|
211
263
|
- Include bestPractices or categorization in submit_discovery_results
|
|
212
264
|
- Flag parameters that don't affect connections
|
|
@@ -249,6 +301,7 @@ function buildDiscoveryPrompt(options) {
|
|
|
249
301
|
.section('process', processSteps)
|
|
250
302
|
.section('technique_categorization', TECHNIQUE_CATEGORIZATION)
|
|
251
303
|
.section('technique_clarifications', TECHNIQUE_CLARIFICATIONS)
|
|
304
|
+
.section('code_node_alternatives', CODE_NODE_ALTERNATIVES)
|
|
252
305
|
.section('connection_changing_parameters', CONNECTION_PARAMETERS)
|
|
253
306
|
.section('dynamic_output_nodes', DYNAMIC_OUTPUT_NODES)
|
|
254
307
|
.section('sub_nodes_searches', SUB_NODES_SEARCHES)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/discovery.prompt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"discovery.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/discovery.prompt.ts"],"names":[],"mappings":";;;AA4HA,kDAIC;AAED,oEAIC;AA+MD,oDAkBC;AAhWD,2DAIgC;AAEhC,wCAAoC;AACpC,2DAAiE;AAGpD,QAAA,sBAAsB,GAG9B;IACJ;QACC,MAAM,EAAE,sFAAsF;QAC9F,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,OAAO;YACzB,kCAAiB,CAAC,kBAAkB;SACpC;KACD;IACD;QACC,MAAM,EAAE,+EAA+E;QACvF,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,iBAAiB;YACnC,kCAAiB,CAAC,YAAY;SAC9B;KACD;IACD;QACC,MAAM,EAAE,iFAAiF;QACzF,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,qBAAqB;YACvC,kCAAiB,CAAC,eAAe;YACjC,kCAAiB,CAAC,aAAa;SAC/B;KACD;IACD;QACC,MAAM,EAAE,iFAAiF;QACzF,UAAU,EAAE;YACX,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,eAAe;YACjC,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,UAAU;SAC5B;KACD;IACD;QACC,MAAM,EAAE,sEAAsE;QAC9E,UAAU,EAAE;YACX,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,aAAa;YAC/B,kCAAiB,CAAC,cAAc;SAChC;KACD;IACD;QACC,MAAM,EAAE,uEAAuE;QAC/E,UAAU,EAAE,CAAC,kCAAiB,CAAC,kBAAkB,EAAE,kCAAiB,CAAC,YAAY,CAAC;KAClF;IACD;QACC,MAAM,EACL,oGAAoG;QACrG,UAAU,EAAE;YACX,kCAAiB,CAAC,qBAAqB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AAE,cAAc,CAAC;SACzC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC/B,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -4,16 +4,19 @@ export declare const examplePrompts: ({
|
|
|
4
4
|
techniques: ("chatbot" | "monitoring" | "content_generation")[];
|
|
5
5
|
} | {
|
|
6
6
|
prompt: string;
|
|
7
|
-
techniques: ("form_input" | "
|
|
7
|
+
techniques: ("form_input" | "human_in_the_loop")[];
|
|
8
8
|
} | {
|
|
9
9
|
prompt: string;
|
|
10
|
-
techniques: ("scheduling" | "scraping_and_research" | "data_extraction" | "data_analysis")[];
|
|
10
|
+
techniques: ("scheduling" | "scraping_and_research" | "data_extraction" | "data_analysis" | "data_persistence")[];
|
|
11
11
|
} | {
|
|
12
12
|
prompt: string;
|
|
13
13
|
techniques: ("enrichment" | "document_processing" | "data_extraction" | "data_transformation")[];
|
|
14
14
|
} | {
|
|
15
15
|
prompt: string;
|
|
16
16
|
techniques: ("data_analysis" | "data_transformation" | "knowledge_base")[];
|
|
17
|
+
} | {
|
|
18
|
+
prompt: string;
|
|
19
|
+
techniques: ("form_input" | "data_persistence" | "notification")[];
|
|
17
20
|
})[];
|
|
18
21
|
export declare function formatExamplePrompts(): string;
|
|
19
22
|
export declare function formatTechniqueList(): string;
|
|
@@ -16,11 +16,7 @@ exports.examplePrompts = [
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
prompt: 'Collect partner referral submissions and verify client instances via BigQuery',
|
|
19
|
-
techniques: [
|
|
20
|
-
categorization_1.WorkflowTechnique.FORM_INPUT,
|
|
21
|
-
categorization_1.WorkflowTechnique.HUMAN_IN_THE_LOOP,
|
|
22
|
-
categorization_1.WorkflowTechnique.NOTIFICATION,
|
|
23
|
-
],
|
|
19
|
+
techniques: [categorization_1.WorkflowTechnique.FORM_INPUT, categorization_1.WorkflowTechnique.HUMAN_IN_THE_LOOP],
|
|
24
20
|
},
|
|
25
21
|
{
|
|
26
22
|
prompt: 'Scrape competitor pricing pages weekly and generate a summary report of changes',
|
|
@@ -28,6 +24,7 @@ exports.examplePrompts = [
|
|
|
28
24
|
categorization_1.WorkflowTechnique.SCHEDULING,
|
|
29
25
|
categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH,
|
|
30
26
|
categorization_1.WorkflowTechnique.DATA_EXTRACTION,
|
|
27
|
+
categorization_1.WorkflowTechnique.DATA_PERSISTENCE,
|
|
31
28
|
categorization_1.WorkflowTechnique.DATA_ANALYSIS,
|
|
32
29
|
],
|
|
33
30
|
},
|
|
@@ -48,6 +45,18 @@ exports.examplePrompts = [
|
|
|
48
45
|
categorization_1.WorkflowTechnique.KNOWLEDGE_BASE,
|
|
49
46
|
],
|
|
50
47
|
},
|
|
48
|
+
{
|
|
49
|
+
prompt: 'Store customer feedback from our webhook for later analysis',
|
|
50
|
+
techniques: [categorization_1.WorkflowTechnique.DATA_PERSISTENCE],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
prompt: 'Collect form submissions and save them to Google Sheets with automatic email notifications',
|
|
54
|
+
techniques: [
|
|
55
|
+
categorization_1.WorkflowTechnique.FORM_INPUT,
|
|
56
|
+
categorization_1.WorkflowTechnique.DATA_PERSISTENCE,
|
|
57
|
+
categorization_1.WorkflowTechnique.NOTIFICATION,
|
|
58
|
+
],
|
|
59
|
+
},
|
|
51
60
|
];
|
|
52
61
|
function formatExamplePrompts() {
|
|
53
62
|
return exports.examplePrompts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categorization.prompt.js","sourceRoot":"","sources":["../../../src/prompts/chains/categorization.prompt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"categorization.prompt.js","sourceRoot":"","sources":["../../../src/prompts/chains/categorization.prompt.ts"],"names":[],"mappings":";;;AA6DA,oDAIC;AAGD,kDAIC;AAxED,qDAAyD;AAEzD,2DAAiF;AAGpE,QAAA,cAAc,GAAG;IAC7B;QACC,MAAM,EAAE,sFAAsF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C,OAAO,MAAM,CAAC,OAAO,CAAC,qCAAoB,CAAC;SACzC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,OAAO,GAAG,OAAO,WAAW,EAAE,CAAC;SAC3D,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC;AAGY,QAAA,4BAA4B,GAAG,wBAAc,CAAC,YAAY,CACtE;;;;;;;;;;;;;;EAcC,oBAAoB,EAAE;;;;;;;;;CASvB,CACA,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.mainAgentPrompt = void 0;
|
|
|
4
4
|
exports.createMainAgentPrompt = createMainAgentPrompt;
|
|
5
5
|
const prompts_1 = require("@langchain/core/prompts");
|
|
6
6
|
const instance_url_1 = require("./chains/parameter-updater/instance-url");
|
|
7
|
+
const node_guidance_1 = require("./shared/node-guidance");
|
|
7
8
|
function generateWorkflowCreationPhases(options = {}) {
|
|
8
9
|
const { includeExamplesPhase = false } = options;
|
|
9
10
|
const phases = [
|
|
@@ -403,15 +404,7 @@ update_node_parameters({{
|
|
|
403
404
|
</configuration_requirements>
|
|
404
405
|
|
|
405
406
|
<data_parsing_strategy>
|
|
406
|
-
|
|
407
|
-
Why: Purpose-built parsers are more reliable and handle edge cases better than custom code.
|
|
408
|
-
|
|
409
|
-
For binary file data, use Extract From File node to extract content from files before processing.
|
|
410
|
-
|
|
411
|
-
Use Code nodes only for:
|
|
412
|
-
- Simple string manipulations
|
|
413
|
-
- Already structured data (JSON, CSV)
|
|
414
|
-
- Custom business logic beyond parsing
|
|
407
|
+
${node_guidance_1.structuredOutputParser.recommendation}
|
|
415
408
|
</data_parsing_strategy>
|
|
416
409
|
|
|
417
410
|
<fromAI_expressions>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-agent.prompt.js","sourceRoot":"","sources":["../../src/prompts/legacy-agent.prompt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"legacy-agent.prompt.js","sour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C,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHtC,CAAC;AACF,CAAC;AAED,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCL,CAAC;AAEtB,MAAM,gBAAgB,GAAG;;oBAEL,CAAC;AAQrB,SAAgB,qBAAqB,CAAC,UAAkC,EAAE;IACzE,MAAM,YAAY,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEnD,OAAO,4BAAkB,CAAC,YAAY,CAAC;QACtC;YACC,QAAQ;YACR;gBACC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE;gBACpC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAiB,EAAE;gBACzC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE;gBACzC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE;aAC9E;SACD;QACD,CAAC,aAAa,EAAE,YAAY,CAAC;KAC7B,CAAC,CAAC;AACJ,CAAC;AAMY,QAAA,eAAe,GAAG,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { structuredOutputParser } from './structured-output-parser';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.structuredOutputParser = void 0;
|
|
4
|
+
var structured_output_parser_1 = require("./structured-output-parser");
|
|
5
|
+
Object.defineProperty(exports, "structuredOutputParser", { enumerable: true, get: function () { return structured_output_parser_1.structuredOutputParser; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/prompts/shared/node-guidance/index.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.structuredOutputParser = void 0;
|
|
4
|
+
exports.structuredOutputParser = {
|
|
5
|
+
nodeType: '@n8n/n8n-nodes-langchain.outputParserStructured',
|
|
6
|
+
usage: `Search for "Structured Output Parser" (@n8n/n8n-nodes-langchain.outputParserStructured) when:
|
|
7
|
+
- AI output will be used programmatically (conditions, formatting, database storage, API calls)
|
|
8
|
+
- AI needs to extract specific fields (e.g., score, category, priority, action items)
|
|
9
|
+
- AI needs to classify/categorize data into defined categories
|
|
10
|
+
- Downstream nodes need to access specific fields from AI response (e.g., $json.score, $json.category)
|
|
11
|
+
- Output will be displayed in a formatted way (e.g., HTML email with specific sections)
|
|
12
|
+
- Data needs validation against a schema before processing
|
|
13
|
+
|
|
14
|
+
- Always use search_nodes to find the exact node names and versions - NEVER guess versions`,
|
|
15
|
+
connections: `When Discovery results include AI Agent or Structured Output Parser:
|
|
16
|
+
1. Create the Structured Output Parser node
|
|
17
|
+
2. Set AI Agent's hasOutputParser: true in connectionParameters
|
|
18
|
+
3. Connect: Structured Output Parser → AI Agent (ai_outputParser connection)`,
|
|
19
|
+
configuration: `WHEN TO SET hasOutputParser: true on AI Agent:
|
|
20
|
+
- Discovery found Structured Output Parser node → MUST set hasOutputParser: true
|
|
21
|
+
- AI output will be used in conditions (IF/Switch nodes checking $json.field)
|
|
22
|
+
- AI output will be formatted/displayed (HTML emails, reports with specific sections)
|
|
23
|
+
- AI output will be stored in database/data tables with specific fields
|
|
24
|
+
- AI is classifying, scoring, or extracting specific data fields`,
|
|
25
|
+
recommendation: `For AI-generated structured data, prefer Structured Output Parser nodes over Code nodes.
|
|
26
|
+
Why: Purpose-built parsers are more reliable and handle edge cases better than custom code.
|
|
27
|
+
|
|
28
|
+
For binary file data, use Extract From File node to extract content from files before processing.
|
|
29
|
+
|
|
30
|
+
Use Code nodes only for:
|
|
31
|
+
- Simple string manipulations
|
|
32
|
+
- Already structured data (JSON, CSV)
|
|
33
|
+
- Custom business logic beyond parsing`,
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=structured-output-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured-output-parser.js","sourceRoot":"","sources":["../../../../src/prompts/shared/node-guidance/structured-output-parser.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAiB;IACnD,QAAQ,EAAE,iDAAiD;IAE3D,KAAK,EAAE;;;;;;;;2FAQmF;IAE1F,WAAW,EAAE;;;6EAG+D;IAE5E,aAAa,EAAE;;;;;iEAKiD;IAEhE,cAAc,EAAE;;;;;;;;uCAQsB;CACtC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|