n8n-nodes-base
Version:
Base nodes of n8n
32 lines (29 loc) • 1.07 kB
text/typescript
/**
* Switch Node - Version 3.1
* Discriminator: mode=expression
*/
/** Write an expression to return the output index */
export type SwitchV31ExpressionParams = {
mode: 'expression';
/**
* How many outputs to create
* @default 4
*/
numberOutputs?: number | Expression<number>;
/**
* The output index to send the input item to. Use an expression to calculate which input item should be routed to which output. The expression must return a number.
* @hint The index to route the item to, starts at 0
* @default ={{}}
*/
output?: number | Expression<number>;
/**
* If the type of an expression doesn't match the type of the comparison, n8n will try to cast the expression to the required type. E.g. for booleans <code>"false"</code> or <code>0</code> will be cast to <code>false</code>
* @default false
*/
looseTypeValidation?: boolean | Expression<boolean>;
};
export type SwitchV31ExpressionNode = {
type: 'n8n-nodes-base.switch';
version: 3.1;
config: NodeConfig<SwitchV31ExpressionParams>;
};