πŸŽ“ Learn Code Node (JavaScript) with an Interactive Hands-On Tutorial β€” n8n Workflow

Medium complexity⚑ Trigger7 nodes🏷️ MiscellaneousπŸ‘ 39,490 viewsby Lucas Peyrin

Overview

How it works

This workflow is a hands-on tutorial for the Code node in n8n, covering both basic and advanced concepts through a simple data processing task.

Provides Sample Data: The workflow begins with a sample list of users. Processes Each Item (Run Once for Each Item): The first Code node iterates through each user to calculate their fullName and age. This demonstrates basic item-by-item data manipulation using $input.item.json. Fetches External Data (Advanced): The second Code node showca

Nodes used

Code

Workflow Preview

▢️ STARTING POINT: Sample Data
These nodes prepare our data for the tutorial.
1. `1. Sample Data`: Creates a list of users. Feel fre
2. `2. Split
βš™οΈ LESSON 1: Processing Each Item
This node is in "Run Once for Each Item" mode. It execu
Goal: Enrich each user's data.
Key Concepts:
* `$input.item.json
πŸš€ ADVANCED LESSON 2: Using Helpers
This node also runs for each item, but demonstrates a p
Goal: Enrich data by calling an external API from code.
Key Concepts:
βš™οΈ LESSON 3: Processing All Items at Once
This node is in "Run Once for All Items" mode. It runs
Goal: Aggregate data to create a summary.
πŸ“„ EXPERT LESSON 4: Creating Files
Goal: Aggregate all items and generate a binary file (l
Mode: `Run Once for All Items`
Key Concepts:
* `$("4. Fetch Exter
Was this helpful? Let me know!
![clic](https://workflows.ac/form)
I really hope this template helped you. You
πŸ€– Mastering the n8n Code Node: The Ultimate
Unlock the full potential of custom logic in n8n with t
1
1. Sample Data
2
2. Split Out Users
3. Process Each User
5. Calculate Average Age
4. Fetch External Data (…
6. Create a Binary File …
⚑
S
Start Tutorial
7 nodes6 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 7 nodes, connecting code, manualtrigger, set.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (7)

CO

Code

code

#1

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows β†’ New β†’ Import from file.
  3. 3Select the downloaded learn-code-node-javascript-with-an-interactive-hands-on-tutorial file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n β†’ Import from JSON:

{ "name": "πŸŽ“ Learn Code Node (JavaScript) with an Interactive Hands-On Tutorial", "nodes": [...], ...}

Integrations

codemanualtriggersetsplitout

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes7
Complexitymedium
Triggertrigger
Views39,490

Created by

Lucas Peyrin

Lucas Peyrin

@lucaspeyrin

Tags

codemanualtriggersetsplitout
⚑

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free β†’

Related Miscellaneous Workflows