Skip to main content

Generate and split sample data records using JavaScript and Python

Workflow preview

Workflow preview
100%
Generate and split sample data records using JavaScript and Python preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

A minimal, plug and play workflow that generates sample data using n8n’s Code node (both JavaScript and Python versions included) and then fans out those records into individual items with Split Ou...

Best for

  • Engineering automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.manualtrigger, n8n-nodes-base.splitout

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Robert Breen.

Original n8n.io source

1.1 Workflow description

Title
Generate and split sample data records using JavaScript and Python
Workflow name
Generate and split sample data records using JavaScript and Python

A minimal, plug-and-play workflow that generates sample data using n8n’s Code node (both JavaScript and Python versions included) and then fans out those records into individual items with Split Out. Perfect for testing downstream nodes, mapping, pagination, or prototyping list-based logic without connecting to real data sources.


✅ What this template does

  • Generates 20 sample records with fields: index, num, and test
  • Writes the array to item.json.barr
  • Uses Split Out to convert the array into one item per record
  • Includes both JavaScript and Python implementations side-by-side

👤 Who’s it for

  • Builders who need mock data to test mappings and loops
  • Educators/demo makers who want a simple fan-out pattern
  • Anyone who wants a clean scaffold for list processing in n8n

⚙️ How it works / What it does

  • Generate Data Javascript: Produces barr = [{ index, num, test }, ...] for 20 rows
  • Generate Data Python: Same output, written in Python
  • Split Out Javascript / Python: Takes barr and emits one item per element

> Use either branch (JS or Python) depending on your preference.


🛠️ How to set up

No external setup required. Import the workflow and Execute.
Select either the JavaScript or Python branch to see fan-out items.


📋 Requirements

  • n8n (Cloud or self-hosted)
  • No credentials or third-party services

🎛️ Customize the workflow

  • Change the number of rows: adjust the loop range (0..N)
  • Rename or add fields to each record (e.g., name, price, tags)
  • Replace the static array with generated or randomized data
  • Pipe the Split Out output into Set, Function, HTTP, or Sheets nodes for further testing

🗒️ Notes

  • Sticky notes are included for in-editor guidance.
  • Both implementations return the same structure so you can swap freely.

📬 Contact

Need help customizing this (e.g., shaping fields, adding randomizers, or exporting to CSV/Sheets)?

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Generate Data Javascript

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Generate Data Python

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Start Workflow

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 6 - Split Out Javascript

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 7 - Split Out Python

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

3. Summary Table

Workflow Generate and split sample data records using JavaScript and Python
Complexity intermediate
Nodes 7
Categories Engineering
Author Robert Breen
Published 03 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8230/8230.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate and split sample data records using JavaScript and Python do?

A minimal, plug and play workflow that generates sample data using n8n’s Code node (both JavaScript and Python versions included) and then fans out those records into individual items with Split Ou...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.