Lesson 02: n8n HTTP Request Node: Connect Any API Without Code

Hi everyone, in this post I'll show you how to use the n8n HTTP Request node to pull data from any API — no code required. This is one of the most useful nodes in n8n workflow automation, and once you get the hang of it, you'll use it in almost every workflow you build.

This article is part of the n8n Workflow Automation Tutorial series here on QTitHow.com, taking you from beginner basics all the way to advanced automation. Today we're focusing on a real hands-on example: fetching to-do items from a public API and routing them through multiple nodes. Let's get started.

What Is the n8n HTTP Request Node?

The HTTP Request node in n8n lets you connect to virtually any REST API on the internet — GET, POST, PUT, DELETE, you name it. Think of it as a universal adapter. Whether you're pulling data from a project management tool, a public database, or your own backend, the n8n HTTP Request node handles it without writing a single line of code.

In this n8n tutorial, we'll use the free public API at jsonplaceholder.typicode.com as our data source. It returns fake to-do items — perfect for practice. No API key needed, no setup, just a URL.

How to do:

  1. Create a new workflow
    Open your n8n editor and click + New Workflow in the top left. Name it T1-B4-Switch-Demo (or any name you like). This keeps your workspace organized, especially as you build more workflows in this n8n tutorial series.
  2. Add a Manual Trigger node
    Click the + button on the canvas to add your first node. Search for Manual Trigger and select it. This lets you run the workflow on demand while you're testing — no schedule needed yet.
  3. Add the HTTP Request node
    Click the + button after the Manual Trigger. Search for HTTP Request and add it. Rename this node to Get 60 Todos so it's clear what it does at a glance.
  4. Configure the HTTP Request node
    In the node settings, set the Method to GET. In the URL field, enter:
    https://jsonplaceholder.typicode.com/todos?_limit=60
    The _limit=60 parameter tells the API to return 60 items. Click Execute Node to test it. You should see 60 items come back, each with fields like userId, id, title, and completed. If you see data in the output panel, the connection is working perfectly.
  5. Check the output data
    Look at the output in the right panel. You'll notice the 60 items have userId values of 1, 2, and 3 — 20 items each. This is exactly what we'll use in the next step to route items by team. Understanding your data shape here is key before you connect any more nodes in your n8n workflow automation.
  6. Add a Switch node to route by userId
    Click + after the HTTP Request node. Add a Switch node and rename it Route by userId. In the settings, set the Value to {{ $json.userId }} using the expression editor. Add 3 rules:
    — Rule 1: Number, equal to 1
    — Rule 2: Number, equal to 2
    — Rule 3: Number, equal to 3
    This splits your 60 items into 3 separate output branches, 20 items each. The Switch node is perfect when you have more than 2 routing conditions — more flexible than a plain IF node.
  7. Add a Set node to each branch
    Connect a Set node to each of the 3 Switch outputs. Name them:
    Label Marketing (add field: team = Marketing)
    Label Kỹ thuật (add field: team = Kỹ thuật)
    Label Sales (add field: team = Sales)
    Important: In each Set node, make sure Include Other Input Fields is set to All — not Selected. If you leave it on Selected and only tick one field, you will lose the id, title, and completed fields. This is a real bug that came up during testing — the downstream Code node returned undefined for those fields until this was fixed. Set it to All and the problem disappears.
  8. Add a Merge node to combine all branches
    After the three Set nodes, add a Merge node. Rename it Combine All Teams. Set the Mode to Append and Number of Inputs to 3. Connect the outputs of Label Marketing, Label Kỹ thuật, and Label Sales into the three inputs of this Merge node. When you execute, you'll get all 60 items back in one stream — 20 Marketing, then 20 Kỹ thuật, then 20 Sales, joined in sequence.
  9. Add a Code node to build a description field
    Add a Code node after the Merge. Rename it Build Description. Set the mode to Run Once for Each Item and the language to JavaScript. Paste in this code:

    const item = $input.item.json;
    const desc = `[${item.team.toUpperCase()}] #${item.id} - ${item.title} (${item.status || 'N/A'})`;
    return { json: { ...item, description: desc } };

    This creates a clean description field for each item, like: [MARKETING] #3 - fugiat veniam minus (N/A). Execute the node and check the output — every item should now have the new description field alongside all the original fields.
  10. Test the Fallback behavior (optional but useful)
    Go back to the HTTP Request node and change _limit=60 to _limit=100. Execute the workflow again. The extra 40 items (userId 4 and 5) don't match any Switch rule, so they fall into the Fallback output. This shows you how Switch handles unexpected data in real n8n workflow automation — always add a Fallback handler when your data might include values you haven't planned for.
  11. Save your workflow
    Click Save in the top right. Your n8n HTTP Request node workflow is now complete and ready to extend with real APIs, credentials, or additional processing nodes.

Tips From Real Testing

A few things worth knowing from hands-on experience with this n8n tutorial:

The "Include Other Input Fields" bug: When using a Set node, the default setting may only pass through fields you explicitly select. Always double-check this is set to All if you need to keep the original data intact. Losing fields silently is one of the most confusing bugs for beginners in n8n workflow automation.

Switch vs IF: Use an IF node when you have two paths — true or false. Use a Switch node when you have three or more conditions. In this example, routing by userId 1, 2, and 3 is a perfect Switch use case.

Query parameters in URLs: You can add them directly in the URL field (like ?_limit=60) or use the Query Parameters section in the node settings. Both work — the settings section is cleaner when you have multiple parameters.

The JavaScript string concatenation bug: If you ever write 30 + 10 in an n8n expression and get 3010 instead of 40, it's because one value is a string. Wrap it with Number() to fix it — for example, Number($json.score) + 10. This came up during expression testing and is easy to miss.

Where to Go Next in This n8n Tutorial Series

Now that you can pull data from any API using the n8n HTTP Request node, the next steps in this n8n workflow automation series cover real-world API authentication (headers, bearer tokens), the Schedule Trigger for running workflows automatically, and connecting AI models like Gemini, Claude, and OpenAI directly into your automation pipelines.

If you want to try connecting a real API, any service with a REST API and a key works the same way — just add the key as a credential in n8n and reference it in the HTTP Request node's Authentication section. The pattern you learned here scales to any API you'll ever need.

Conclusion:

The n8n HTTP Request node is the backbone of almost every n8n workflow automation you'll build — it connects your workflows to the outside world with just a URL and a few settings. Follow the steps above and you'll have real API data flowing through your n8n tutorial projects in minutes.

If you have any questions, feel free to leave a comment below. Thank you!

Tags: n8n tutorial, n8n workflow automation, n8n HTTP request node, n8n beginner guide, n8n Switch node, n8n Merge node, n8n Code node, REST API automation

Maybe you are interested!