/** * n8n Form Trigger Node - Version 2.2 * Generate webforms in n8n and pass their responses to the workflow */ export interface FormTriggerV22Params { authentication?: 'basicAuth' | 'none' | Expression; /** * Shown at the top of the form */ formTitle?: string | Expression | PlaceholderValue; /** * Shown underneath the Form Title. Can be used to prompt the user on how to complete the form. Accepts HTML. Does not accept <code><script></code>, <code><style></code> or <code><input></code> tags. */ formDescription?: string | Expression | PlaceholderValue; /** * Form Elements * @default {} */ formFields?: { /** Values */ values?: Array<{ /** The name of the field, used in input attributes and referenced by the workflow * @displayOptions.hide { fieldType: ["html"] } */ fieldName?: string | Expression | PlaceholderValue; /** Label that appears above the input field * @displayOptions.hide { fieldType: ["hiddenField", "html"] } */ fieldLabel?: string | Expression | PlaceholderValue; /** Label that appears above the input field * @displayOptions.hide { fieldType: ["hiddenField", "html"] } */ fieldLabel?: string | Expression | PlaceholderValue; /** The name of the field, used in input attributes and referenced by the workflow * @displayOptions.show { fieldType: ["hiddenField"] } */ fieldName?: string | Expression | PlaceholderValue; /** The type of field to add to the form * @default text */ fieldType?: 'checkbox' | 'html' | 'date' | 'dropdown' | 'email' | 'file' | 'hiddenField' | 'number' | 'password' | 'radio' | 'text' | 'textarea' | Expression; /** Optional field. It can be used to include the html in the output. * @displayOptions.show { fieldType: ["html"] } */ elementName?: string | Expression | PlaceholderValue; /** The name of the field, used in input attributes and referenced by the workflow * @displayOptions.hide { fieldType: ["html"] } */ fieldName?: string | Expression | PlaceholderValue; /** Sample text to display inside the field * @displayOptions.hide { fieldType: ["dropdown", "date", "file", "html", "hiddenField", "radio", "checkbox"] } */ placeholder?: string | Expression | PlaceholderValue; /** Default value that will be pre-filled in the form field * @displayOptions.show { fieldType: ["text", "number", "email", "textarea"] } */ defaultValue?: string | Expression | PlaceholderValue; /** Default date value that will be pre-filled in the form field (format: YYYY-MM-DD) * @displayOptions.show { fieldType: ["date"] } */ defaultValue?: string | Expression; /** Default value that will be pre-selected. Must match one of the option labels. * @displayOptions.show { fieldType: ["dropdown", "radio"] } */ defaultValue?: string | Expression | PlaceholderValue; /** Default value(s) that will be pre-selected. Must match one or multiple of the option labels. Separate multiple pre-selected options with a comma. * @displayOptions.show { fieldType: ["checkbox"] } */ defaultValue?: string | Expression | PlaceholderValue; /** Input value can be set here or will be passed as a query parameter via Field Name if no value is set * @displayOptions.show { fieldType: ["hiddenField"] } */ fieldValue?: string | Expression | PlaceholderValue; /** List of options that can be selected from the dropdown * @displayOptions.show { fieldType: ["dropdown"] } * @default {"values":[{"option":""}]} */ fieldOptions?: { /** Values */ values?: Array<{ /** Option */ option?: string | Expression | PlaceholderValue; }>; }; /** Checkboxes * @displayOptions.show { fieldType: ["checkbox"] } * @default {"values":[{"option":""}]} */ fieldOptions?: { /** Values */ values?: Array<{ /** Checkbox Label */ option?: string | Expression | PlaceholderValue; }>; }; /** Radio Buttons * @displayOptions.show { fieldType: ["radio"] } * @default {"values":[{"option":""}]} */ fieldOptions?: { /** Values */ values?: Array<{ /** Radio Button Label */ option?: string | Expression | PlaceholderValue; }>; }; /** Whether to allow the user to select multiple options from the dropdown list * @displayOptions.show { fieldType: ["dropdown"] } * @default false */ multiselect?: boolean | Expression; /** Limit Selection * @displayOptions.show { fieldType: ["checkbox"] } * @default unlimited */ limitSelection?: 'exact' | 'range' | 'unlimited' | Expression; /** Number of Selections * @displayOptions.show { fieldType: ["checkbox"], limitSelection: ["exact"] } * @default 1 */ numberOfSelections?: number | Expression; /** Minimum Selections * @displayOptions.show { fieldType: ["checkbox"], limitSelection: ["range"] } * @default 0 */ minSelections?: number | Expression; /** Maximum Selections * @displayOptions.show { fieldType: ["checkbox"], limitSelection: ["range"] } * @default 1 */ maxSelections?: number | Expression; /** HTML elements to display on the form page * @hint Does not accept <code><script></code>, <code><style></code> or <code><input></code> tags * @displayOptions.show { fieldType: ["html"] } */ html?: string; /** Whether to allow the user to select multiple files from the file input or just one * @displayOptions.show { fieldType: ["file"] } * @default true */ multipleFiles?: boolean | Expression; /** Comma-separated list of allowed file extensions * @hint Leave empty to allow all file types * @displayOptions.show { fieldType: ["file"] } */ acceptFileTypes?: string | Expression | PlaceholderValue; /** Whether to require the user to enter a value for this field before submitting the form * @displayOptions.hide { fieldType: ["html", "hiddenField"] } * @default false */ requiredField?: boolean | Expression; }>; }; /** * When to respond to the form submission * @default onReceived */ responseMode?: 'onReceived' | 'lastNode' | Expression; options?: { /** Whether to include the link “Form automated with n8n” at the bottom of the form * @default true */ appendAttribution?: boolean | Expression; /** Comma-separated list of allowed IP addresses or CIDR ranges. Leave empty to allow all IPs. */ ipWhitelist?: string | Expression | PlaceholderValue; /** The label of the submit button in the form * @default Submit */ buttonLabel?: string | Expression | PlaceholderValue; /** The final segment of the form's URL, both for test and production */ path?: string | Expression | PlaceholderValue; /** Form Response * @displayOptions.hide { /responseMode: ["responseNode"] } * @default {"values":{"respondWith":"text"}} */ respondWithOptions?: { /** Values */ values?: { /** Respond With * @default text */ respondWith?: 'text' | 'redirect' | Expression; /** The text displayed to users after they fill the form. Leave it empty if don't want to show any additional text. * @displayOptions.show { respondWith: ["text"] } * @default Your response has been recorded */ formSubmittedText?: string | Expression | PlaceholderValue; /** The URL to redirect users to after they fill the form. Must be a valid URL. * @displayOptions.show { respondWith: ["redirect"] } */ redirectUrl?: string | Expression | PlaceholderValue; }; }; /** Whether to ignore requests from bots like link previewers and web crawlers * @default false */ ignoreBots?: boolean | Expression; /** Whether to use the workflow timezone in 'submittedAt' field or UTC * @default false */ useWorkflowTimezone?: boolean | Expression; /** Whether to use the workflow timezone in 'submittedAt' field or UTC * @default true */ useWorkflowTimezone?: boolean | Expression; /** Override default styling of the public form interface with CSS */ customCss?: string | Expression | PlaceholderValue; }; } export interface FormTriggerV22Credentials { httpBasicAuth: CredentialReference; } interface FormTriggerV22NodeBase { type: 'n8n-nodes-base.formTrigger'; version: 2.2; credentials?: FormTriggerV22Credentials; isTrigger: true; } export type FormTriggerV22ParamsNode = FormTriggerV22NodeBase & { config: NodeConfig; }; export type FormTriggerV22Node = FormTriggerV22ParamsNode;