n8n-nodes-hebing-parameter-input
v2.2.0
Published
A custom n8n node for parameter input with bilingual support
Maintainers
Readme
n8n-nodes-parameter-input
A custom n8n node for inputting parameters with bilingual support. This node allows you to define custom parameters in English and Chinese with various data types and default values, and outputs them as a JSON object for use throughout your workflow.
Features
- Bilingual Support: Define parameter names in both English and Chinese
- Multiple Data Types: Supports String, Number, Boolean, Date, JSON, File, Audio, Video, and Image types
- File Support: Support for document files (docx, xls, xlsx, csv, txt)
- Audio Support: Support for all audio formats (mp3, wav, flac, aac, ogg, m4a, wma, etc.)
- Video Support: Support for all video formats (mp4, avi, mkv, mov, wmv, flv, webm, etc.)
- Image Support: Support for all image formats (jpg, jpeg, png, gif, bmp, webp, svg, ico, tiff, heic, etc.)
- Binary Data: Optional support for reading and including file content as binary data
- Default Values: Set default values for each parameter
- Dynamic Parameters: Add multiple parameters (up to 20)
- JSON Output: All parameters are output as a JSON object for easy use in subsequent nodes
Installation
n8n Cloud
- Go to the n8n Cloud dashboard
- Click on "Settings" > "Community Nodes"
- Add the "n8n-nodes-parameter-input" node
- Click "Install"
n8n Self-Hosted
npm install n8n-nodes-parameter-inputThen restart n8n.
Usage
- Drag and drop the "Parameter Input" node into your workflow
- Set the number of parameters you want to define
- For each parameter:
- Enter the English name (used as the JSON key)
- Enter the Chinese name (for display only)
- Select the parameter type
- Enter a default value
- Connect the node to other nodes in your workflow
- The parameter values will be available as
$json.parameterNamein subsequent nodes
Parameter Types
| Type | Description | Additional Fields | |------|-------------|------------------| | String | A text string | Value field | | Number | A numeric value | Value field | | Boolean | True/false value | Value field | | Date | A date and time value | Value field | | JSON | A JSON object or array | Value field | | File | Document files | File Path, Include Binary Data | | Audio | Audio files | Audio Path, Include Binary Data | | Video | Video files | Video Path, Include Binary Data | | Image | Image files | Image Path, Include Binary Data |
File Type Details
File Type - Supports document files:
- Word documents: .docx, .doc
- Excel spreadsheets: .xlsx, .xls
- CSV files: .csv
- Text files: .txt
- PDF files: .pdf
Audio Type - Supports all audio formats:
- Common: .mp3, .wav, .flac, .aac
- Other: .ogg, .m4a, .wma, .opus, .webm, .aiff, .alac
Video Type - Supports all video formats:
- Common: .mp4, .avi, .mkv, .mov
- Other: .wmv, .flv, .webm, .m4v, .mpg, .mpeg, .3gp, .ogv
Image Type - Supports all image formats:
- Common: .jpg, .jpeg, .png, .gif, .bmp
- Web: .webp, .svg, .ico
- Professional: .tiff, .tif, .jp2
- Modern: .heic, .heif, .apng
Binary Data Option
For File, Audio, and Video types, you can enable "Include Binary Data" to:
- Read the file content automatically
- Convert it to base64 format
- Include it in the binary data output
- Make it available for downstream nodes that process binary data
Example Output
Basic Parameters Example
If you define two parameters:
- English name: "apiKey", Chinese name: "API密钥", Type: String, Value: "1234567890"
- English name: "userId", Chinese name: "用户ID", Type: Number, Value: 1234
The output will be:
{
"apiKey": "1234567890",
"userId": 1234
}File/Audio/Video/Image Parameters Example
If you define media parameters:
- Name: "document", Type: File, File Path: "/path/to/report.xlsx"
- Name: "audio", Type: Audio, Audio Path: "/path/to/recording.mp3", Include Binary: true
- Name: "video", Type: Video, Video Path: "/path/to/tutorial.mp4"
- Name: "logo", Type: Image, Image Path: "/path/to/logo.png", Include Binary: true
The JSON output will be:
{
"document": {
"filePath": "/path/to/report.xlsx",
"fileName": "report.xlsx",
"type": "file"
},
"audio": {
"audioPath": "/path/to/recording.mp3",
"fileName": "recording.mp3",
"type": "audio"
},
"video": {
"videoPath": "/path/to/tutorial.mp4",
"fileName": "tutorial.mp4",
"type": "video"
},
"logo": {
"imagePath": "/path/to/logo.png",
"fileName": "logo.png",
"type": "image"
}
}And if "Include Binary Data" is enabled, the binary data will be available in the binary property:
{
"audio": {
"data": "base64_encoded_content...",
"mimeType": "audio/mpeg",
"fileName": "recording.mp3"
},
"logo": {
"data": "base64_encoded_content...",
"mimeType": "image/png",
"fileName": "logo.png"
}
}Configuration
Parameter Count
The number of parameters to define (1-20).
Parameter Fields
Each parameter has the following fields:
Parameter Name (English)
The English name of the parameter. This will be used as the key in the output JSON object. It's recommended to use camelCase or snake_case for compatibility.
Parameter Name (Chinese)
The Chinese name of the parameter. This is for display purposes only and will not be included in the output JSON.
Parameter Type
The data type of the parameter. See "Parameter Types" section for details.
Parameter Value
The default value of the parameter. The format depends on the parameter type.
Version History
- 2.2.0: Added support for Image parameter type with all common image formats (jpg, png, gif, bmp, webp, svg, etc.)
- 2.1.0: Added support for File, Audio, and Video parameter types with binary data option
- 2.0.0: Initial release
