Beginner guide: n8n Set node — how to use?
The n8n Set node — how to use is shown here with clear steps and commands. The Set node lets you add, change, or remove fields on items in a workflow. Use it to create static values, map incoming data, and prepare payloads for the next node.
What You Need
- Docker installed on your machine.
- An n8n Docker image (official).
- Basic familiarity with workflows and JSON.
n8n Set node — how to use: Quick steps
Follow these numbered steps to install, create, and test a Set node workflow.
Step 1: Install n8n with Docker
Pull and run the official image. This creates a local n8n instance on port 5678.
docker pull n8nio/n8n:latest
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n:latest
Or use docker-compose for a persistent setup.
version: '3'
services:
n8n:
image: n8nio/n8n:latest
ports:
- "5678:5678"
volumes:
- ~/.n8n:/home/node/.n8n
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=changeme
Step 2: Create a new workflow
Open n8n in your browser at http://localhost:5678. Create a new workflow.
Add a trigger node (for example, Webhook) or a Start node. Add a Set node after it.
Step 3: Configure the Set node
- Open the Set node panel.
- Use Add Field to create a new key and value.
- Use Copy From to map existing fields.
- Toggle Keep Only Set to remove other fields if needed.
Example mapping logic:
- 1. Add field: “fullName” = {{$json[“firstName”] + ” ” + $json[“lastName”]}}
- 2. Set static field: “status” = “new”
- 3. Remove unneeded fields by enabling “Keep Only Set”
Step 4: Test the workflow
Trigger the workflow. Use curl to post sample JSON to a webhook node.
curl -X POST http://localhost:5678/webhook/test \
-H "Content-Type: application/json" \
-d '{"firstName":"Alex","lastName":"Doe"}'
Check the execution and inspect the item after the Set node. You should see new and modified fields.
Update
To update n8n, pull the new Docker image and restart the container.
docker pull n8nio/n8n:latest
docker stop n8n && docker rm n8n
# restart with your previous run command or docker-compose
Back up ~/.n8n before updating. This keeps workflows and credentials safe.
Security
Enable basic auth or use a reverse proxy with HTTPS. Do not expose port 5678 to the public internet without protection.
- Use environment variables for secrets.
- Run behind a TLS-terminating reverse proxy such as Nginx or Traefik.
- Limit access with a firewall or VPN.
Done
You now know how to use the n8n Set node. You can add, map, and remove fields to shape data for the rest of your workflow.
Try adding conditional logic or combine Set with Function or HTTP Request nodes to build real automations.