@n8n/instance-ai 1.6.1 → 1.7.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 (113) hide show
  1. package/dist/agent/computer-use-prompt.js +33 -2
  2. package/dist/agent/computer-use-prompt.js.map +1 -1
  3. package/dist/agent/instance-agent.js +0 -1
  4. package/dist/agent/instance-agent.js.map +1 -1
  5. package/dist/agent/shared-prompts.d.ts +1 -1
  6. package/dist/agent/shared-prompts.js +1 -1
  7. package/dist/agent/shared-prompts.js.map +1 -1
  8. package/dist/agent/sub-agent-debriefing.d.ts +2 -2
  9. package/dist/agent/system-prompt.d.ts +0 -1
  10. package/dist/agent/system-prompt.js +14 -15
  11. package/dist/agent/system-prompt.js.map +1 -1
  12. package/dist/build.tsbuildinfo +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +4 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/planned-tasks/planned-task-service.d.ts +3 -0
  17. package/dist/planned-tasks/planned-task-service.js +14 -7
  18. package/dist/planned-tasks/planned-task-service.js.map +1 -1
  19. package/dist/runtime/builder-sandbox-session-registry.d.ts +2 -0
  20. package/dist/runtime/builder-sandbox-session-registry.js +8 -1
  21. package/dist/runtime/builder-sandbox-session-registry.js.map +1 -1
  22. package/dist/runtime/resumable-stream-executor.d.ts +1 -0
  23. package/dist/runtime/resumable-stream-executor.js +7 -0
  24. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  25. package/dist/runtime/run-state-registry.d.ts +11 -4
  26. package/dist/runtime/run-state-registry.js +14 -10
  27. package/dist/runtime/run-state-registry.js.map +1 -1
  28. package/dist/stream/consume-with-hitl.d.ts +2 -0
  29. package/dist/stream/consume-with-hitl.js +1 -0
  30. package/dist/stream/consume-with-hitl.js.map +1 -1
  31. package/dist/tools/attachments/parse-file.tool.d.ts +2 -2
  32. package/dist/tools/credentials.tool.d.ts +2 -2
  33. package/dist/tools/credentials.tool.js +6 -0
  34. package/dist/tools/credentials.tool.js.map +1 -1
  35. package/dist/tools/evals/analyze-agent-input-columns.service.d.ts +6 -0
  36. package/dist/tools/evals/analyze-agent-input-columns.service.js +17 -0
  37. package/dist/tools/evals/analyze-agent-input-columns.service.js.map +1 -0
  38. package/dist/tools/evals/column-ref-utils.d.ts +18 -0
  39. package/dist/tools/evals/column-ref-utils.js +116 -0
  40. package/dist/tools/evals/column-ref-utils.js.map +1 -0
  41. package/dist/tools/evals/describe-metric-for-workflow.service.d.ts +6 -0
  42. package/dist/tools/evals/describe-metric-for-workflow.service.js +108 -0
  43. package/dist/tools/evals/describe-metric-for-workflow.service.js.map +1 -0
  44. package/dist/tools/evals/detect-agent-named-refs.service.d.ts +9 -0
  45. package/dist/tools/evals/detect-agent-named-refs.service.js +67 -0
  46. package/dist/tools/evals/detect-agent-named-refs.service.js.map +1 -0
  47. package/dist/tools/evals/detect-ai-nodes.d.ts +7 -0
  48. package/dist/tools/evals/detect-ai-nodes.js +75 -0
  49. package/dist/tools/evals/detect-ai-nodes.js.map +1 -0
  50. package/dist/tools/evals/detect-tool-refs.service.d.ts +7 -0
  51. package/dist/tools/evals/detect-tool-refs.service.js +65 -0
  52. package/dist/tools/evals/detect-tool-refs.service.js.map +1 -0
  53. package/dist/tools/evals/eval-data-requirements.service.d.ts +19 -0
  54. package/dist/tools/evals/eval-data-requirements.service.js +167 -0
  55. package/dist/tools/evals/eval-data-requirements.service.js.map +1 -0
  56. package/dist/tools/evals/metric-catalog.d.ts +57 -0
  57. package/dist/tools/evals/metric-catalog.js +81 -0
  58. package/dist/tools/evals/metric-catalog.js.map +1 -0
  59. package/dist/tools/filesystem/create-tools-from-mcp-server.js +7 -1
  60. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  61. package/dist/tools/nodes/node-search-engine.types.d.ts +7 -0
  62. package/dist/tools/orchestration/build-workflow-agent.prompt.js +34 -223
  63. package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
  64. package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +12 -1
  65. package/dist/tools/orchestration/build-workflow-agent.tool.js +130 -27
  66. package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
  67. package/dist/tools/orchestration/delegate.schemas.d.ts +2 -2
  68. package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
  69. package/dist/tools/orchestration/plan-agent-prompt.js +7 -1
  70. package/dist/tools/orchestration/plan-agent-prompt.js.map +1 -1
  71. package/dist/tools/orchestration/plan.tool.js +21 -4
  72. package/dist/tools/orchestration/plan.tool.js.map +1 -1
  73. package/dist/tools/workflows/submit-workflow-identity.d.ts +6 -1
  74. package/dist/tools/workflows/submit-workflow-identity.js +17 -4
  75. package/dist/tools/workflows/submit-workflow-identity.js.map +1 -1
  76. package/dist/tools/workflows/submit-workflow.tool.d.ts +2 -2
  77. package/dist/tools/workflows/submit-workflow.tool.js +5 -1
  78. package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
  79. package/dist/tools/workflows.tool.js +19 -2
  80. package/dist/tools/workflows.tool.js.map +1 -1
  81. package/dist/tracing/langsmith-tracing.d.ts +2 -0
  82. package/dist/tracing/langsmith-tracing.js +29 -0
  83. package/dist/tracing/langsmith-tracing.js.map +1 -1
  84. package/dist/types.d.ts +0 -1
  85. package/dist/utils/eval-agents.d.ts +3 -0
  86. package/dist/utils/eval-agents.js +7 -0
  87. package/dist/utils/eval-agents.js.map +1 -1
  88. package/dist/utils/scrub-secrets.d.ts +1 -0
  89. package/dist/utils/scrub-secrets.js +19 -0
  90. package/dist/utils/scrub-secrets.js.map +1 -0
  91. package/dist/workflow-loop/guidance.js +2 -1
  92. package/dist/workflow-loop/guidance.js.map +1 -1
  93. package/dist/workflow-loop/index.d.ts +1 -0
  94. package/dist/workflow-loop/index.js +3 -1
  95. package/dist/workflow-loop/index.js.map +1 -1
  96. package/dist/workflow-loop/terminal-remediation-guard.d.ts +6 -0
  97. package/dist/workflow-loop/terminal-remediation-guard.js +18 -0
  98. package/dist/workflow-loop/terminal-remediation-guard.js.map +1 -0
  99. package/dist/workspace/builder-sandbox-factory.d.ts +2 -0
  100. package/dist/workspace/builder-sandbox-factory.js +12 -3
  101. package/dist/workspace/builder-sandbox-factory.js.map +1 -1
  102. package/dist/workspace/guarded-filesystem.d.ts +10 -0
  103. package/dist/workspace/guarded-filesystem.js +136 -0
  104. package/dist/workspace/guarded-filesystem.js.map +1 -0
  105. package/dist/workspace/sandbox-fs.js +34 -11
  106. package/dist/workspace/sandbox-fs.js.map +1 -1
  107. package/dist/workspace/sandbox-setup.d.ts +2 -0
  108. package/dist/workspace/sandbox-setup.js +35 -20
  109. package/dist/workspace/sandbox-setup.js.map +1 -1
  110. package/dist/workspace/template-telemetry.d.ts +23 -0
  111. package/dist/workspace/template-telemetry.js +180 -0
  112. package/dist/workspace/template-telemetry.js.map +1 -0
  113. package/package.json +20 -16
@@ -1 +1 @@
1
- {"version":3,"file":"create-tools-from-mcp-server.js","sourceRoot":"","sources":["../../../src/tools/filesystem/create-tools-from-mcp-server.ts"],"names":[],"mappings":";;AAwJA,sEAuJC;AA9SD,8CAAgD;AAChD,8CAMwB;AACxB,mCAAgC;AAChC,6BAAwB;AACxB,qEAAiE;AAGjE,mFAK8C;AAC9C,2EAI0C;AAQ1C,MAAM,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,gDAAoC;IAC9C,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IACzC,gBAAgB,EAAE,oDAAwC;CAC1D,CAAC,CAAC;AAEH,MAAM,6BAA6B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE3F,MAAM,4CAA4C,GACjD,oDAAwC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,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AK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;qBAC/E,CAAC;gBACH,CAAC;gBAGD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACtC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;wBAC3B,OAAO;4BACN,IAAI,EAAE,OAAgB;4BACtB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,YAAY;yBACxC,CAAC;oBACH,CAAC;oBACD,OAAO,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;gBACzD,CAAC,CAAC,CAAC;gBACH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YACnC,CAAC;SACD,CAAC,CAAC;QAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,6CAAsB,EAAC,KAAK,EAAE;QACpD,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC;KAC1C,CAAC,CAAC;IACH,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,IAAA,0CAAe,EAAC,SAAS,EAAE,cAAc,EAAE;QAC1C,MAAM,EAAE,wBAAwB;QAChC,gBAAgB,EAAE,IAAA,iDAAsB,EAAC,EAAE,CAAC;QAC5C,IAAI,EAAE,QAAQ;KACd,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"create-tools-from-mcp-server.js","sourceRoot":"","sources":["../../../src/tools/filesystem/create-tools-from-mcp-server.ts"],"names":[],"mappings":";;AAyJA,sEAgKC;AAxTD,8CAAgD;AAChD,8CAM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AC;gBACH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YACnC,CAAC;SACD,CAAC,CAAC;QAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,6CAAsB,EAAC,KAAK,EAAE;QACpD,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC;KAC1C,CAAC,CAAC;IACH,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,IAAA,0CAAe,EAAC,SAAS,EAAE,cAAc,EAAE;QAC1C,MAAM,EAAE,wBAAwB;QAChC,gBAAgB,EAAE,IAAA,iDAAsB,EAAC,EAAE,CAAC;QAC5C,IAAI,EAAE,QAAQ;KACd,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -18,6 +18,13 @@ export interface SearchableNodeType {
18
18
  builderHint?: {
19
19
  message?: string;
20
20
  inputs?: BuilderHintInputs;
21
+ extraTypeDefContent?: Array<{
22
+ content: string;
23
+ displayOptions?: {
24
+ show?: Record<string, unknown[]>;
25
+ hide?: Record<string, unknown[]>;
26
+ };
27
+ }>;
21
28
  };
22
29
  }
23
30
  export interface SubnodeRequirement {
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BUILDER_AGENT_PROMPT = void 0;
4
4
  exports.createSandboxBuilderAgentPrompt = createSandboxBuilderAgentPrompt;
5
- const node_selection_1 = require("@n8n/workflow-sdk/prompts/node-selection");
6
5
  const sdk_reference_1 = require("@n8n/workflow-sdk/prompts/sdk-reference");
7
6
  const shared_prompts_1 = require("../../agent/shared-prompts");
8
7
  const BUILDER_OUTPUT_DISCIPLINE = `## Output Discipline
@@ -23,7 +22,7 @@ BAD (do not write anything like this):
23
22
  GOOD (one-line, only on completion or block):
24
23
  - "Family AI assistant workflow ready — uses Telegram, OpenAI, and your shopping list data table."
25
24
  - "Workflow updated: removed the stale pinData from the weather check node."
26
- - "Blocked: the Linear API credential is missing and the setup wizard is needed before I can continue."`;
25
+ - "Blocked: the Linear API credential is missing; setup is required before I can continue."`;
27
26
  const SDK_CODE_RULES = `## SDK Code Rules
28
27
 
29
28
  - Do NOT specify node positions — they are auto-calculated by the layout engine.
@@ -38,215 +37,9 @@ const NODE_CONFIGURATION_SAFETY_RULES = `## Node Configuration Safety Rules
38
37
  - Fetch \`nodes(action="type-definition")\` before configuring nodes. Generated definitions and \`@builderHint\` annotations are the source of truth.
39
38
  - Use live \`nodes(action="explore-resources")\` for resource locator, list, and model fields when credentials are available.
40
39
  - If a configuration is unclear after reading the definition, ask for clarification or use placeholders — do not guess.`;
41
- function buildBuilderSpecificPatterns() {
42
- const openAiCredExample = "newCredential('OpenAI')";
43
- return `## Critical Patterns (Common Mistakes)
40
+ const BUILDER_SPECIFIC_PATTERNS = `## Critical Patterns (Common Mistakes)
44
41
 
45
- **Pay attention to @builderHint annotations in search results and type definitions** — these provide critical guidance on how to correctly configure node parameters. Write them out as notes when reviewing — they prevent common configuration mistakes.
46
-
47
- ### Self-check: conditional nodes and routing
48
-
49
- After writing any workflow with IF, Switch, or Filter nodes, verify:
50
- 1. **Every \`conditions\` object has \`options\`, \`conditions\` array, and \`combinator\`** — missing any of these crashes the node at runtime.
51
- 2. **Switch uses \`rules.values\`** (not \`rules.rules\`) — the wrong key crashes during workflow loading.
52
- 3. **Each branch reaches the correct destination** — trace the data flow from the condition through \`.onTrue()\`/\`.onFalse()\`/\`.onCase()\` to the target node. Verify the routing matches the user's requirements.
53
- 4. **Condition expressions reference the right fields** — check that \`leftValue\` expressions use fields that actually exist in the upstream node's output.
54
- 5. **Merge nodes use the correct mode** — \`append\` to concatenate items from branches, \`combineBySql\` or \`combineByPosition\` only when matching items across inputs. Wrong mode silently drops or duplicates data.
55
-
56
- ### AI Agent with Subnodes — use factory functions in subnodes config
57
- \`\`\`javascript
58
- const chatTrigger = trigger({
59
- type: '@n8n/n8n-nodes-langchain.chatTrigger',
60
- version: 1.3,
61
- config: {
62
- name: 'Chat Trigger',
63
- parameters: { public: false },
64
- output: [{ sessionId: 'chat-session-id', chatInput: 'Hello' }]
65
- }
66
- });
67
-
68
- const model = languageModel({
69
- type: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
70
- version: 1.3,
71
- config: {
72
- name: 'OpenAI Chat Model',
73
- parameters: { model: { __rl: true, mode: 'list', value: 'gpt-5.4' } },
74
- credentials: { openAiApi: ${openAiCredExample} }
75
- }
76
- });
77
-
78
- const parser = outputParser({
79
- type: '@n8n/n8n-nodes-langchain.outputParserStructured',
80
- version: 1.3,
81
- config: {
82
- name: 'Output Parser',
83
- parameters: {
84
- schemaType: 'fromJson',
85
- jsonSchemaExample: '{ "score": 75, "tier": "hot" }'
86
- }
87
- }
88
- });
89
-
90
- const memoryNode = memory({
91
- type: '@n8n/n8n-nodes-langchain.memoryBufferWindow',
92
- version: 1.3,
93
- config: {
94
- name: 'Conversation Memory',
95
- parameters: {
96
- sessionIdType: 'customKey',
97
- sessionKey: nodeJson(chatTrigger, 'sessionId'),
98
- contextWindowLength: 10
99
- }
100
- }
101
- });
102
-
103
- const agent = node({
104
- type: '@n8n/n8n-nodes-langchain.agent',
105
- version: 3.1,
106
- config: {
107
- name: 'AI Agent',
108
- parameters: {
109
- promptType: 'define',
110
- text: '={{ $json.prompt }}',
111
- hasOutputParser: true,
112
- options: { systemMessage: 'You are an expert...' }
113
- },
114
- subnodes: { model: model, memory: memoryNode, outputParser: parser }
115
- }
116
- });
117
- \`\`\`
118
- WRONG: \`.to(agent, { connectionType: 'ai_languageModel' })\` — subnodes MUST be in the config object.
119
- For values inside AI subnodes, use explicit references such as \`nodeJson(triggerNode, 'sessionId')\` instead of \`$json.sessionId\`. For Chat Trigger memory specifically, \`sessionIdType: 'fromInput'\` is also valid.
120
-
121
- ### Code Node
122
- \`\`\`javascript
123
- const codeNode = node({
124
- type: 'n8n-nodes-base.code',
125
- version: 2,
126
- config: {
127
- name: 'Process Data',
128
- parameters: {
129
- mode: 'runOnceForAllItems',
130
- jsCode: \\\`
131
- const items = $input.all();
132
- return items.map(item => ({
133
- json: { ...item.json, processed: true }
134
- }));
135
- \\\`.trim()
136
- }
137
- }
138
- });
139
- \`\`\`
140
-
141
- ### Data Table (built-in n8n storage)
142
- \`\`\`javascript
143
- const storeData = node({
144
- type: 'n8n-nodes-base.dataTable',
145
- version: 1.1,
146
- config: {
147
- name: 'Store Data',
148
- parameters: {
149
- resource: 'row',
150
- operation: 'insert',
151
- dataTableId: { __rl: true, mode: 'name', value: 'my-table' },
152
- columns: {
153
- mappingMode: 'defineBelow',
154
- value: {
155
- name: '={{ $json.name }}',
156
- email: '={{ $json.email }}'
157
- },
158
- schema: [
159
- { id: 'name', displayName: 'name', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: true },
160
- { id: 'email', displayName: 'email', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: true }
161
- ]
162
- }
163
- }
164
- }
165
- });
166
- \`\`\`
167
-
168
- **Data Table rules**
169
- - Row IDs are auto-generated by Data Tables. Do NOT create a custom \`id\` column and do NOT seed an \`id\` value on insert.
170
- - To fetch many rows, use \`operation: 'get'\` with \`returnAll: true\`. Do NOT invent \`getAll\`.
171
- - When filtering rows for update/delete, it is valid to match on the built-in row \`id\`, but that is not part of the user-defined table schema.
172
-
173
- ### Google Sheets — Column Mapping
174
- The \`columns\` parameter requires a schema object, never a string:
175
- \`\`\`javascript
176
- // autoMapInputData — maps $json fields to sheet columns automatically
177
- columns: {
178
- mappingMode: 'autoMapInputData',
179
- value: {},
180
- schema: [
181
- { id: 'Name', displayName: 'Name', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: true },
182
- { id: 'Email', displayName: 'Email', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: false },
183
- ]
184
- }
185
-
186
- // defineBelow — explicit expression mapping
187
- columns: {
188
- mappingMode: 'defineBelow',
189
- value: { name: '={{ $json.name }}', email: '={{ $json.email }}' },
190
- schema: [
191
- { id: 'name', displayName: 'name', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: true },
192
- { id: 'email', displayName: 'email', required: false, defaultMatch: false, display: true, type: 'string', canBeUsedToMatch: true }
193
- ]
194
- }
195
- \`\`\`
196
- WRONG: \`columns: 'autoMapInputData'\` — this is a string, not a schema object. Will fail validation.
197
-
198
- ### Parallel Branches + Merge
199
- When multiple paths must converge, include the full downstream chain in EACH branch.
200
- There is NO fan-in primitive — shared nodes must be duplicated or use sub-workflows.
201
-
202
- ### Batch Processing — splitInBatches with loop
203
- \`\`\`javascript
204
- const batch = node({
205
- type: 'n8n-nodes-base.splitInBatches',
206
- version: 3,
207
- config: { name: 'Batch', parameters: { batchSize: 50 } }
208
- });
209
- // Connect: trigger -> batch -> processNode -> batch (loop back)
210
- // The batch node automatically outputs to "done" when all items are processed.
211
- \`\`\`
212
-
213
- ### Multiple Triggers
214
- Independent entry points can feed into shared downstream nodes. Each trigger starts its own branch:
215
- \`\`\`javascript
216
- export default workflow('id', 'name')
217
- .add(webhookTrigger).to(processNode).to(storeNode)
218
- .add(scheduleTrigger).to(processNode);
219
- \`\`\`
220
-
221
- ### Google Sheets — documentId and sheetName (RLC fields)
222
-
223
- These are Resource Locator fields that require the \`__rl\` object format:
224
- \`\`\`typescript
225
- // CORRECT — RLC object with discovered ID
226
- documentId: { __rl: true, mode: 'id', value: '1abc123...' },
227
- sheetName: { __rl: true, mode: 'name', value: 'Sheet1' },
228
-
229
- // CORRECT — RLC with name-based lookup
230
- documentId: { __rl: true, mode: 'name', value: 'Sales Pipeline' },
231
-
232
- // WRONG — plain string
233
- documentId: 'YOUR_SPREADSHEET_ID', // Not an RLC object
234
-
235
- // WRONG — expr() wrapper
236
- documentId: expr('{{ "spreadsheetId" }}'), // RLC fields don't use expressions
237
- \`\`\`
238
- Always use the IDs from \`nodes(action="explore-resources")\` results inside the RLC \`value\` field.
239
-
240
- ### AI Tool Connection Patterns
241
- ${node_selection_1.AI_TOOL_PATTERNS}
242
-
243
- ### Connection-Changing Parameters
244
- ${node_selection_1.CONNECTION_CHANGING_PARAMETERS}
245
-
246
- ### Baseline Flow Control Nodes
247
- ${node_selection_1.BASELINE_FLOW_CONTROL}`;
248
- }
249
- const BUILDER_SPECIFIC_PATTERNS = buildBuilderSpecificPatterns();
42
+ **Pay attention to @builderHint annotations in search results and type definitions** — they contain node-specific configuration rules and code examples. Read them carefully when configuring any node — they prevent common mistakes.`;
250
43
  const SANDBOX_WORKFLOW_RULES = `Follow these rules strictly when generating workflows:
251
44
 
252
45
  1. **Use \`newCredential()\` for authentication**
@@ -302,11 +95,12 @@ ${shared_prompts_1.PLACEHOLDERS_RULE}
302
95
  ## Mandatory Process
303
96
  1. **Research**: If the workflow fits a known category (notification, chatbot, scheduling, data_transformation, etc.), call \`nodes(action="suggested")\` first for curated recommendations. Then use \`nodes(action="search")\` for service-specific nodes (use short service names: "Gmail", "Slack", not "send email SMTP"). The results include \`discriminators\` (available resources and operations) for nodes that need them. Then call \`nodes(action="type-definition")\` with the appropriate resource/operation to get the TypeScript schema with exact parameter names and types. **Pay attention to @builderHint annotations** in search results and type definitions — they prevent common configuration mistakes.
304
97
  2. **Build**: Write TypeScript SDK code and call \`build-workflow\`. Follow the SDK patterns below exactly.
305
- 3. **Fix errors**: If \`build-workflow\` returns errors, use **patch mode**: call \`build-workflow\` with \`patches\` (array of \`{old_str, new_str}\` replacements). Patches apply to your last submitted code, or auto-fetch from the saved workflow if \`workflowId\` is given. Much faster than resending full code.
306
- 4. **Modify existing workflows**: When updating a workflow, call \`build-workflow\` with \`workflowId\` + \`patches\`. The tool fetches the current code and applies your patches. Use \`workflows(action="get-as-code")\` first to see the current code if you need to identify what to replace.
307
- 5. **Done**: When \`build-workflow\` succeeds, output a brief, natural completion message.
98
+ 3. **Trace wiring before declaring done**: For workflows containing IF, Switch, or Merge nodes, trace each branch from its source to its target — confirm IF outputs are wired with \`.onTrue()\`/\`.onFalse()\`, every Switch rule output is wired by zero-based \`.onCase(index, target)\`, and the Merge mode matches the data shape. Read each node's \`@builderHint\` for selection criteria.
99
+ 4. **Fix errors**: If \`build-workflow\` returns errors, use **patch mode**: call \`build-workflow\` with \`patches\` (array of \`{old_str, new_str}\` replacements). Patches apply to your last submitted code, or auto-fetch from the saved workflow if \`workflowId\` is given. Much faster than resending full code.
100
+ 5. **Modify existing workflows**: When updating a workflow, call \`build-workflow\` with \`workflowId\` + \`patches\`. The tool fetches the current code and applies your patches. Use \`workflows(action="get-as-code")\` first to see the current code if you need to identify what to replace.
101
+ 6. **Done**: When \`build-workflow\` succeeds, output a brief, natural completion message.
308
102
 
309
- Do NOT produce visible output until step 5. All reasoning happens internally.
103
+ Do NOT produce visible output until step 6. All reasoning happens internally.
310
104
 
311
105
  ## Credential Rules (tool mode)
312
106
  - Use \`newCredential('Credential Name', 'credential-id')\` only when the user selected a specific existing credential or the workflow already has one.
@@ -407,8 +201,8 @@ const fetchWeather = node({
407
201
  name: 'Fetch Weather',
408
202
  parameters: {
409
203
  locationSelection: 'cityName',
410
- cityName: '={{ $json.city }}',
411
- format: '={{ $json.units }}'
204
+ cityName: expr('{{ $json.city }}'),
205
+ format: expr('{{ $json.units }}')
412
206
  },
413
207
  credentials: { openWeatherMapApi: { id: 'credId', name: 'OpenWeatherMap account' } }
414
208
  }
@@ -563,6 +357,19 @@ n8n normalizes column names to snake_case (e.g., \`dayName\` → \`day_name\`).
563
357
  execute_command: grep -i "gmail" ${workspaceRoot}/node-types/index.txt
564
358
  \`\`\`
565
359
 
360
+ d. **Look for similar workflow examples** in \`${workspaceRoot}/examples/\` — a curated set of real n8n workflows in SDK form. Grep the index, then read the closest match for structural inspiration:
361
+ \`\`\`
362
+ execute_command: grep -i "<keyword>" ${workspaceRoot}/examples/index.txt
363
+ execute_command: cat ${workspaceRoot}/examples/<file>.ts
364
+ \`\`\`
365
+ Each line in \`examples/index.txt\` is \`filename | name | nodes | tags | source-id\`. Use the example as a reference for **structure** (which credential type each node uses, how nodes are wired, where sub-nodes attach to an agent, where sticky notes go) — not as a verbatim copy. The user's request will rarely match an example one-to-one.
366
+
367
+ The \`examples/\` directory is **read-only reference**. Never edit files there; \`src/\` and \`chunks/\` are your scratch.
368
+
369
+ Examples use \`newCredential('Name', 'id')\` for clarity. When you copy a pattern into \`src/workflow.ts\`, replace those calls with raw \`{ id, name }\` from \`credentials(action="list")\` per the rules above.
370
+
371
+ If grep returns nothing, build from scratch. **Do not fabricate examples that do not exist.**
372
+
566
373
  3. **Get node schemas**: Call \`nodes(action="type-definition")\` with ALL the node IDs you need in a single call (up to 5). For nodes with discriminators (from search results), include the \`resource\` and \`operation\` fields. **Read the definitions carefully** — they contain exact parameter names, types, required fields, valid enum values, credential types, displayOptions conditions, and \`@builderHint\` annotations with critical configuration guidance.
567
374
  **Important**: Only call \`nodes(action="type-definition")\` for nodes you will actually use in the workflow. Do not speculatively fetch definitions "just in case". If a definition returns empty or an error, do not retry — proceed with the information from \`nodes(action="search")\` results instead.
568
375
 
@@ -571,23 +378,26 @@ n8n normalizes column names to snake_case (e.g., \`dayName\` → \`day_name\`).
571
378
  - **LLM models in particular** (OpenAI, Anthropic, Groq, etc.): always call \`explore-resources\` with the node's \`@searchListMethod\` when a credential for that provider is attached. The live list reflects what the credential can actually access — free/cheap tiers are often limited (e.g. an OpenAI free-tier key may only return \`gpt-5-mini\`). Picking a model ID that the credential can't access produces a broken workflow. The list is sorted newest-first; use the \`@builderHint\` as selection guidance (e.g. "prefer the GPT-5.4 family") over the live results, not as a hard-coded pick.
572
379
  - Example: Google Calendar's \`calendar\` parameter uses \`searchListMethod: getCalendars\`. Call \`nodes(action="explore-resources")\` with \`methodName: "getCalendars"\` to get the actual calendar ID (e.g., "user@example.com"), not "primary".
573
380
  - **Never use fake IDs for discoverable resources.** Use \`placeholder()\` when the user needs to choose or create the resource after the build. For user-provided values, follow the placeholder rules in "SDK Code Rules".
574
- - **If \`explore-resources\` returns more than one match and the user did not name a specific one, use \`placeholder('Select <resource>')\` for that parameter** (e.g. \`placeholder('Select a calendar')\`, \`placeholder('Select a Slack channel')\`). Picking one silently is a guess; the setup wizard surfaces placeholders so the user can choose after the build. Only pick a single match without prompting.
381
+ - **If \`explore-resources\` returns more than one match and the user did not name a specific one, use \`placeholder('Select <resource>')\` for that parameter** (e.g. \`placeholder('Select a calendar')\`, \`placeholder('Select a Slack channel')\`). Picking one silently is a guess; after the build, the inline setup card in the AI Assistant panel surfaces placeholders so the user can choose. Only pick a single match without prompting.
575
382
  - If the resource can't be created via n8n (e.g., Slack channels), explain clearly in your summary what the user needs to set up.
576
383
 
577
384
  5. **Write workflow code** to \`${workspaceRoot}/src/workflow.ts\`.
578
385
 
579
- 6. **Validate with tsc**: Run the TypeScript compiler for real type checking:
386
+ 6. **Trace wiring before declaring done**: For workflows containing IF, Switch, or Merge nodes, trace each branch from its source to its target — confirm IF outputs are wired with \`.onTrue()\`/\`.onFalse()\`, every Switch rule output is wired by zero-based \`.onCase(index, target)\`, and the Merge mode matches the data shape. Read each node's \`@builderHint\` for selection criteria.
387
+
388
+ 7. **Validate with tsc**: Run the TypeScript compiler for real type checking:
580
389
  \`\`\`
581
390
  execute_command: cd ~/workspace && npx tsc --noEmit 2>&1
582
391
  \`\`\`
583
392
  Fix any errors using \`edit_file\` (with absolute path) to update the code, then re-run tsc. Iterate until clean.
584
393
  **Important**: If tsc reports errors you cannot resolve after 2 attempts, skip tsc and proceed to submit-workflow. The submit tool has its own validation.
585
394
 
586
- 7. **Submit**: When tsc passes cleanly, call \`submit-workflow\` to validate the workflow graph and save it to n8n.
395
+ 8. **Submit**: When tsc passes cleanly, call \`submit-workflow\` to validate the workflow graph and save it to n8n.
587
396
 
588
- 8. **Fix submission errors**: If \`submit-workflow\` returns errors, edit the file and submit again immediately. Skip tsc for validation-only errors. **Never end your turn on a file edit — always re-submit first.** The system compares file hashes: if the file changed since the last submit, all your work is discarded. End only on a successful re-submit or after you explicitly report the blocking error.
397
+ 9. **Fix submission errors**: If \`submit-workflow\` returns errors, edit the file and submit again immediately. Skip tsc for validation-only errors. **Never end your turn on a file edit — always re-submit first.** The system compares file hashes: if the file changed since the last submit, all your work is discarded. End only on a successful re-submit or after you explicitly report the blocking error.
398
+ If remediation includes \`shouldEdit: false\`, stop immediately and report its guidance. Do not edit files, run commands, or call \`submit-workflow\` again.
589
399
 
590
- 9. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues.
400
+ 10. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues.
591
401
 
592
402
  ### For complex workflows (5+ nodes, multiple integrations):
593
403
 
@@ -603,8 +413,9 @@ Follow the **Compositional Workflow Pattern** above. The process becomes:
603
413
  c. Submit the chunk: \`submit-workflow\` with \`filePath\` pointing to the chunk file. Test via \`executions(action="run")\`.
604
414
  d. Fix if needed (max 2 submission fix attempts per chunk).
605
415
  6. **Write the main workflow** in \`${workspaceRoot}/src/workflow.ts\` that composes chunks via \`executeWorkflow\` nodes, referencing each chunk's workflow ID.
606
- 7. **Submit** the main workflow.
607
- 8. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues.
416
+ 7. **Trace wiring before declaring done**: For workflows containing IF, Switch, or Merge nodes, trace each branch from its source to its target — confirm IF outputs are wired with \`.onTrue()\`/\`.onFalse()\`, every Switch rule output is wired by zero-based \`.onCase(index, target)\`, and the Merge mode matches the data shape. Read each node's \`@builderHint\` for selection criteria.
417
+ 8. **Submit** the main workflow.
418
+ 9. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues.
608
419
 
609
420
  Do NOT produce visible output until the final step. All reasoning happens internally.
610
421
 
@@ -1 +1 @@
1
- {"version":3,"file":"build-workflow-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/orchestration/build-workflow-agent.prompt.ts"],"names":[],"mappings":";;;AAwWA,0EAoTC;AAppBD,6EAIkD;AAClD,2EAKiD;AAEjD,+DAAkF;AAIlF,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;0GAkBwE,CA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AAG,oCAAoB;QACpD,+BAA+B;QAC/B,yBAAyB;KACzB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,2BAA2B,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;AACvE,MAAM,8BAA8B,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;AAIhE,QAAA,oBAAoB,GAAG;;EAElC,yBAAyB;;;;;;EAMzB,kCAAiB;;EAEjB,kCAAiB;;;;;;;;;;;;;;;;;;;EAmBjB,2BAA2B;CAC5B,CAAC;AAIF,SAAgB,+BAA+B,CAAC,aAAqB;IACpE,OAAO;;EAEN,yBAAyB;;;;0BAID,aAAa,6DAA6D,aAAa;;;EAG/G,aAAa;;;;;;;;;;;;;;;;;;KAkBV,aAAa;;;;;;;;;;;;;;;KAeb,aAAa;;;;;;;;;;;;;;;;;;;;;KAqBb,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDb,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwChB,kCAAiB;;;;;;;;;;;;;;;;EAgBjB,kCAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAqEmB,aAAa;;;oDAGC,aAAa;;0CAEvB,aAAa;0BAC7B,aAAa;;;;;;;;;;;;;;;;;;;;;kCAqBL,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA2BlB,aAAa;;;;sCAIJ,aAAa;;;;;;;;yFAQsC,aAAa;;;;;;;;;;;;;;EAcpG,8BAA8B;CAC/B,CAAC;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { OrchestrationContext } from '../../types';
3
- import { type WorkflowBuildOutcome, type WorkflowSetupRequirement, type WorkflowVerificationReadiness, type WorkflowLoopState } from '../../workflow-loop';
3
+ import { type RemediationMetadata, type WorkflowBuildOutcome, type WorkflowSetupRequirement, type WorkflowVerificationReadiness, type WorkflowLoopState } from '../../workflow-loop';
4
4
  import { type SubmitWorkflowAttempt, type SubmitWorkflowOutput } from '../workflows/submit-workflow.tool';
5
5
  export declare function buildWarmBuilderFollowUp(input: {
6
6
  task: string;
@@ -34,6 +34,17 @@ export declare function resultFromPostStreamError(input: {
34
34
  text: string;
35
35
  outcome: WorkflowBuildOutcome;
36
36
  } | undefined;
37
+ export declare function resultFromTerminalRemediation(input: {
38
+ remediation: RemediationMetadata;
39
+ submitAttempts: SubmitWorkflowAttempt[];
40
+ mainWorkflowPath: string;
41
+ workItemId: string;
42
+ runId: string;
43
+ taskId: string;
44
+ }): {
45
+ text: string;
46
+ outcome: WorkflowBuildOutcome;
47
+ };
37
48
  export declare function resultFromLaterFailedMainSubmit(input: {
38
49
  failedAttempt: SubmitWorkflowAttempt;
39
50
  submitAttempts: SubmitWorkflowAttempt[];