feat(editor): Relocate workflow ID expression notice (no-changelog) (#12942)

This commit is contained in:
Milorad FIlipović
2025-01-31 12:32:18 +01:00
committed by GitHub
parent 1ca6a9799a
commit 066908060f
8 changed files with 488 additions and 5 deletions

View File

@@ -4,14 +4,21 @@ import type { ILocalLoadOptionsFunctions, ResourceMapperFields } from 'n8n-workf
export async function loadSubWorkflowInputs(
this: ILocalLoadOptionsFunctions,
): Promise<ResourceMapperFields> {
const { fields, subworkflowInfo } = await loadWorkflowInputMappings.bind(this)();
const { fields, subworkflowInfo, dataMode } = await loadWorkflowInputMappings.bind(this)();
let emptyFieldsNotice: string | undefined;
if (fields.length === 0) {
const subworkflowLink = subworkflowInfo?.id
? `<a href="/workflow/${subworkflowInfo?.id}" target="_blank">sub-workflows trigger</a>`
: 'sub-workflows trigger';
emptyFieldsNotice = `This sub-workflow will not receive any input when called by your AI node. Define your expected input in the ${subworkflowLink}.`;
switch (dataMode) {
case 'passthrough':
emptyFieldsNotice = `This sub-workflow is set up to receive all input data, without specific inputs the Agent will not be able to pass data to this tool. You can define specific inputs in the ${subworkflowLink}.`;
break;
default:
emptyFieldsNotice = `This sub-workflow will not receive any input when called by your AI node. Define your expected input in the ${subworkflowLink}.`;
break;
}
}
return { fields, emptyFieldsNotice };
}