Building Your First n8n Workflow: A Practical Walkthrough

665 words
3 minutes
Building Your First n8n Workflow: A Practical Walkthrough
  1. 1Building Your First n8n Workflow: A Practical WalkthroughThis article

The first useful n8n workflow is not a trigger wired directly to a single action. It is a small pipeline that accepts an event, checks it, removes unwanted input, reshapes the data, and delivers a predictable result.

This walkthrough builds that pattern with a webhook receiving form submissions. It is intentionally small, but the same structure can later power Slack notifications, email delivery, CRM updates, or an internal API.

Before you start#

You need an n8n instance you can reach from the sender, a workflow editor, and a destination for the accepted data. The example uses a webhook, an IF node, a second IF node, a Set node, and an HTTP Request node. The destination can be Slack or any HTTP endpoint you control.

How the workflow fits together#

The relationship between the pieces is simple:

  1. A trigger starts the workflow when an HTTP request arrives.
  2. The first IF node rejects submissions without the required field.
  3. The second IF node filters a honeypot value commonly filled by bots.
  4. A Set node creates the smaller, explicit payload that downstream systems need.
  5. An HTTP Request or Slack node delivers only accepted data.

Keeping those responsibilities separate makes each branch easier to test and change.

1. Add and test the webhook#

Add a Webhook node and choose POST. Give it a stable path such as /form-submit. n8n exposes separate test and production webhook URLs; use the test URL while building and listening for a test event.

Send a sample request before adding the rest of the workflow:

Terminal window
curl -X POST https://your-n8n-instance/webhook-test/form-submit \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","message":"hello","honeypot":""}'

Confirm that the execution contains the fields you expect. If the data shape is wrong here, every later node will be harder to diagnose.

2. Validate required fields#

Add an IF node after the webhook. Check that {{$json.email}} is not empty. Route the false branch to a NoOp node, or use Respond to Webhook if the caller must receive an explicit 400 response.

Do not rely on the form being well behaved. Webhooks are public entry points unless you protect them with authentication, an IP allowlist, or another boundary outside the workflow.

3. Filter spam#

Add a second IF node that checks whether {{$json.honeypot}} is empty. A normal user never sees the honeypot field, while a basic automated submission may fill every field. Send the true branch forward and stop the false branch.

This is only a lightweight filter, not a complete abuse-prevention system. Add rate limiting, authentication, or a dedicated verification step when the endpoint is exposed to meaningful traffic.

4. Transform the data#

Add a Set node and keep only the fields the destination needs:

{
"email": "={{$json.email}}",
"message": "={{$json.message}}"
}

Do not forward the raw request by default. Explicit mapping reduces accidental data leakage and gives the receiving system a stable contract even if the form later gains new fields.

5. Deliver the accepted payload#

Add an HTTP Request node and point it at the destination endpoint. If you use Slack, choose the Slack node instead and map the cleaned fields into the message. Run another test execution and inspect the final node output as well as the destination.

When the test path is reliable, publish the workflow and switch the sender to the production webhook URL. Test and production URLs are different in n8n; a request sent to the test URL will not validate the production path.

Common beginner mistakes#

  • Testing the production URL before the workflow is published.
  • Passing the entire request object to the next service instead of mapping the required fields.
  • Forgetting to stop the false branches, so invalid submissions continue downstream.
  • Assuming an empty response means the workflow failed without checking the execution record.
  • Leaving a public webhook unauthenticated when it performs a write operation.

Why this shape matters#

The trigger -> validate -> filter -> transform -> deliver pattern is reusable across many event-driven automations. Once this workflow works, the trigger can become a form, email event, or database row, and the destination can become Slack, email, a CRM, or another API.

Next in this series: adding retries and error notifications so a failed delivery does not silently disappear. For the related agent-oriented direction, see n8n’s dedicated Agents update.

Share Article

If this article helped you, please share it with others!

Sources

Comments

Table of Contents