Skip to main content
Glama

n8n-workflow-builder-mcp

by ifmelate
edit-node-credentials-placeholder.test.js1.9 kB
const path = require('path'); const { validateAndNormalizeWorkflow } = require('../../dist/validation/workflowValidator.js'); const { loadNodeTypesForCurrentVersion } = require('../../dist/validation/nodeTypesLoader.js'); describe('edit_node credentials placeholder injection', () => { const n8nVersion = '1.103.0'; it('injects placeholders for postgres required credentials and clears missing_credentials', async () => { const nodeTypes = await loadNodeTypesForCurrentVersion(path.resolve(__dirname, '../../workflow_nodes'), n8nVersion); // Build a minimal workflow with postgres missing credentials const workflow = { name: 'TMP', nodes: [ { id: 'p1', name: 'PG', type: 'n8n-nodes-base.postgres', typeVersion: 2.6, position: [0, 0], parameters: { operation: 'select' } } ], connections: {} }; const pre = validateAndNormalizeWorkflow(workflow, nodeTypes); const preIssues = (pre.nodeIssues || {})['PG'] || []; const hadMissingCreds = preIssues.some(i => i.code === 'missing_credentials'); expect(hadMissingCreds).toBe(true); // Simulate edit_node placeholder injection using credentialsConfig const def = nodeTypes.getByNameAndVersion('n8n-nodes-base.postgres', 2.6); const cfg = (def?.description?.credentialsConfig || []).filter(c => c.required).map(c => String(c.name)); workflow.nodes[0].credentials = {}; for (const name of cfg) { workflow.nodes[0].credentials[name] = { id: 'dummy', name: `${name}-placeholder` }; } const post = validateAndNormalizeWorkflow(workflow, nodeTypes); const postIssues = (post.nodeIssues || {})['PG'] || []; const stillMissing = postIssues.some(i => i.code === 'missing_credentials'); expect(stillMissing).toBe(false); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ifmelate/n8n-workflow-builder-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server