Overview
This node generates mock data records using the Faker.js library, which is widely used for creating realistic fake data for testing and development purposes. It supports multiple modes of defining the data schema: a simple line-based input, a UI-driven field and rule selection, or an advanced JSON input specifying Faker rules directly.
Common scenarios where this node is beneficial include:
- Quickly generating sample datasets for testing workflows or applications.
- Creating dummy user profiles, addresses, emails, or other common data types.
- Simulating data inputs for demos or training environments without exposing real data.
For example, you can generate 100 fake user records with names, emails, and phone numbers in English locale, or create localized address data in German by selecting the appropriate locale.
Properties
| Name | Meaning |
|---|---|
| Mode | Selects how to define the data generation schema. Options: Simple (enter field names and optional rules as text), UI Mode (select fields and rules via UI), Advanced (provide JSON with detailed Faker rules). |
| Fields | (Shown only in UI Mode) Define multiple fields with their names and select a Faker rule for each field from predefined options like Address, Email, UUID, etc. |
| JSON Input | (Shown only in Advanced mode) Provide a JSON array defining fields and their Faker rules explicitly, e.g., [{"name": "email", "rule":"internet.email"}]. Useful for complex or custom Faker API usage. |
| Simple Input | (Shown only in Simple mode) Enter field names one per line, optionally with a colon and Faker rule, e.g.:\nlastName\nfirstName:name.firstName\nemail:internet.email\n If no rule is given, a default alphabetical text is used. |
| Total Record | Number of mock data records to generate. |
| Locale | Select the locale/language for data generation, affecting the style and format of generated data. Options include English, German, French, Spanish, Chinese, Japanese, Korean, Italian, Vietnamese. |
| Notice | A notice field displaying a link to documentation on how the node works. |
Output
The node outputs an array of JSON objects, each representing one generated record according to the defined schema. Each object contains key-value pairs where keys are the field names and values are the generated fake data.
Example output record (JSON):
{
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe"
}
No binary data output is produced by this node.
Dependencies
- Uses the
@faker-js/fakerlibrary for generating fake data, supporting multiple locales. - Uses
mocker-data-generatorpackage to build and generate the dataset synchronously. - No external API calls or credentials are required; all data generation is local.
Troubleshooting
- Invalid JSON in Advanced Mode: If the JSON input is malformed, the node will fail parsing it. Ensure valid JSON syntax.
- Unknown Faker Rules: In Simple mode, if a field's rule is not recognized, a default alphabetical string is generated instead.
- Locale Not Supported: Selecting a locale not supported by Faker may fallback to English or cause unexpected results.
- Empty Fields: Defining no fields or empty field names will result in no data generated.
- Large Record Counts: Generating very large numbers of records may impact performance or memory usage.