/** * Edit Fields (Set) Node - Version 3.4 * Discriminator: mode=manual */ // Helper types for special n8n fields /** * Assignment type determines how the value is interpreted. * - string: Direct string value or expression evaluating to string * - number: Direct number value or expression evaluating to number * - boolean: Direct boolean value or expression evaluating to boolean * - array: Expression that evaluates to an array, e.g. ={{ [1, 2, 3] }} or ={{ $json.items }} * - object: Expression that evaluates to a plain object (not an array — use the array type for arrays), e.g. ={{ { key: 'value' } }} or ={{ $json.data }} * - binary: Property name of binary data in the input item, or expression to access binary data from previous nodes, e.g. ={{ $('Node').item.binary.data }} */ type AssignmentType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'binary'; type AssignmentCollectionValue = { assignments: Array<{ id: string; name: string; value: unknown; type: AssignmentType }> }; /** Edit item fields one by one */ export type SetV34ManualParams = { mode: 'manual'; /** * Whether this item should be duplicated a set number of times * @default false */ duplicateItem?: boolean | Expression; /** * How many times the item should be duplicated, mainly used for testing and debugging * @displayOptions.show { duplicateItem: [true] } * @default 0 */ duplicateCount?: number | Expression; /** * Fields to Set * @default {} */ assignments?: AssignmentCollectionValue; /** * Whether to pass to the output all the input fields (along with the fields set in 'Fields to Set') * @default false */ includeOtherFields?: boolean | Expression; /** * How to select the fields you want to include in your output items * @displayOptions.hide { /includeOtherFields: [false] } * @default all */ include?: 'all' | 'selected' | 'except' | Expression; /** * Comma-separated list of the field names you want to include in the output. You can drag the selected fields from the input panel. * @displayOptions.show { include: ["selected"], /includeOtherFields: [true] } */ includeFields?: string | Expression | PlaceholderValue; /** * Comma-separated list of the field names you want to exclude from the output. You can drag the selected fields from the input panel. * @displayOptions.show { include: ["except"], /includeOtherFields: [true] } */ excludeFields?: string | Expression | PlaceholderValue; options?: { /** Whether binary data should be included if present in the input item * @default true */ includeBinary?: boolean | Expression; /** Whether binary data should be stripped from the input item. Only applies when "Include Other Input Fields" is enabled. * @displayOptions.show { /includeOtherFields: [true] } * @default true */ stripBinary?: boolean | Expression; /** Whether to ignore field type errors and apply a less strict type conversion * @default false */ ignoreConversionErrors?: boolean | Expression; /** By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }. If that is not intended this can be deactivated, it will then set { "a.b": value } instead. * @default true */ dotNotation?: boolean | Expression; }; }; export type SetV34ManualNode = { type: 'n8n-nodes-base.set'; version: 3.4; config: NodeConfig; };