workflows.fit
Back to n8n workflows
n8n templateFreeBy Robert Breen

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 testi...

DevelopmentCore NodesSticky NoteCodeManual TriggerSplit Out
Loading interactive preview...

Template notes

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.