n8n/packages/nodes-base/nodes/ExecuteWorkflow/methods/resourceMapping.ts
2024-11-26 15:48:48 +01:00

25 lines
570 B
TypeScript

import type {
ILoadOptionsFunctions,
ResourceMapperField,
ResourceMapperFields,
} from 'n8n-workflow';
export async function getWorkflowInputs(
this: ILoadOptionsFunctions,
): Promise<ResourceMapperFields> {
// TODO: take the columns from the workflow input
const workflowInputs = ['uid', 'Test Field 2', 'Test Field 3'];
const fields: ResourceMapperField[] = workflowInputs.map((col) => ({
id: col,
displayName: col,
required: false,
defaultMatch: col === 'id',
display: true,
type: 'string',
canBeUsedToMatch: true,
}));
return { fields };
}