Ir para o conteúdo

Lição 2 · Getting Started

Set Up n8n and Build Your First Workflow

Choose between n8n Cloud and Docker self-hosting, find your way around the editor, build a first manual workflow, and learn the difference between save and publish.

Before you automate anything, you need a place to run workflows and a feel for the editor. This lesson compares the two ways to get n8n, shows a Docker start command, and walks you through a tiny first workflow that needs no accounts or keys.

Cloud or self-hosted?

Two ways to run n8n

n8n Cloud Hosted for you
Self-hosted You run it in Docker
1 / 2

With Cloud, the vendor runs the servers, updates them and handles uptime. With self-hosting, you get control over where data lives, but you are responsible for backups, updates, HTTPS and security. Read the license notes before you build a business on a self-hosted copy.

Run n8n locally with Docker

Docker is the way the current documentation describes for self-hosting. The release notes say version 3.0 (late October 2026) no longer supports installing with npm or npx, so use containers. The official docs recommend Docker Compose for real deployments. For a quick local trial, a command like this is enough (replace the timezone):

Terminal
# Read-only: run this on your own machine with Docker installed
docker volume create n8n_data

docker run -it --rm --name n8n -p 5678:5678 \
  -e GENERIC_TIMEZONE="Europe/Berlin" -e TZ="Europe/Berlin" \
  -v n8n_data:/home/node/.n8n \
  n8nio/n8n

Then open http://localhost:5678 and create the first owner account. The -v part matters: it stores your database and settings in a volume, so they survive when the container is removed. GENERIC_TIMEZONE controls how schedule nodes read time, and TZ sets the system clock zone.

For a real server, pin a specific image version instead of whatever is newest, and read the release notes before upgrading.

Do not put a local test instance on the public internet. Without HTTPS, strong login settings and updates, anyone who finds it may reach your saved credentials.

Find your way around

Menu positions shift between versions, so learn the concepts:

  • Canvas: where you place and connect nodes.
  • Node panel: where you search for nodes to add.
  • Node view: opens when you click a node. It shows parameters, the input data and the output data.
  • Executions: the history of runs, with the data each node saw.
  • Credentials: where API keys and logins are stored, separate from workflows.

Build your first workflow

You will make a workflow that creates a greeting.

  1. Create a new workflow and name it Hello items.
  2. Add a Manual Trigger node. It starts a run when you click the execute button in the editor.
  3. Add an Edit Fields (Set) node and connect it to the trigger. Add a text field called name with the value Amara.
  4. Add a second Edit Fields node. Add a field called greeting and switch the value to an expression:
TEXT
Hello, {{ $json.name }}! Welcome to automation.
  1. Run the workflow, then open each node and read its output.

The double braces mark an expression. $json means "the data of the item this node is working on". You will learn much more in Expressions.

Save, publish and unpublish

Since n8n 2.0, changing a workflow does not change what runs in production. Your edits are saved as a draft version. Automatic triggers run the published version only. You publish when you are happy, and you can unpublish to take it out of service. Version history lets you look at or restore older versions.

Action What it affects
Run in the editor A test run of what you see on the canvas
Save (autosave) Your draft only
Publish What automatic triggers execute
Unpublish Stops automatic runs

Older guides talk about an "Active" switch. In current versions, think "published".

A stand-in for what you built

This program imitates the three nodes. It is not n8n, but it shows how each node receives the previous output.

JS Stand-in: the Hello items workflow

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The trigger sends one empty item. Without at least one item, later nodes would have nothing to process.

Common mistakes

  • Testing in the editor and assuming the workflow now runs by itself. It does not until you publish it.
  • Running Docker without a volume, then losing every workflow when the container is removed.
  • Leaving nodes with default names such as Edit Fields1. Rename them; expressions and debugging become much clearer.

Experiment with your workflow

Once the greeting works, change it and watch the data. Add a Code node or another item source before the greeting that returns three names, then run again. The greeting node now runs three times without any change to its settings. Next, rename a field from name to firstName and run the workflow. The greeting shows a missing value, because the expression still asks for the old path. Fix it by reading the input panel and copying the new path. These two experiments teach the most common cycle in n8n: look at the input, write the expression, check the preview and run.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does a published workflow do that a saved draft does not?

    Production executions use the published version, not your latest edits.
  2. 2. Why mount a Docker volume for n8n?

    Without persistent storage, workflows and settings vanish with the container.
  3. 3. What starts a Manual Trigger workflow?

    The Manual Trigger exists for runs you start yourself.
  4. 4. In {{ $json.name }}, what is $json?

    $json refers to the current item's data in the node.

Summary

  • Use n8n Cloud for speed, or Docker for control and responsibility.
  • Keep data in a volume and protect any server you expose.
  • A workflow is built from a trigger and connected nodes.
  • Publishing, not saving, changes what runs automatically.

Next: Nodes and Connections

Seu progresso fica salvo neste navegador. Não precisa de conta.