Overview
This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
What Is the Set Node (Edit Fields) in n8n?
The Set node, renamed Edit Fields in newer n8n versions, creates, edits, renames, or removes fields on the data items flowing through your workflow. It is how you shape, clean, and standardize data between two nodes without writing code, using either a visual field mapper or raw JSON. Think of it as the node that decides exactly what data moves forward.
How to Use the Set Node in n8n
Add an Edit Fields (Set) node, then pick a mode. Manual Mapping lets you add each field name and value, dragging in values from earlier nodes as expressions. JSON mode lets you define the whole output object at once. Leave Include Other Input Fields off to drop every other field and pass a clean payload to the next node or API.
Common uses: rename keys to match an API, set default values, type-cast strings to numbers, or trim a large object down to only the fields the next step needs.
Key Takeaways
- The Edit Fields node, also called the Set node, does three jobs: it removes fields you do not need, formats values (for example, every last name in uppercase), and replaces null or NaN values with a fixed default so the data stays consistent.
- JSON mode outputs only the object you write. In the lesson, a test with two sample fields dropped every input field, so use it when you want the data to start fresh.
- In Manual Mapping, dragging an input field into a value turns the box into an expression that reads from
$json, the current item. Drag first name and last name in with a space between them and you get a new full name field. - Turn on Include Other Input Fields to keep the rest of the item. Then pick All Except and list first name and last name, so only the new full name goes forward.
- A value can be decided by an expression.
$nowwith its diffTo method counts the days since the order date, and a ternary (condition ? true value : false value) marks orders older than 45 days as high priority and the rest as standard.
Related Lessons
- Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths
- Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro
- Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data
- Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast
- Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration
Next Steps
Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.