@n8n/ai-workflow-builder 1.5.0 → 1.6.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/agents/responder.agent.js +6 -0
- package/dist/agents/responder.agent.js.map +1 -1
- package/dist/ai-workflow-builder-agent.service.d.ts +3 -1
- package/dist/ai-workflow-builder-agent.service.js +6 -2
- package/dist/ai-workflow-builder-agent.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chains/prompt-categorization.js +1 -2
- package/dist/chains/prompt-categorization.js.map +1 -1
- package/dist/multi-agent-workflow-subgraphs.d.ts +2 -0
- package/dist/multi-agent-workflow-subgraphs.js +2 -1
- package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
- package/dist/prompts/agents/builder.prompt.js +24 -0
- package/dist/prompts/agents/builder.prompt.js.map +1 -1
- package/dist/prompts/agents/configurator.prompt.js +48 -0
- package/dist/prompts/agents/configurator.prompt.js.map +1 -1
- package/dist/prompts/agents/discovery.prompt.js +0 -1
- package/dist/prompts/agents/discovery.prompt.js.map +1 -1
- package/dist/prompts/agents/responder.prompt.d.ts +2 -0
- package/dist/prompts/agents/responder.prompt.js +49 -2
- package/dist/prompts/agents/responder.prompt.js.map +1 -1
- package/dist/prompts/chains/categorization.prompt.d.ts +1 -1
- package/dist/prompts/chains/categorization.prompt.js +1 -1
- package/dist/prompts/chains/parameter-updater/examples/resource-locator.js +90 -2
- package/dist/prompts/chains/parameter-updater/examples/resource-locator.js.map +1 -1
- package/dist/prompts/chains/parameter-updater/guides/resource-locator.js +12 -71
- package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +1 -1
- package/dist/subgraphs/configurator.subgraph.d.ts +15 -1
- package/dist/subgraphs/configurator.subgraph.js +46 -1
- package/dist/subgraphs/configurator.subgraph.js.map +1 -1
- package/dist/tools/best-practices/monitoring.js +1 -8
- package/dist/tools/best-practices/monitoring.js.map +1 -1
- package/dist/tools/best-practices/scheduling.js +0 -2
- package/dist/tools/best-practices/scheduling.js.map +1 -1
- package/dist/tools/get-resource-locator-options.tool.d.ts +6 -0
- package/dist/tools/get-resource-locator-options.tool.js +154 -0
- package/dist/tools/get-resource-locator-options.tool.js.map +1 -0
- package/dist/tools/utils/connection.utils.d.ts +0 -2
- package/dist/tools/utils/connection.utils.js +1 -31
- package/dist/tools/utils/connection.utils.js.map +1 -1
- package/dist/types/callbacks.d.ts +3 -0
- package/dist/types/callbacks.js +3 -0
- package/dist/types/callbacks.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/data-table-helpers.d.ts +20 -0
- package/dist/utils/data-table-helpers.js +92 -0
- package/dist/utils/data-table-helpers.js.map +1 -0
- package/dist/utils/rlc-prefetch.d.ts +21 -0
- package/dist/utils/rlc-prefetch.js +135 -0
- package/dist/utils/rlc-prefetch.js.map +1 -0
- package/dist/validation/checks/connections.js +25 -0
- package/dist/validation/checks/connections.js.map +1 -1
- package/dist/validation/types.d.ts +1 -1
- package/dist/validation/types.js +1 -0
- package/dist/validation/types.js.map +1 -1
- package/dist/workflow-builder-agent.d.ts +3 -0
- package/dist/workflow-builder-agent.js +3 -0
- package/dist/workflow-builder-agent.js.map +1 -1
- package/package.json +5 -5
|
@@ -9,8 +9,7 @@ async function promptCategorizationChain(llm, userPrompt) {
|
|
|
9
9
|
techniques: zod_1.z
|
|
10
10
|
.array(zod_1.z.nativeEnum(categorization_1.WorkflowTechnique))
|
|
11
11
|
.min(0)
|
|
12
|
-
.
|
|
13
|
-
.describe('Zero to five workflow techniques identified in the prompt (maximum of 5)'),
|
|
12
|
+
.describe('Workflow techniques identified in the prompt'),
|
|
14
13
|
confidence: zod_1.z
|
|
15
14
|
.number()
|
|
16
15
|
.min(0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-categorization.js","sourceRoot":"","sources":["../../src/chains/prompt-categorization.ts"],"names":[],"mappings":";;AASA,
|
|
1
|
+
{"version":3,"file":"prompt-categorization.js","sourceRoot":"","sources":["../../src/chains/prompt-categorization.ts"],"names":[],"mappings":";;AASA,8DA6BC;AArCD,6BAAwB;AAExB,kFAGgD;AAChD,2DAAsF;AAE/E,KAAK,UAAU,yBAAyB,CAC9C,GAAkB,EAClB,UAAkB;IAElB,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;QACrC,UAAU,EAAE,OAAC;aACX,KAAK,CAAC,OAAC,CAAC,UAAU,CAAC,kCAAiB,CAAC,CAAC;aACtC,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,8CAA8C,CAAC;QAC1D,UAAU,EAAE,OAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,yDAAyD,CAAC;KACrE,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,GAAG,CAAC,oBAAoB,CAAuB,oBAAoB,CAAC,CAAC;IAEhG,MAAM,MAAM,GAAG,MAAM,oDAA4B,CAAC,MAAM,CAAC;QACxD,UAAU;QACV,UAAU,EAAE,IAAA,2CAAmB,GAAE;KACjC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEjE,OAAO;QACN,UAAU,EAAE,gBAAgB,CAAC,UAAU;QACvC,UAAU,EAAE,gBAAgB,CAAC,UAAU;KACvC,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type MemorySaver } from '@langchain/langgraph';
|
|
2
2
|
import type { Logger } from '@n8n/backend-common';
|
|
3
3
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
4
|
+
import type { ResourceLocatorCallback } from './types/callbacks';
|
|
4
5
|
import type { BuilderFeatureFlags, StageLLMs } from './workflow-builder-agent';
|
|
5
6
|
export interface MultiAgentSubgraphConfig {
|
|
6
7
|
parsedNodeTypes: INodeTypeDescription[];
|
|
@@ -11,6 +12,7 @@ export interface MultiAgentSubgraphConfig {
|
|
|
11
12
|
autoCompactThresholdTokens?: number;
|
|
12
13
|
featureFlags?: BuilderFeatureFlags;
|
|
13
14
|
onGenerationSuccess?: () => Promise<void>;
|
|
15
|
+
resourceLocatorCallback?: ResourceLocatorCallback;
|
|
14
16
|
}
|
|
15
17
|
export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgentSubgraphConfig): import("@langchain/langgraph").CompiledStateGraph<{
|
|
16
18
|
messages: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[];
|
|
@@ -64,7 +64,7 @@ function createSubgraphNodeHandler(subgraph, compiledGraph, name, logger, recurs
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function createMultiAgentWorkflowWithSubgraphs(config) {
|
|
67
|
-
const { parsedNodeTypes, stageLLMs, logger, instanceUrl, checkpointer, autoCompactThresholdTokens = constants_1.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS, featureFlags, onGenerationSuccess, } = config;
|
|
67
|
+
const { parsedNodeTypes, stageLLMs, logger, instanceUrl, checkpointer, autoCompactThresholdTokens = constants_1.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS, featureFlags, onGenerationSuccess, resourceLocatorCallback, } = config;
|
|
68
68
|
const supervisorAgent = new supervisor_agent_1.SupervisorAgent({ llm: stageLLMs.supervisor });
|
|
69
69
|
const responderAgent = new responder_agent_1.ResponderAgent({ llm: stageLLMs.responder });
|
|
70
70
|
const discoverySubgraph = new discovery_subgraph_1.DiscoverySubgraph();
|
|
@@ -89,6 +89,7 @@ function createMultiAgentWorkflowWithSubgraphs(config) {
|
|
|
89
89
|
logger,
|
|
90
90
|
instanceUrl,
|
|
91
91
|
featureFlags,
|
|
92
|
+
resourceLocatorCallback,
|
|
92
93
|
});
|
|
93
94
|
return (new langgraph_1.StateGraph(parent_graph_state_1.ParentGraphState)
|
|
94
95
|
.addNode('supervisor', async (state, config) => {
|
|
@@ -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":";;AAkIA,sFAwMC;AA1UD,uDAAwD;AAExD,oDAAgF;AAIhF,8DAA0D;AAC1D,gEAA4D;AAC5D,2CAKqB;AACrB,6DAAwD;AACxD,mEAA+D;AAC/D,6EAAyE;AACzE,uEAAmE;AAInE,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;AAsBD,SAAS,yBAAyB,CAGjC,QAAmB,EACnB,aAA8C,EAC9C,IAAY,EACZ,MAAe,EACf,cAAuB;IAEvB,OAAO,KAAK,EAAE,KAAoC,EAAE,MAAuB,EAAE,EAAE;QAC9E,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAE7C,MAAM,YAAY,GAAmB;gBACpC,GAAG,MAAM;gBACT,cAAc;aACd,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAC/D,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAEvD,OAAO,MAAM,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EA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B;YACpC,gBAAgB,EAAE,kBAAkB;YACpC,eAAe,EAAE,iBAAiB;YAClC,oBAAoB,EAAE,sBAAsB;YAC5C,qBAAqB,EAAE,kBAAkB;YACzC,iBAAiB,EAAE,mBAAmB;YACtC,QAAQ,EAAE,YAAY;SACtB,CAAC;QACF,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,YAAY,CAAC;IAChD,CAAC,CAAC;SAED,OAAO,CAAC,kBAAkB,EAAE,aAAa,CAAC;SAC1C,OAAO,CAAC,iBAAiB,EAAE,WAAW,CAAC;SACvC,OAAO,CAAC,mBAAmB,EAAE,aAAa,CAAC;SAC3C,OAAO,CAAC,sBAAsB,EAAE,YAAY,CAAC;SAE7C,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE;QAGlD,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9C,OAAO,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IAClD,CAAC,CAAC;SAED,mBAAmB,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;SAE1E,mBAAmB,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE,CACpD,WAAW,CAAC,IAAA,sCAAmB,EAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CACvD;SAEA,OAAO,CAAC,WAAW,EAAE,eAAG,CAAC;SAEzB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC,CAC3B,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildBuilderPrompt = buildBuilderPrompt;
|
|
4
|
+
const data_table_helpers_1 = require("../../utils/data-table-helpers");
|
|
4
5
|
const builder_1 = require("../builder");
|
|
5
6
|
const node_guidance_1 = require("../shared/node-guidance");
|
|
7
|
+
const dataTableColumnOperationsList = data_table_helpers_1.DATA_TABLE_ROW_COLUMN_MAPPING_OPERATIONS.join(', ');
|
|
6
8
|
const BUILDER_ROLE = 'You are a Builder Agent specialized in constructing n8n workflows.';
|
|
7
9
|
const EXECUTION_SEQUENCE = `You MUST follow these steps IN ORDER. Do not skip any step.
|
|
8
10
|
|
|
@@ -319,6 +321,27 @@ AI capability connections:
|
|
|
319
321
|
Common mistake to avoid:
|
|
320
322
|
- NEVER connect Document Loader to main data outputs
|
|
321
323
|
- Document Loader is an AI sub-node that gives Vector Store document processing capability`;
|
|
324
|
+
const DATA_TABLE_PATTERN = `DATA TABLE NODE PATTERN:
|
|
325
|
+
|
|
326
|
+
**Row Column Operations (${dataTableColumnOperationsList}) - REQUIRE Set Node:**
|
|
327
|
+
When using Data Table nodes for row column operations, you MUST add a Set node immediately before the Data Table node.
|
|
328
|
+
|
|
329
|
+
Structure: Set Node → Data Table Node (operation: ${dataTableColumnOperationsList})
|
|
330
|
+
|
|
331
|
+
Why: The Set node defines the columns/fields to write. This tells users exactly which columns to create in their Data Table.
|
|
332
|
+
|
|
333
|
+
Example for storing data:
|
|
334
|
+
- add_nodes(nodeType: "n8n-nodes-base.set", name: "Prepare User Data")
|
|
335
|
+
- add_nodes(nodeType: "n8n-nodes-base.dataTable", name: "Store Users", initialParameters: {{ operation: "insert" }})
|
|
336
|
+
- connect_nodes(source: "Prepare User Data", target: "Store Users")
|
|
337
|
+
|
|
338
|
+
**Row Read Operations (get, getAll, delete) - NO Set Node needed:**
|
|
339
|
+
Read and delete operations don't write data, so they don't need a Set node before them.
|
|
340
|
+
|
|
341
|
+
Example for reading data:
|
|
342
|
+
- add_nodes(nodeType: "n8n-nodes-base.dataTable", name: "Get Users", initialParameters: {{ operation: "get" }})
|
|
343
|
+
|
|
344
|
+
IMPORTANT: For ${dataTableColumnOperationsList} operations, NEVER connect a Data Table node directly to other nodes without a Set node in between.`;
|
|
322
345
|
const SWITCH_NODE_PATTERN = `For Switch nodes with multiple routing paths:
|
|
323
346
|
- The number of outputs is determined by the number of entries in rules.values[]
|
|
324
347
|
- You MUST create the rules.values[] array with placeholder entries for each output branch
|
|
@@ -476,6 +499,7 @@ function buildBuilderPrompt() {
|
|
|
476
499
|
.section('multi_trigger_workflows', MULTI_TRIGGER_WORKFLOWS)
|
|
477
500
|
.section('shared_memory_pattern', SHARED_MEMORY_PATTERN)
|
|
478
501
|
.section('rag_workflow_pattern', RAG_PATTERN)
|
|
502
|
+
.section('data_table_pattern', DATA_TABLE_PATTERN)
|
|
479
503
|
.section('switch_node_pattern', SWITCH_NODE_PATTERN)
|
|
480
504
|
.section('node_connection_examples', NODE_CONNECTION_EXAMPLES)
|
|
481
505
|
.section('connection_type_examples', CONNECTION_TYPES)
|
|
@@ -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":";;AAggBA,gDA2BC;AAphBD,mEAAsF;AAEtF,wCAAoC;AACpC,2DAAiE;AAEjE,MAAM,6BAA6B,GAAG,6DAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE1F,MAAM,YAAY,GAAG,oEAAoE,CAAC;AAE1F,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;mEAoBwC,CAAC;AAEpE,MAAM,aAAa,GAAG;;;;0EAIoD,CAAC;AAE3E,MAAM,oBAAoB,GAAG;;;;;;;mCAOM,CAAC;AAEpC,MAAM,YAAY,GAAG;;EAEnB,sCAAsB,CAAC,cAAc;;;;EAIrC,sCAAsB,CAAC,WAAW,EAAE,CAAC;AAEvC,MAAM,gBAAgB,GAAG;;;;;;CAMxB,CAAC;AAEF,MAAM,aAAa,GAAG;;;;;;;;gEA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ty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.INSTANCE_URL_PROMPT = void 0;
|
|
4
4
|
exports.buildRecoveryModeContext = buildRecoveryModeContext;
|
|
5
5
|
exports.buildConfiguratorPrompt = buildConfiguratorPrompt;
|
|
6
|
+
const data_table_helpers_1 = require("../../utils/data-table-helpers");
|
|
6
7
|
const builder_1 = require("../builder");
|
|
8
|
+
const dataTableColumnOperationsList = data_table_helpers_1.DATA_TABLE_ROW_COLUMN_MAPPING_OPERATIONS.join(', ');
|
|
7
9
|
const CONFIGURATOR_ROLE = 'You are a Configurator Agent specialized in setting up n8n node parameters.';
|
|
8
10
|
const EXECUTION_SEQUENCE = `You MUST follow these steps IN ORDER. Do not skip any step.
|
|
9
11
|
|
|
@@ -96,6 +98,22 @@ const CRITICAL_PARAMETERS = `- HTTP Request: URL, method, headers (if auth neede
|
|
|
96
98
|
- Document Loader: dataType parameter ('binary' for files like PDF, 'json' for JSON data)
|
|
97
99
|
- AI nodes: Prompts, models, configurations
|
|
98
100
|
- Tool nodes: Use $fromAI for dynamic recipient/subject/message fields`;
|
|
101
|
+
const DATA_TABLE_CONFIGURATION = `DATA TABLE NODE CONFIGURATION:
|
|
102
|
+
When configuring Data Table nodes (n8n-nodes-base.dataTable):
|
|
103
|
+
|
|
104
|
+
**For Row Column Operations (${dataTableColumnOperationsList}):**
|
|
105
|
+
- There MUST be a Set node (n8n-nodes-base.set) immediately before the Data Table node
|
|
106
|
+
- Configure the Set node with all the fields the user wants to store
|
|
107
|
+
- Use a PLACEHOLDER for dataTableId (e.g., "<__PLACEHOLDER_VALUE__data_table_name__>")
|
|
108
|
+
- Use columns.mappingMode: "autoMapInputData" (this maps columns from the preceding Set node)
|
|
109
|
+
- Example: "Set dataTableId to placeholder <__PLACEHOLDER_VALUE__my_table__>, set columns mapping mode to autoMapInputData"
|
|
110
|
+
|
|
111
|
+
**For Row Read Operations (get, getAll, delete):**
|
|
112
|
+
- No Set node is required before the Data Table node
|
|
113
|
+
- Still use a PLACEHOLDER for dataTableId
|
|
114
|
+
- Configure any filter or query parameters as needed
|
|
115
|
+
|
|
116
|
+
WHY: Data Tables must be created manually by the user. Using a placeholder ensures users know to create and select their table. For column operations, the Set node defines what columns to create.`;
|
|
99
117
|
const DEFAULT_VALUES_GUIDE = `PRINCIPLE: User requests ALWAYS take precedence. When user specifies a model, parameter, or value - use exactly what they requested.
|
|
100
118
|
|
|
101
119
|
SAFE DEFAULTS - Trust these unless user specifies otherwise:
|
|
@@ -132,6 +150,34 @@ For numeric ranges (e.g., $100-$1000):
|
|
|
132
150
|
- Second: lte (less than or equal)
|
|
133
151
|
|
|
134
152
|
Always set renameOutput: true and provide descriptive outputKey labels.`;
|
|
153
|
+
const RESOURCE_LOCATOR_CONFIGURATION = `RESOURCE LOCATOR PARAMETERS:
|
|
154
|
+
Some node parameters use "resource locator" type. This allows user to select from dynamic lists (calendars, documents, boards, channels, etc.).
|
|
155
|
+
These parameters have a specific structure in the node configuration:
|
|
156
|
+
{{
|
|
157
|
+
"__rl": true,
|
|
158
|
+
"mode": "list",
|
|
159
|
+
"value": "<selected_id>",
|
|
160
|
+
"cachedResultName: "<display_name>"
|
|
161
|
+
}}
|
|
162
|
+
|
|
163
|
+
REQUIRED PROCESS for resource locator parameters:
|
|
164
|
+
1. BEFORE configuring any parameter with "__rl": true, call get_resource_locator_options
|
|
165
|
+
- Provide the nodeId and parameterPath (e.g., "documentId", "calendarId", "boardId")
|
|
166
|
+
- The tool returns available options with display names and IDs
|
|
167
|
+
2. If the user specifies which resource they want, match it to the options and use the correct ID
|
|
168
|
+
3. USE BOTH the display name and the ID when updating the parameter:
|
|
169
|
+
- Format: "Document Name (ID: 1abc...xyz)"
|
|
170
|
+
4. ONLY use values returned by get_resource_locator_options - NEVER assume available options, NEVER guess or hallucinate IDs
|
|
171
|
+
|
|
172
|
+
Example:
|
|
173
|
+
- User says "use the Q4 Report document"
|
|
174
|
+
- Call get_resource_locator_options for the documentId parameter
|
|
175
|
+
- Find "Q4 Report" in the results with ID "1mtaEwM07..."
|
|
176
|
+
- Configure the parameter with the correct ID value and display name
|
|
177
|
+
|
|
178
|
+
NEVER configure resource locator parameters without fetching a list of possible options using get_resource_locator_options
|
|
179
|
+
|
|
180
|
+
Run get_resource_locator_options for all resource locator parameters BEFORE configuring nodes IN PARALLEL to save time`;
|
|
135
181
|
const NODE_CONFIGURATION_EXAMPLES = `NODE CONFIGURATION EXAMPLES:
|
|
136
182
|
When configuring complex nodes, use get_node_configuration_examples to see real-world examples from community templates:
|
|
137
183
|
|
|
@@ -194,10 +240,12 @@ function buildConfiguratorPrompt() {
|
|
|
194
240
|
.section('mandatory_execution_sequence', EXECUTION_SEQUENCE)
|
|
195
241
|
.section('workflow_json_detection', WORKFLOW_JSON_DETECTION)
|
|
196
242
|
.section('parameter_configuration', PARAMETER_CONFIGURATION)
|
|
243
|
+
.section('resource_locator_configuration', RESOURCE_LOCATOR_CONFIGURATION)
|
|
197
244
|
.section('data_referencing', DATA_REFERENCING)
|
|
198
245
|
.section('expression_techniques', EXPRESSION_TECHNIQUES)
|
|
199
246
|
.section('tool_node_expressions', TOOL_NODE_EXPRESSIONS)
|
|
200
247
|
.section('critical_parameters', CRITICAL_PARAMETERS)
|
|
248
|
+
.section('data_table_configuration', DATA_TABLE_CONFIGURATION)
|
|
201
249
|
.section('default_values_guide', DEFAULT_VALUES_GUIDE)
|
|
202
250
|
.section('switch_node_configuration', SWITCH_NODE_CONFIGURATION)
|
|
203
251
|
.section('node_configuration_examples', NODE_CONFIGURATION_EXAMPLES)
|
|
@@ -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":";;;AA4PA,4DAaC;AAED,0DAmBC;AAvRD,mEAAsF;AAEtF,wCAAoC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I,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,gCAAgC,EAAE,8BAA8B,CAAC;SACzE,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,0BAA0B,EAAE,wBAAwB,CAAC;SAC7D,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;SACrD,OAAO,CAAC,2BAA2B,EAAE,yBAAyB,CAAC;SAC/D,OAAO,CAAC,6BAA6B,EAAE,2BAA2B,CAAC;SACnE,OAAO,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;SACnD,OAAO,CAAC,iBAAiB,EAAE,eAAe,CAAC;SAC3C,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC/B,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -143,7 +143,6 @@ const TECHNIQUE_CLARIFICATIONS = `Common distinctions to get right:
|
|
|
143
143
|
|
|
144
144
|
Technique selection rules:
|
|
145
145
|
- Select ALL techniques that apply (most workflows use 2-4)
|
|
146
|
-
- Maximum 5 techniques
|
|
147
146
|
- Only select techniques you're confident apply`;
|
|
148
147
|
const CONNECTION_PARAMETERS = `A parameter is connection-changing ONLY IF it appears in <input> or <output> expressions within <node_details>.
|
|
149
148
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/discovery.prompt.ts"],"names":[],"mappings":";;;AA6HA,kDAIC;AAED,oEAIC;
|
|
1
|
+
{"version":3,"file":"discovery.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/discovery.prompt.ts"],"names":[],"mappings":";;;AA6HA,kDAIC;AAED,oEAIC;AA0RD,oDAsBC;AAhbD,mCAAiD;AACjD,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,CAA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c,CAAC;SAC/B,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC;SAC1C,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC;SAChC,OAAO,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;SAC7D,OAAO,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;SAC7D,OAAO,CAAC,+BAA+B,EAAE,6BAA6B,CAAC;SACvE,OAAO,CAAC,wBAAwB,EAAE,sBAAsB,CAAC;SACzD,OAAO,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;SACvD,OAAO,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;SAChE,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;SACrD,OAAO,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;SACjD,OAAO,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;SAC/C,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC;SACzC,OAAO,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;SAC7D,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC;SACzC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC/B,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type DataTableInfo } from '../../utils/data-table-helpers';
|
|
1
2
|
export declare function buildRecursionErrorWithWorkflowGuidance(nodeCount: number): string[];
|
|
2
3
|
export declare function buildRecursionErrorNoWorkflowGuidance(): string[];
|
|
3
4
|
export declare function buildGeneralErrorGuidance(): string;
|
|
5
|
+
export declare function buildDataTableCreationGuidance(dataTables: DataTableInfo[]): string;
|
|
4
6
|
export declare function buildResponderPrompt(): string;
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildRecursionErrorWithWorkflowGuidance = buildRecursionErrorWithWorkflowGuidance;
|
|
4
4
|
exports.buildRecursionErrorNoWorkflowGuidance = buildRecursionErrorNoWorkflowGuidance;
|
|
5
5
|
exports.buildGeneralErrorGuidance = buildGeneralErrorGuidance;
|
|
6
|
+
exports.buildDataTableCreationGuidance = buildDataTableCreationGuidance;
|
|
6
7
|
exports.buildResponderPrompt = buildResponderPrompt;
|
|
8
|
+
const data_table_helpers_1 = require("../../utils/data-table-helpers");
|
|
7
9
|
const builder_1 = require("../builder");
|
|
8
10
|
const RESPONDER_ROLE = `You are a helpful AI assistant for n8n workflow automation.
|
|
9
11
|
|
|
@@ -15,8 +17,10 @@ const WORKFLOW_COMPLETION = `When you receive [Internal Context], synthesize a c
|
|
|
15
17
|
1. Summarize what was built in a friendly way
|
|
16
18
|
2. Explain the workflow structure briefly
|
|
17
19
|
3. Include setup instructions if provided
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
20
|
+
4. If Data Table setup is required, include the exact steps provided in the context (do NOT say data tables will be created automatically)
|
|
21
|
+
5. Ask if user wants adjustments
|
|
22
|
+
|
|
23
|
+
IMPORTANT: Never tell the user to activate, publish, or turn on their workflow. Users will activate workflows themselves when ready.
|
|
20
24
|
|
|
21
25
|
Example response structure:
|
|
22
26
|
"I've created your [workflow type] workflow! Here's what it does:
|
|
@@ -25,6 +29,8 @@ Example response structure:
|
|
|
25
29
|
**Setup Required:**
|
|
26
30
|
[List any configuration steps from the context]
|
|
27
31
|
|
|
32
|
+
[If data tables are used, include Data Table creation steps with link to Data Tables tab]
|
|
33
|
+
|
|
28
34
|
Let me know if you'd like to adjust anything."`;
|
|
29
35
|
const CONVERSATIONAL_RESPONSES = `- Be friendly and concise
|
|
30
36
|
- Explain n8n capabilities when asked
|
|
@@ -33,6 +39,12 @@ const RESPONSE_STYLE = `- Keep responses focused and not overly long
|
|
|
33
39
|
- Use markdown formatting for readability
|
|
34
40
|
- Be conversational and helpful
|
|
35
41
|
- Do not use emojis in your response`;
|
|
42
|
+
const GUARDRAILS = `Your capabilities are focused on workflow building:
|
|
43
|
+
- You work from your existing knowledge of n8n nodes and integrations
|
|
44
|
+
- You help users design and configure workflows based on their requirements
|
|
45
|
+
- You provide guidance on node configuration and workflow structure
|
|
46
|
+
|
|
47
|
+
If a user asks you to search for information or look something up online, let them know you can help build workflows based on your existing knowledge of n8n nodes and integrations, though you don't have access to external websites or real-time information.`;
|
|
36
48
|
function buildRecursionErrorWithWorkflowGuidance(nodeCount) {
|
|
37
49
|
return [
|
|
38
50
|
`**Workflow Status:** ${nodeCount} node${nodeCount === 1 ? '' : 's'} ${nodeCount === 1 ? 'was' : 'were'} created before the complexity limit was reached.`,
|
|
@@ -53,9 +65,44 @@ function buildGeneralErrorGuidance() {
|
|
|
53
65
|
return ('Apologize and explain that a technical error occurred. ' +
|
|
54
66
|
'Ask if they would like to try again or approach the problem differently.');
|
|
55
67
|
}
|
|
68
|
+
function buildDataTableCreationGuidance(dataTables) {
|
|
69
|
+
if (dataTables.length === 0) {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
const tableGuidance = dataTables.map((table) => {
|
|
73
|
+
const isColumnOperation = (0, data_table_helpers_1.isDataTableRowColumnOperation)(table.operation);
|
|
74
|
+
const columnInfo = buildColumnInfo(table, isColumnOperation);
|
|
75
|
+
return `- **${table.nodeName}** (${table.operation}): ${columnInfo}`;
|
|
76
|
+
});
|
|
77
|
+
return (0, builder_1.prompt)({ format: 'markdown' })
|
|
78
|
+
.section('Data Table Setup Required', `Data tables must be created manually before the workflow can run.
|
|
79
|
+
Do NOT tell the user that data tables will be created automatically.
|
|
80
|
+
|
|
81
|
+
Go to the [Data Tables tab](/home/datatables) to create the required tables:
|
|
82
|
+
|
|
83
|
+
${tableGuidance.join('\n')}
|
|
84
|
+
|
|
85
|
+
After creating each table, select it in the corresponding Data Table node.`)
|
|
86
|
+
.build();
|
|
87
|
+
}
|
|
88
|
+
function buildColumnInfo(table, isColumnOperation) {
|
|
89
|
+
if (!isColumnOperation) {
|
|
90
|
+
return `Ensure the table has columns for reading/querying (uses "${table.operation}" operation)`;
|
|
91
|
+
}
|
|
92
|
+
if (table.columns.length > 0) {
|
|
93
|
+
const columnList = table.columns.map((c) => `\`${c.name}\` (${c.type})`).join(', ');
|
|
94
|
+
const source = table.setNodeName ? ` (from "${table.setNodeName}" node)` : '';
|
|
95
|
+
return `Add columns: ${columnList}${source}`;
|
|
96
|
+
}
|
|
97
|
+
if (table.setNodeName) {
|
|
98
|
+
return `Add columns matching the fields in the "${table.setNodeName}" node`;
|
|
99
|
+
}
|
|
100
|
+
return 'Add columns based on the data you want to store';
|
|
101
|
+
}
|
|
56
102
|
function buildResponderPrompt() {
|
|
57
103
|
return (0, builder_1.prompt)()
|
|
58
104
|
.section('role', RESPONDER_ROLE)
|
|
105
|
+
.section('guardrails', GUARDRAILS)
|
|
59
106
|
.section('workflow_completion_responses', WORKFLOW_COMPLETION)
|
|
60
107
|
.section('conversational_responses', CONVERSATIONAL_RESPONSES)
|
|
61
108
|
.section('response_style', RESPONSE_STYLE)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/responder.prompt.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"responder.prompt.js","sourceRoot":"","sources":["../../../src/prompts/agents/responder.prompt.ts"],"names":[],"mappings":";;AA2DA,0FAOC;AAGD,sFAOC;AAGD,8DAKC;AAMD,wEAwBC;AAoBD,oDAQC;AAvID,mEAA+F;AAE/F,wCAAoC;AAEpC,MAAM,cAAc,GAAG;;;;;6CAKsB,CAAC;AAE9C,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;+CAkBmB,CAAC;AAEhD,MAAM,wBAAwB,GAAG;;0CAES,CAAC;AAE3C,MAAM,cAAc,GAAG;;;qCAGc,CAAC;AAEtC,MAAM,UAAU,GAAG;;;;;iQAK8O,CAAC;AAOlQ,SAAgB,uCAAuC,CAAC,SAAiB;IACxE,OAAO;QACN,wBAAwB,SAAS,QAAQ,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC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M,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpF,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,WAAW,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,gBAAgB,UAAU,GAAG,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO,2CAA2C,KAAK,CAAC,WAAW,QAAQ,CAAC;IAC7E,CAAC;IAED,OAAO,iDAAiD,CAAC;AAC1D,CAAC;AAED,SAAgB,oBAAoB;IACnC,OAAO,IAAA,gBAAM,GAAE;SACb,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC;SAC/B,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC;SACjC,OAAO,CAAC,+BAA+B,EAAE,mBAAmB,CAAC;SAC7D,OAAO,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;SAC7D,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC;SACzC,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -37,7 +37,7 @@ of how the categorization should be carried out.
|
|
|
37
37
|
${string}
|
|
38
38
|
</example_categorization>
|
|
39
39
|
|
|
40
|
-
Select
|
|
40
|
+
Select the techniques that you believe are applicable, but only select them if you are
|
|
41
41
|
confident that they are applicable. If the prompt is ambiguous or does not provide an obvious workflow
|
|
42
42
|
do not provide any techniques - if confidence is low avoid providing techniques.
|
|
43
43
|
|
|
@@ -85,7 +85,7 @@ of how the categorization should be carried out.
|
|
|
85
85
|
${formatExamplePrompts()}
|
|
86
86
|
</example_categorization>
|
|
87
87
|
|
|
88
|
-
Select
|
|
88
|
+
Select the techniques that you believe are applicable, but only select them if you are
|
|
89
89
|
confident that they are applicable. If the prompt is ambiguous or does not provide an obvious workflow
|
|
90
90
|
do not provide any techniques - if confidence is low avoid providing techniques.
|
|
91
91
|
|
|
@@ -32,7 +32,71 @@ Expected Output:
|
|
|
32
32
|
"otherOptions": {}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
#### Example 2:
|
|
35
|
+
#### Example 2: Slack Node - Channel by name
|
|
36
|
+
Current Parameters:
|
|
37
|
+
{
|
|
38
|
+
"select": "channel",
|
|
39
|
+
"channelId": {
|
|
40
|
+
"__rl": true,
|
|
41
|
+
"value": "",
|
|
42
|
+
"mode": "list"
|
|
43
|
+
},
|
|
44
|
+
"otherOptions": {}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Requested Changes: Set channel to general (ID: C0A45D6GBLD)
|
|
48
|
+
|
|
49
|
+
Expected Output:
|
|
50
|
+
{
|
|
51
|
+
"select": "channel",
|
|
52
|
+
"channelId": {
|
|
53
|
+
"__rl": true,
|
|
54
|
+
"mode": "list",
|
|
55
|
+
"value": "C0A45D6GBLD",
|
|
56
|
+
"cachedResultName": "general"
|
|
57
|
+
},
|
|
58
|
+
"otherOptions": {}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#### Example 3: Google Sheets Node - Spreadsheet by name
|
|
62
|
+
Current Parameters:
|
|
63
|
+
{
|
|
64
|
+
"operation": "read",
|
|
65
|
+
"documentId": {
|
|
66
|
+
"__rl": true,
|
|
67
|
+
"value": "",
|
|
68
|
+
"mode": "list"
|
|
69
|
+
},
|
|
70
|
+
"sheetName": {
|
|
71
|
+
"__rl": true,
|
|
72
|
+
"value": "",
|
|
73
|
+
"mode": "list"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Requested Changes: Use the "Sales Report 2024" spreadsheet and "Q1 Data" sheet
|
|
78
|
+
|
|
79
|
+
Expected Output:
|
|
80
|
+
{
|
|
81
|
+
"operation": "read",
|
|
82
|
+
"documentId": {
|
|
83
|
+
"__rl": true,
|
|
84
|
+
"mode": "list",
|
|
85
|
+
"value": "2wtaOwM07OTFmEijOVvzDAlxtR76hBYVBRlIwuUgDsVE",
|
|
86
|
+
"cachedResultName": "Sales Report 2024",
|
|
87
|
+
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/2wtaOwM07OTFmEijOVvzDAlxtR76hBYVBRlIwuUgDsVE/edit?usp=drivesdk"
|
|
88
|
+
|
|
89
|
+
},
|
|
90
|
+
"sheetName": {
|
|
91
|
+
"__rl": true,
|
|
92
|
+
"mode": "list",
|
|
93
|
+
"value": "gid=0",
|
|
94
|
+
"cachedResultName": "Q1 Data"
|
|
95
|
+
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/2wtaOwM07OTFmEijOVvzDAlxtR76hBYVBRlIwuUgDsVE/edit#gid=0"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
#### Example 4: Google Drive Node - File by URL
|
|
36
100
|
Current Parameters:
|
|
37
101
|
{
|
|
38
102
|
"operation": "download",
|
|
@@ -55,7 +119,7 @@ Expected Output:
|
|
|
55
119
|
}
|
|
56
120
|
}
|
|
57
121
|
|
|
58
|
-
#### Example
|
|
122
|
+
#### Example 5: Notion Node - Page ID from Expression
|
|
59
123
|
Current Parameters:
|
|
60
124
|
{
|
|
61
125
|
"resource": "databasePage",
|
|
@@ -78,6 +142,30 @@ Expected Output:
|
|
|
78
142
|
"mode": "id",
|
|
79
143
|
"value": "={{ $('Previous Node').item.json.pageId }}"
|
|
80
144
|
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#### Example 6: Mode Switch - From ID to List
|
|
148
|
+
Current Parameters:
|
|
149
|
+
{
|
|
150
|
+
"operation": "append",
|
|
151
|
+
"documentId": {
|
|
152
|
+
"__rl": true,
|
|
153
|
+
"value": "1ABC123XYZ",
|
|
154
|
+
"mode": "id"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Requested Changes: Use the "Customer Database" (ID: 9XYZ789DEF) spreadsheet
|
|
159
|
+
|
|
160
|
+
Expected Output:
|
|
161
|
+
{
|
|
162
|
+
"operation": "append",
|
|
163
|
+
"documentId": {
|
|
164
|
+
"__rl": true,
|
|
165
|
+
"mode": "list",
|
|
166
|
+
"value": "9XYZ789DEF",
|
|
167
|
+
"cachedResultName": "Customer Database"
|
|
168
|
+
}
|
|
81
169
|
}`,
|
|
82
170
|
};
|
|
83
171
|
//# sourceMappingURL=resource-locator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-locator.js","sourceRoot":"","sources":["../../../../../src/prompts/chains/parameter-updater/examples/resource-locator.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAqB;IAC1D,QAAQ,EAAE,CAAC,GAAG,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,wBAAwB,KAAK,IAAI;IACzD,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"resource-locator.js","sourceRoot":"","sources":["../../../../../src/prompts/chains/parameter-updater/examples/resource-locator.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAqB;IAC1D,QAAQ,EAAE,CAAC,GAAG,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,wBAAwB,KAAK,IAAI;IACzD,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkKR;CACD,CAAC"}
|
|
@@ -9,7 +9,7 @@ exports.RESOURCE_LOCATOR_GUIDE = {
|
|
|
9
9
|
|
|
10
10
|
ResourceLocator parameters are special fields used for selecting resources like Slack channels, Google Drive files, Notion pages, etc. They MUST have a specific structure:
|
|
11
11
|
|
|
12
|
-
### Required ResourceLocator Structure:
|
|
12
|
+
### Required ResourceLocator Structure (required fields):
|
|
13
13
|
\`\`\`json
|
|
14
14
|
{
|
|
15
15
|
"__rl": true,
|
|
@@ -19,81 +19,22 @@ ResourceLocator parameters are special fields used for selecting resources like
|
|
|
19
19
|
\`\`\`
|
|
20
20
|
|
|
21
21
|
### Mode Detection Guidelines:
|
|
22
|
+
- Use the node type definition to determine the default mode and available modes for specific parameter
|
|
23
|
+
- Prefer default mode from node type definition when possible
|
|
24
|
+
- Switch the mode based on the input value format when necessary
|
|
25
|
+
- Use mode "list" when the value is an ID + display name (e.g. "Marketing Team (ID: C0122KQ70S7E)"). Value should be set to the ID part, and cachedResultName to the display name part
|
|
22
26
|
- Use mode "url" when the value is a URL (starts with http:// or https://)
|
|
23
|
-
- Use mode "id" when the value looks like an ID (alphanumeric string)
|
|
24
|
-
- Use mode "name" when the value has a prefix like # (Slack channels) or @ (users)
|
|
25
|
-
- Use mode "list" when referencing a dropdown selection (rarely needed in updates)
|
|
27
|
+
- Use mode "id" when the value looks like an ID (alphanumeric string, UUID, or other identifier)
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### Example 1: Slack Channel by ID
|
|
30
|
-
Parameter name: channelId
|
|
31
|
-
Change: "Set channel to C0122KQ70S7E"
|
|
32
|
-
Output:
|
|
33
|
-
\`\`\`json
|
|
34
|
-
{
|
|
35
|
-
"channelId": {
|
|
36
|
-
"__rl": true,
|
|
37
|
-
"mode": "id",
|
|
38
|
-
"value": "C0122KQ70S7E"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
#### Example 2: Google Drive File by URL
|
|
44
|
-
Parameter name: fileId
|
|
45
|
-
Change: "Use file https://drive.google.com/file/d/1Nvdl7bEfDW33cKQuwfItPhIk479--WYY/view"
|
|
46
|
-
Output:
|
|
47
|
-
\`\`\`json
|
|
48
|
-
{
|
|
49
|
-
"fileId": {
|
|
50
|
-
"__rl": true,
|
|
51
|
-
"mode": "url",
|
|
52
|
-
"value": "https://drive.google.com/file/d/1Nvdl7bEfDW33cKQuwfItPhIk479--WYY/view"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
#### Example 3: Notion Page by ID
|
|
58
|
-
Parameter name: pageId
|
|
59
|
-
Change: "Set page ID to 123e4567-e89b-12d3"
|
|
60
|
-
Output:
|
|
29
|
+
List mode structure with optional cached fields:
|
|
61
30
|
\`\`\`json
|
|
62
31
|
{
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
#### Example 4: Slack Channel by Name
|
|
72
|
-
Parameter name: channelId
|
|
73
|
-
Change: "Send to #general channel"
|
|
74
|
-
Output:
|
|
75
|
-
\`\`\`json
|
|
76
|
-
{
|
|
77
|
-
"channelId": {
|
|
78
|
-
"__rl": true,
|
|
79
|
-
"mode": "name",
|
|
80
|
-
"value": "#general"
|
|
81
|
-
}
|
|
32
|
+
"__rl": true,
|
|
33
|
+
"mode": "list",
|
|
34
|
+
"value": "actual-id-from-list",
|
|
35
|
+
"cachedResultName": "Display Name"
|
|
82
36
|
}
|
|
83
37
|
\`\`\`
|
|
84
|
-
|
|
85
|
-
#### Example 5: Using Expression with ResourceLocator
|
|
86
|
-
Parameter name: channelId
|
|
87
|
-
Change: "Use channel ID from previous node"
|
|
88
|
-
Output:
|
|
89
|
-
\`\`\`json
|
|
90
|
-
{
|
|
91
|
-
"channelId": {
|
|
92
|
-
"__rl": true,
|
|
93
|
-
"mode": "id",
|
|
94
|
-
"value": "={{ $('Previous Node').item.json.channelId }}"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
\`\`\``,
|
|
38
|
+
`,
|
|
98
39
|
};
|
|
99
40
|
//# sourceMappingURL=resource-locator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-locator.js","sourceRoot":"","sources":["../../../../../src/prompts/chains/parameter-updater/guides/resource-locator.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAkB;IACpD,QAAQ,EAAE,CAAC,GAAG,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,wBAAwB,KAAK,IAAI;IACzD,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"resource-locator.js","sourceRoot":"","sources":["../../../../../src/prompts/chains/parameter-updater/guides/resource-locator.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAkB;IACpD,QAAQ,EAAE,CAAC,GAAG,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,wBAAwB,KAAK,IAAI;IACzD,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BT;CACA,CAAC"}
|