Unique QR Coupon Assignment and Validation System for SuiteCRM - n8n Workflow

Use this robust n8n workflow to automate lead generation, assign unique QR code coupons, track usage in Google Sheets, and update lead status in SuiteCRM. Get started with n8n templates today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Marketing managers running QR-based coupon campaigns.

  • Businesses using SuiteCRM for customer relationship management.

  • Developers looking for advanced n8n templates for multi-stage automation.

  • Anyone needing a reliable n8n workflow to handle lead duplication checks and unique asset management.

Overview

Managing unique coupon distribution manually is error-prone and slow. This powerful n8n workflow solves this by providing a complete, automated solution for lead acquisition and coupon tracking. It integrates a landing page form, uses Google Sheets as a temporary database for coupon pool management and duplicate checking, and leverages SuiteCRM for lead storage and status updates. This specific n8n workflow ensures that every new, non-duplicate lead receives a unique, trackable QR code coupon, which can then be validated instantly by scanning, making the entire process efficient and secure. Utilizing this n8n automation eliminates manual data entry and provides instant feedback on coupon usage.

How it Works

The n8n workflow operates in two main distinct branches:

Branch 1: Lead Acquisition and Coupon Assignment


  1. The flow starts with the On form submission n8n trigger node when a user fills out a lead capture form (Name, Email, Phone).

  2. The data is captured and set via the Form Fields n8n node.

  3. The Duplicate Lead? Google Sheets n8n node checks if the lead's email already exists in the Coupon spreadsheet.

  4. The Is Duplicate? n8n node conditionally routes the flow. If the lead is new (not a duplicate), the workflow proceeds.

  5. The Get Coupon Google Sheets n8n node finds the first available coupon marked as unassigned (e.g., where 'ID LEAD' is empty).

  6. Token SuiteCRM obtains an OAuth token necessary for API access.

  7. The Create Lead SuiteCRM n8n node registers the new lead, including the unique assigned coupon code, in the CRM.

  8. Update Sheet updates the Google Sheet row with the new lead's details and the assigned SuiteCRM Lead ID.

  9. Get QR generates a unique QR code image URL that embeds a validation webhook URL plus the unique coupon ID as a query parameter.

  10. Send Email delivers the customized email containing the QR code and discount information to the user.

Branch 2: Coupon Validation via QR Scan


  1. This branch is initiated by a dedicated Webhook n8n trigger when the QR code is scanned (sending the coupon ID in the query parameters).

  2. Set coupon extracts the coupon ID (qr) from the URL query parameters.

  3. The subsequent If n8n node checks if a coupon value was received. If not, the flow responds with 'Coupon not valid'.

  4. If valid, Get Lead looks up the coupon in the Google Sheet.

  5. The Not used? n8n node checks the 'USED COUPON?' column. If the coupon is currently unused:

Token SuiteCRM 1 retrieves the necessary token.
Update Lead patches the corresponding lead in SuiteCRM, setting a custom field like couponusedc to 'yes'.
Update coupon used updates the Google Sheet record.
Coupon OK responds to the user/system that the QR is valid.

  1. If the coupon was already used, Coupon KO responds that the coupon is already redeemed.

Installation Guide

To set up this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' button -> 'Import from JSON'.

  2. Google Sheets Setup: You need a Google Sheet set up with a list of coupons. Ensure columns include COUPON, EMAIL, ID LEAD, and USED COUPON?. Create a Google Sheets OAuth2 API credential in n8n and link it to the 'Duplicate Lead?', 'Get Coupon', 'Update Sheet', 'Get Lead', and 'Update coupon used' n8n nodes.

  3. SuiteCRM Setup: Configure two HTTP Request Credentials for SuiteCRM (used by 'Token SuiteCRM' and 'Token SuiteCRM 1'). You must replace the placeholders SUITECRMURL, CLIENTID, and CLIENTSECRET in the URL and body parameters of all SuiteCRM-related n8n nodes.

  4. Form Trigger: The On form submission n8n trigger is used for lead capture. After activating the n8n workflow, you will receive a unique form URL to embed or link to.

  5. Webhook Trigger: The main Webhook n8n trigger URL must be copied and used in the QR code generation step (Get QR and Send Email nodes) to ensure the QR code links back to the validation flow. Update the EMAILFROM value in the 'Send Email' n8n node and set up your SMTP credentials for email delivery.

Node Details

On form submission (n8n trigger): Initiates the flow when a new lead fills out the embedded landing page form. Collects essential lead data (Name, Email, Phone).
Duplicate Lead? (Google Sheets n8n node): Performs a read operation on the Google Sheet, filtering by the submitted email address to check for previous entries.
Get Coupon (Google Sheets n8n node): Reads the sheet to find the first row where the 'ID LEAD' column is empty, effectively securing the next available unique coupon.
Token SuiteCRM & Token SuiteCRM 1 (HTTP Request n8n node): Handles the API authentication process for SuiteCRM, securing an access token required for creating and updating lead records.
Create Lead SuiteCRM (HTTP Request n8n node): Posts the new lead data, along with the assigned unique coupon, to the SuiteCRM API.
Update Sheet (Google Sheets n8n node): Updates the coupon spreadsheet row, marking the specific coupon as assigned to the new lead.
Webhook (n8n trigger): Serves as the validation endpoint. This n8n trigger is activated when the generated QR code is scanned, passing the unique coupon ID as a query parameter.
Get Lead (Google Sheets n8n node): Looks up the scanned coupon ID to retrieve the associated lead and usage status data.
Update Lead (HTTP Request n8n node): Uses a PATCH request to set the couponusedc field in the SuiteCRM Lead record to 'yes' after successful validation.
If / Not used? (If n8n node): Crucial flow control nodes that check for required parameters (QR code existence) and coupon usage status before proceeding with CRM updates or providing a validation response.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*