n8n
Version:
n8n Workflow Automation Tool
23 lines • 880 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStaticSubworkflowId = getStaticSubworkflowId;
const n8n_workflow_1 = require("n8n-workflow");
function getStaticSubworkflowId(node) {
if (!(0, n8n_workflow_1.isNodeWithWorkflowSelector)(node))
return undefined;
const { source = 'database' } = node.parameters;
if (source !== 'database')
return undefined;
const { workflowId: storedWorkflowId } = node.parameters;
const workflowId = (0, n8n_workflow_1.getSubworkflowId)(node) ?? storedWorkflowId;
return toStaticId(workflowId);
}
function toStaticId(value) {
if (typeof value !== 'string')
return undefined;
const trimmed = value.trim();
if (trimmed === '' || trimmed.startsWith('='))
return undefined;
return trimmed;
}
//# sourceMappingURL=static-sub-workflow-id.js.map