Automation

How to create your first n8n workflow

n8n is a workflow automation tool you can run on your own server. It occupies the same space as Zapier and Make, with one important difference: the whole thing is a canvas of nodes you can inspect, and you can host it yourself so the data never leaves your infrastructure. This is what building the first workflow actually feels like.

The mental model

A workflow is a chain of nodes. The first is a trigger — it decides when the workflow runs. Every node after it receives an array of items from the node before, does something to each, and passes the result on. That is the entire model. Once the array-of-items idea clicks, the rest is reading documentation.

The detail that catches everyone: n8n passes arrays, not single objects. A node that receives five items runs five times. This is a feature — it is how you process a list without writing a loop — but it explains why a node sometimes appears to fire repeatedly.

The workflow we are building

Something small and genuinely useful: when a form is submitted, save the entry to a Google Sheet and post a summary to a Slack channel. Three nodes, one branch, and it exercises every concept you need for anything larger.

1. The trigger

Add a Webhook node. n8n gives you two URLs — a test URL and a production URL. The test URL only listens while you have "Listen for test event" active, which is the right way to develop: click listen, submit your form once, and n8n captures the real payload.

That captured payload matters more than it sounds. Every downstream node builds its field references from real data you can see, rather than from field names you guessed.

2. Shaping the data

Form payloads are rarely in the shape you want. Add a Set node (called Edit Fields in recent versions) and define exactly the fields you intend to store: name, email, message, submitted_at. Enable "Keep Only Set Fields" so nothing unexpected flows onward.

Values come from expressions. Drag a field from the input panel and n8n writes the reference for you — something like {{ $json.body.email }}. For a timestamp, {{ $now.toISO() }}. The expression language is JavaScript, so anything you can write in a browser console works here.

A note on validation

Add an IF node after the Set node and check that the email field is non-empty. Route the false branch to a No Operation node. It looks pointless, but it means bot submissions and half-filled forms never reach your Sheet, and the execution log shows you exactly how many were rejected.

3. Writing to Google Sheets

Add the Google Sheets node, operation Append Row. The first time, you create a credential: n8n walks you through the OAuth flow, and the credential is stored once and reused by every workflow. Pick the spreadsheet and sheet, then map each column to the fields you set earlier.

Make sure the header row exists in the sheet before you run this. n8n maps by column name, and it cannot map to headers that are not there.

4. Posting to Slack

Add the Slack node, operation Send Message. Choose the channel and compose the text with expressions:

New enquiry from {{ $json.name }} ({{ $json.email }})

Run the workflow once with the test webhook. Each node shows its input and output data side by side, which makes debugging almost trivial — you can see precisely where a field went missing.

5. Handling failures

This is the step people skip and later regret. Two things worth doing before you switch the workflow on:

  • Set retries on the external nodes. In each node's settings, enable "Retry On Fail" with two or three attempts. Third-party APIs return transient errors constantly; a retry absorbs most of them.
  • Add an error workflow. In workflow settings, point "Error Workflow" at a small second workflow that posts failures to Slack. Without it, a broken automation fails silently — which is worse than not having the automation.

6. Going live

Toggle the workflow to Active. Swap the test webhook URL in your form for the production URL — they are different, and forgetting this is the single most common reason a workflow "stops working" the moment it goes live. Submit a real entry and check the Executions tab.

Why self-host it

Hosted automation platforms price per task. That is excellent at low volume and gets uncomfortable quickly: a workflow firing a few thousand times a month can cost more than the server running it. Self-hosted n8n is a fixed monthly cost regardless of execution count.

The other reason is data. If your workflows touch customer records, invoices or anything with a compliance obligation attached, self-hosting means that data stays on infrastructure you control and can point at during an audit.

The trade-off is real: you own the updates, the backups and the uptime. n8n runs comfortably on a small VPS — two cores and 4 GB of RAM handles a lot — and a managed n8n plan removes the maintenance while keeping the fixed-cost and data-residency benefits. We run managed n8n at Gen X Web Hosting for exactly this reason.

Where to go next

Once the first workflow is running, the useful next steps are: the Schedule trigger for recurring jobs, the Code node for transformations that outgrow expressions, and Merge for combining two branches. Between those and what you have already built, most business automations are within reach.

Vipin Singh Founder, Gen X Web Hosting & NiviChat · Lucknow, India