API Endpoint for On-Demand QR Code Generation - n8n Workflow

Create a seamless API endpoint using n8n to generate QR codes instantly from requested data. Leverage the HTTP Request n8n node for powerful external integrations.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers who need a simple, self-hosted QR code generation API.
Users looking to build utility microservices using n8n templates.
Automation specialists needing to understand how to link an n8n trigger to an external API and return the result.
Businesses requiring dynamic, automated QR code creation for inventory or links.

Overview

This robust n8n workflow provides a complete solution for creating an instant QR code generation service. Instead of relying on proprietary software, you deploy this reusable n8n template to create a secure, high-speed endpoint. The main value is its ability to accept arbitrary input (like URLs or text) via a standard POST request and immediately relay the generated QR code image back to the caller. Understanding the relationship between the n8n trigger and the final webhook response is key to mastering advanced n8n automation, making this a perfect starting point for building custom API utilities.

How it Works

This automation follows a precise three-step process initiated by an external system calling your custom endpoint:


  1. Webhook Activation (n8n trigger): The workflow starts with the Receive Data Webhook n8n trigger, which listens for incoming POST requests on the configured path (/generate-qr). It expects the data to be encoded in the QR code within the request body (e.g., {"data": "your_url"}).

  2. QR Code Generation (HTTP Request n8n node): The workflow then passes the extracted data ($json.body.data) to the Generate QR Code n8n node. This node executes an HTTP GET request to the public QR Server API. This external API handles the image creation based on the provided data and size parameters.

  3. Response Delivery: Finally, the Respond with QR Code n8n node takes the raw image data (or the resulting response) received from the QR Server API and sends it directly back as the response to the initial webhook caller. This completes the request-response cycle of this specific n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code provided and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Activate Webhook: Locate the Receive Data Webhook n8n node. Note the unique test URL provided in the settings. When running live, ensure your n8n instance is publicly accessible.

  3. Configure Data Path: The Generate QR Code n8n node uses the expression {{ $json.body.data }}. Ensure the application calling your webhook sends the data you want to encode under the JSON key data.

  4. Save and Activate: Save the n8n workflow and toggle the 'Active' switch. Your custom QR generation API endpoint is now live.

Node Details

Receive Data Webhook (n8n trigger):
Function: Serves as the primary n8n trigger, initiating the workflow upon receiving an external POST request.
Key Configuration: Configured to respond using a dedicated RespondToWebhook n8n node later in the flow (responseMode: responseNode). Uses the path /generate-qr.
Generate QR Code (HTTP Request n8n node):
Function: Interfaces with the external QR Server API to create the image data.
Key Configuration: Uses a dynamic URL expression: https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ $json.body.data }}. This demonstrates how this n8n node dynamically injects payload data into a URL parameter.
Respond with QR Code (Respond to Webhook n8n node):
Function: Closes the API loop by sending the output of the previous n8n node (the QR code image) back to the client that called the initial n8n trigger.
* Key Configuration: Set to respond with allIncomingItems, ensuring the raw image data payload is returned without modification.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by
ist00dent
ist00dent

I’m a dedicated automation engineer passionate about no-code and low-code solutions. I design and implement robust n8n workflows—integrating APIs, databases, and messaging—to eliminate manual tasks and accelerate delivery. Leveraging Python and C#, I build scalable, adaptable automations that empower teams to focus on high-value work.

Featured*