@path58/p58-n8n 0.2.6 → 0.2.8
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/CHANGELOG.md +15 -0
- package/dist/mcp/server.bundle.cjs +69 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.8] - 2026-03-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Webhook path extraction for `build_workflow` workflows** — `extractWebhookPath` now correctly reads the top-level `node.webhookId` set by `addWebhookIdIfNeeded()` in `build_workflow`. Previously it only checked `parameters.webhookId` and `parameters.path`, causing the path to always be null for `build_workflow`-created webhook workflows, leading to wrong webhook URLs.
|
|
13
|
+
- **Webhook 404 after activation (timing)** — `test_workflow` and `execute_workflow` now wait 3 seconds (up from 1.5s) after activating a clone workflow before POSTing. If a 404 is still received, they retry up to 3 times with backoff (1s, 2s). This handles n8n 2.x's async webhook registration.
|
|
14
|
+
|
|
15
|
+
## [0.2.7] - 2026-03-11
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **LangChain connection type pattern fallback** — `ConnectionTypeResolver` now includes a static prefix-based resolver that correctly identifies LangChain AI sub-node types (`ai_languageModel`, `ai_tool`, `ai_memory`, etc.) even when the database is unreachable (e.g., Supabase circuit breaker open). Previously, any DB connectivity failure caused all connections to silently default to `"main"`, breaking LangChain workflows.
|
|
20
|
+
- Error message for DB load failures now surfaces the actual error string for easier diagnostics
|
|
21
|
+
|
|
8
22
|
## [0.2.6] - 2026-03-11
|
|
9
23
|
|
|
10
24
|
### Added
|
|
@@ -150,6 +164,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
150
164
|
- npm package published as `@path58/p58-n8n`
|
|
151
165
|
- ESM module support with shebang for direct `npx` execution
|
|
152
166
|
|
|
167
|
+
[0.2.7]: https://github.com/tsvika58/p58-n8n/releases/tag/v0.2.7
|
|
153
168
|
[0.2.6]: https://github.com/tsvika58/p58-n8n/releases/tag/v0.2.6
|
|
154
169
|
[0.2.5]: https://github.com/tsvika58/p58-n8n/releases/tag/v0.2.5
|
|
155
170
|
[0.2.4]: https://github.com/tsvika58/p58-n8n/releases/tag/v0.2.4
|
|
@@ -18473,7 +18473,7 @@ var import_types22 = require("@modelcontextprotocol/sdk/types.js");
|
|
|
18473
18473
|
var config = {
|
|
18474
18474
|
// Server identity
|
|
18475
18475
|
SERVER_NAME: "p58-n8n",
|
|
18476
|
-
SERVER_VERSION: "0.2.
|
|
18476
|
+
SERVER_VERSION: "0.2.8",
|
|
18477
18477
|
// Database configuration (from environment)
|
|
18478
18478
|
SUPABASE_URL: process.env.SUPABASE_URL,
|
|
18479
18479
|
SUPABASE_KEY: process.env.SUPABASE_KEY,
|
|
@@ -37464,7 +37464,7 @@ function extractWebhookPath(workflow) {
|
|
|
37464
37464
|
if (!trigger)
|
|
37465
37465
|
return null;
|
|
37466
37466
|
const params = trigger.parameters ?? {};
|
|
37467
|
-
const shortPath = typeof params.path === "string" && params.path.length > 0 && params.path || typeof params.webhookId === "string" && params.webhookId.length > 0 && params.webhookId || null;
|
|
37467
|
+
const shortPath = typeof params.path === "string" && params.path.length > 0 && params.path || typeof params.webhookId === "string" && params.webhookId.length > 0 && params.webhookId || typeof trigger.webhookId === "string" && trigger.webhookId.length > 0 && trigger.webhookId || null;
|
|
37468
37468
|
if (!shortPath)
|
|
37469
37469
|
return null;
|
|
37470
37470
|
const wfId = workflow.id;
|
|
@@ -37580,15 +37580,28 @@ async function testViaClone(workflow, triggerType, testPayload, timeoutMs, apiCo
|
|
|
37580
37580
|
result_summary: "Test clone could not be activated \u2014 check credentials in n8n Settings \u2192 Credentials."
|
|
37581
37581
|
};
|
|
37582
37582
|
}
|
|
37583
|
-
await new Promise((r) => setTimeout(r,
|
|
37584
|
-
|
|
37585
|
-
|
|
37586
|
-
|
|
37587
|
-
|
|
37588
|
-
|
|
37589
|
-
|
|
37583
|
+
await new Promise((r) => setTimeout(r, 3e3));
|
|
37584
|
+
let webhookPosted = false;
|
|
37585
|
+
for (let attempt = 0; attempt < 3 && !webhookPosted; attempt++) {
|
|
37586
|
+
try {
|
|
37587
|
+
if (attempt > 0)
|
|
37588
|
+
await new Promise((r) => setTimeout(r, 1e3 * attempt));
|
|
37589
|
+
await postWebhook(buildN8nHostUrl(), webhookPath, testPayload, Math.min(timeoutMs, 15e3));
|
|
37590
|
+
webhookPosted = true;
|
|
37591
|
+
} catch (webhookErr) {
|
|
37592
|
+
const errMsg = webhookErr instanceof Error ? webhookErr.message : String(webhookErr);
|
|
37593
|
+
const is404 = errMsg.includes("404") || errMsg.includes("not found");
|
|
37594
|
+
const isTimeout = errMsg.includes("timeout");
|
|
37595
|
+
if (isTimeout) {
|
|
37596
|
+
webhookPosted = true;
|
|
37597
|
+
break;
|
|
37598
|
+
}
|
|
37599
|
+
if (!is404 || attempt === 2)
|
|
37600
|
+
throw webhookErr;
|
|
37601
|
+
import_logging31.logger.debug("test_workflow: webhook 404 on attempt, retrying", { attempt, webhookPath });
|
|
37602
|
+
}
|
|
37590
37603
|
}
|
|
37591
|
-
await new Promise((r) => setTimeout(r,
|
|
37604
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
37592
37605
|
const deadline = Date.now() + Math.min(timeoutMs, 3e4);
|
|
37593
37606
|
let latestExecId = null;
|
|
37594
37607
|
let nodeDebug;
|
|
@@ -37930,15 +37943,27 @@ async function executeViaClone(config3, workflow, inputData, timeoutMs) {
|
|
|
37930
37943
|
note: "Execution clone could not be activated. This typically means credentials referenced by the workflow are not configured in n8n. Check n8n Settings \u2192 Credentials."
|
|
37931
37944
|
};
|
|
37932
37945
|
}
|
|
37933
|
-
await new Promise((r) => setTimeout(r,
|
|
37946
|
+
await new Promise((r) => setTimeout(r, 3e3));
|
|
37934
37947
|
const payload = inputData ?? buildDefaultWebhookPayload();
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37948
|
+
let webhookPosted = false;
|
|
37949
|
+
for (let attempt = 0; attempt < 3 && !webhookPosted; attempt++) {
|
|
37950
|
+
try {
|
|
37951
|
+
if (attempt > 0)
|
|
37952
|
+
await new Promise((r) => setTimeout(r, 1e3 * attempt));
|
|
37953
|
+
await postWebhook(buildN8nHostUrl(), webhookPath, payload, Math.min(timeoutMs, 15e3));
|
|
37954
|
+
webhookPosted = true;
|
|
37955
|
+
} catch (webhookErr) {
|
|
37956
|
+
const errMsg = webhookErr instanceof Error ? webhookErr.message : String(webhookErr);
|
|
37957
|
+
const is404 = errMsg.includes("404") || errMsg.includes("not found");
|
|
37958
|
+
const isTimeout = errMsg.includes("timeout");
|
|
37959
|
+
if (isTimeout) {
|
|
37960
|
+
webhookPosted = true;
|
|
37961
|
+
break;
|
|
37962
|
+
}
|
|
37963
|
+
if (!is404 || attempt === 2)
|
|
37964
|
+
throw webhookErr;
|
|
37965
|
+
import_logging32.logger.debug("execute_workflow: webhook 404 on attempt, retrying", { attempt, cloneId });
|
|
37966
|
+
}
|
|
37942
37967
|
}
|
|
37943
37968
|
const { executionId, node_debug, executionStatus, executionError } = await fetchLatestExecutionDebug(config3, cloneId, timeoutMs);
|
|
37944
37969
|
if (executionStatus === "success") {
|
|
@@ -41711,6 +41736,27 @@ var AI_TYPE_TO_CONNECTION_TYPE = {
|
|
|
41711
41736
|
reranker: "ai_reranker"
|
|
41712
41737
|
};
|
|
41713
41738
|
var DEFAULT_CONNECTION_TYPE = "main";
|
|
41739
|
+
var LANGCHAIN_PREFIX_TO_CONNECTION = [
|
|
41740
|
+
["@n8n/n8n-nodes-langchain.lmchat", "ai_languageModel"],
|
|
41741
|
+
["@n8n/n8n-nodes-langchain.lm", "ai_languageModel"],
|
|
41742
|
+
["@n8n/n8n-nodes-langchain.memory", "ai_memory"],
|
|
41743
|
+
["@n8n/n8n-nodes-langchain.tool", "ai_tool"],
|
|
41744
|
+
["@n8n/n8n-nodes-langchain.embeddings", "ai_embedding"],
|
|
41745
|
+
["@n8n/n8n-nodes-langchain.outputparser", "ai_outputParser"],
|
|
41746
|
+
["@n8n/n8n-nodes-langchain.retriever", "ai_retriever"],
|
|
41747
|
+
["@n8n/n8n-nodes-langchain.document", "ai_document"],
|
|
41748
|
+
["@n8n/n8n-nodes-langchain.textsplitter", "ai_textSplitter"],
|
|
41749
|
+
["@n8n/n8n-nodes-langchain.vectorstore", "ai_vectorStore"],
|
|
41750
|
+
["@n8n/n8n-nodes-langchain.reranker", "ai_reranker"]
|
|
41751
|
+
];
|
|
41752
|
+
function resolveByPattern(nodeType) {
|
|
41753
|
+
const lower = nodeType.toLowerCase();
|
|
41754
|
+
for (const [prefix, connType] of LANGCHAIN_PREFIX_TO_CONNECTION) {
|
|
41755
|
+
if (lower.startsWith(prefix))
|
|
41756
|
+
return connType;
|
|
41757
|
+
}
|
|
41758
|
+
return void 0;
|
|
41759
|
+
}
|
|
41714
41760
|
async function loadConnectionRules2() {
|
|
41715
41761
|
const { rows } = await (0, import_retry7.retryDbQuery)(() => validatorQuery(`SELECT LOWER(source_node_type) AS source_node_type,
|
|
41716
41762
|
LOWER(target_node_type) AS target_node_type,
|
|
@@ -41770,7 +41816,8 @@ var ConnectionTypeResolver = class _ConnectionTypeResolver {
|
|
|
41770
41816
|
});
|
|
41771
41817
|
return new _ConnectionTypeResolver(buildRuleMap(ruleRows), buildAITypeMap(aiNodeRows));
|
|
41772
41818
|
} catch (err) {
|
|
41773
|
-
|
|
41819
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
41820
|
+
import_logging53.logger.warn("connectionTypeResolver: DB load failed \u2014 pattern fallback active for LangChain nodes", { error: msg });
|
|
41774
41821
|
return new _ConnectionTypeResolver(/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map());
|
|
41775
41822
|
}
|
|
41776
41823
|
}
|
|
@@ -41794,6 +41841,9 @@ var ConnectionTypeResolver = class _ConnectionTypeResolver {
|
|
|
41794
41841
|
const aiType = this.aiTypeMap.get(sourceNodeType);
|
|
41795
41842
|
if (aiType)
|
|
41796
41843
|
return aiType;
|
|
41844
|
+
const patternType = resolveByPattern(sourceNodeType);
|
|
41845
|
+
if (patternType)
|
|
41846
|
+
return patternType;
|
|
41797
41847
|
}
|
|
41798
41848
|
return DEFAULT_CONNECTION_TYPE;
|
|
41799
41849
|
}
|