{ "meta": { "instanceId": "workflow-7c328dd0", "versionId": "1.0.0", "createdAt": "2025-09-29T07:08:00.776874", "updatedAt": "2025-09-29T07:08:00.776889", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "Automate Drive-To-Store Lead Generation System (with coupon) on SuiteCRM", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "53342c2a-f707-4ed0-9054-7928e6832745", "name": "Token SuiteCRM", "type": "n8n-nodes-base.httpRequest", "position": [ 1560, 920 ], "parameters": { "url": "{{ $env.BASE_URL }}", "options": {}, "requestMethod": "POST", "bodyParametersUi": { "parameter": [ { "name": "grant_type", "value": "client_credentials" }, { "name": "client_id", "value": "CLIENTID" }, { "name": "client_secret", "value": "CLIENTSECRET" } ] }, "allowUnauthorizedCerts": true }, "notesInFlow": true, "typeVersion": 1, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "18d04094-1ced-4431-9ba2-b9b33d76c453", "name": "Create Lead SuiteCRM", "type": "n8n-nodes-base.httpRequest", "position": [ 1800, 920 ], "parameters": { "url": "{{ $env.API_BASE_URL }}", "method": "POST", "options": { "response": { "response": { "responseFormat": "json" } } }, "jsonBody": "={\"data\": \n {\n \"type\": \"Leads\",\n \"attributes\": { \n \"first_name\": \"{{ $('Form Fields').item.json.Name }}\",\n \"last_name\": \"{{ $('Form Fields').item.json.Surname }}\",\n \"email1\": \"{{ $('Form Fields').item.json.Email }}\",\n \"phone_mobile\":\"{{ $('Form Fields').item.json.Phone }}\",\n \"coupon_c\": \"{{ $('Get Coupon').item.json.COUPON }}\"\n }\n }\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "headerParameters": { "parameters": [ { "name": "Authorization", "value": "=Bearer {{$node[\"Token SuiteCRM\"].json[\"access_token\"]}}" }, { "name": "Content-Type", "value": "application/vnd.api+json" } ] } }, "notesInFlow": true, "typeVersion": 3, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "59b9c124-f6eb-457d-b3cb-2c831b66db85", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 440, 1020 ], "webhookId": "4b98315d-782e-47a5-8fea-7d16155c811d", "parameters": { "path": "4b98315d-782e-47a5-8fea-7d16155c811d", "options": {}, "httpMethod": "POST" }, "typeVersion": 2, "notes": "This webhook node performs automated tasks as part of the workflow." }, { "id": "75d6f561-754d-4153-8a85-12cb135a555c", "name": "On form submission", "type": "n8n-nodes-base.formTrigger", "position": [ 440, 820 ], "webhookId": "63d1d84b-c41e-4d3d-961a-0aa2af830ceb", "parameters": { "options": {}, "formTitle": "Landing", "formFields": { "values": [ { "fieldLabel": "Name", "placeholder": "Name", "requiredField": true }, { "fieldLabel": "Surname", "placeholder": "Surname", "requiredField": true }, { "fieldType": "email", "fieldLabel": "Email", "placeholder": "Email", "requiredField": true }, { "fieldLabel": "Phone", "placeholder": "Phone", "requiredField": true } ] } }, "typeVersion": 2.2, "notes": "This formTrigger node performs automated tasks as part of the workflow." }, { "id": "e9eac3a2-0351-4457-ae1d-44d42974ab20", "name": "Duplicate Lead?", "type": "n8n-nodes-base.googleSheets", "position": [ 880, 820 ], "parameters": { "options": {}, "filtersUI": { "values": [ { "lookupValue": "={{ $json.Email }}", "lookupColumn": "EMAIL" } ] }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Foglio1" }, "documentId": { "__rl": true, "mode": "list", "value": "1lnRZodxZSOA0QSuzkAb7ZJcfFfNXpX7NcxMdckMTN90", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Coupon" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "JYR6a64Qecd6t8Hb", "name": "Google Sheets account" } }, "typeVersion": 4.5, "alwaysOutputData": true, "notes": "This googleSheets node performs automated tasks as part of the workflow." }, { "id": "a5ae5f5a-7028-495b-ad27-192561ce88d5", "name": "Form Fields", "type": "n8n-nodes-base.set", "position": [ 680, 820 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "661d1475-f964-4a12-bfe7-88bf96851319", "name": "Name", "type": "string", "value": "={{ $json.Name }}" }, { "id": "9991645d-c716-47db-80d6-850f3d64c782", "name": "Surname", "type": "string", "value": "={{ $json.Surname }}" }, { "id": "c999afa6-2ec7-4f7f-bf3b-088a3597591c", "name": "Email", "type": "string", "value": "={{ $json.Email }}" }, { "id": "f3faccdb-2412-4363-a0e3-f13b8f85b242", "name": "Phone", "type": "string", "value": "={{ $json.Phone }}" } ] } }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "9edb0d07-b4fb-42f8-9555-1d3caf8998c7", "name": "Get Coupon", "type": "n8n-nodes-base.googleSheets", "position": [ 1340, 920 ], "parameters": { "options": { "returnFirstMatch": true }, "filtersUI": { "values": [ { "lookupColumn": "ID LEAD" } ] }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Foglio1" }, "documentId": { "__rl": true, "mode": "list", "value": "1lnRZodxZSOA0QSuzkAb7ZJcfFfNXpX7NcxMdckMTN90", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Coupon" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "JYR6a64Qecd6t8Hb", "name": "Google Sheets account" } }, "executeOnce": false, "typeVersion": 4.5, "notes": "This googleSheets node performs automated tasks as part of the workflow." }, { "id": "9469dd95-04ac-4c74-abb3-674fec277f6e", "name": "Respond OK", "type": "n8n-nodes-base.respondToWebhook", "position": [ 2300, 920 ], "parameters": { "options": { "responseCode": 200 }, "respondWith": "json", "responseBody": "{\n \"result\": \"OK\",\n \"reason\": \"lead created\"\n}" }, "typeVersion": 1.1, "notes": "This respondToWebhook node performs automated tasks as part of the workflow." }, { "id": "5b81c406-d70b-4a36-b4f4-8941373958b9", "name": "Respond KO", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1320, 700 ], "parameters": { "options": { "responseCode": 200 }, "respondWith": "json", "responseBody": "{\n \"result\": \"KO\",\n \"reason\": \"duplicate lead\"\n}" }, "typeVersion": 1.1, "notes": "This respondToWebhook node performs automated tasks as part of the workflow." }, { "id": "5fdf0eca-d1f6-4c9e-8e77-84d8e71bdb0e", "name": "Is Duplicate?", "type": "n8n-nodes-base.if", "position": [ 1080, 820 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9e3a8422-14f1-453e-bfed-4feecff34662", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.EMAIL }}", "rightValue": "={{ $('Form Fields').item.json.email }}" } ] } }, "typeVersion": 2.2, "notes": "This if node performs automated tasks as part of the workflow." }, { "id": "e9cba682-bf5b-4efa-9d10-4fab5d02610a", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 420, 20 ], "parameters": { "color": 3, "width": 540, "height": 380, "content": "## STEP 1\n\nCreate a Google Sheet like this (Fill only the column \"COUPON\")\n\n[![2mXGVwB.md.png]({{ $env.WEBHOOK_URL }}]\n\nThis is the basic Google Sheet used in [this Workflow]({{ $env.WEBHOOK_URL }}\n\n" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "1c304620-368d-42bf-b0d2-de3f9d552e51", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 420, 440 ], "parameters": { "color": 4, "width": 540, "height": 260, "content": "## STEP 2 - MAIN FLOW\n\nThis workflow is ideal for businesses looking to automate lead generation and management, especially when integrating with CRM systems like SuiteCRM and using Google Sheets for data tracking.\n\nIf you use an external form, hook the webbook trigger and the two webhooks \"Respond KO\" and \"Respond OK\" to the workflow.\n\nIt works with SuiteCRM 7.14.x and 8.x version. Remeber to create a Lead custom fields called 'coupon' on SuiteCRM." }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "6248c920-02f4-4407-881a-376d2a9dd904", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 660, 740 ], "parameters": { "width": 340, "height": 240, "content": "Check if the lead has already received the coupon" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "0c07d1b7-b12f-4cf7-8d0c-1dd905365534", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1300, 860 ], "parameters": { "width": 180, "height": 220, "content": "Find the first available unassigned coupon" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "34167626-9041-4cce-baaf-e1ed2efe8378", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1540, 700 ], "parameters": { "width": 400, "height": 380, "content": "Enter the lead with the relative coupon on Suite CRM. Change SUITECRMURL, CLIENTSECRET and CLIENTID\n\nTo create the CLIENTSECRET and CLIEDID go to Admin -> Oauth2 Client and Token -> and click on \"New CLient Credentials Client\" \n\nFor the full tutorial step-by-step [here the official SuiteCRM Docs]({{ $env.API_BASE_URL }}" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "50f65f6b-8045-4cb1-9e3d-489f27cdb038", "name": "Update Lead", "type": "n8n-nodes-base.googleSheets", "position": [ 2040, 920 ], "parameters": { "columns": { "value": { "DATE": "={{ $now.format('dd/LL/yyyy HH:mm:ss') }}", "NAME": "={{ $json.data.attributes.first_name }}", "EMAIL": "={{ $json.data.attributes.email1 }}", "PHONE": "={{ $json.data.attributes.phone_mobile }}", "COUPON": "={{ $('Get Coupon').item.json.COUPON }}", "ID LEAD": "={{ $json.data.id }}", "SURNAME": "={{ $json.data.attributes.last_name }}" }, "schema": [ { "id": "NAME", "type": "string", "display": true, "required": false, "displayName": "NAME", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "SURNAME", "type": "string", "display": true, "required": false, "displayName": "SURNAME", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "EMAIL", "type": "string", "display": true, "required": false, "displayName": "EMAIL", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "PHONE", "type": "string", "display": true, "required": false, "displayName": "PHONE", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "COUPON", "type": "string", "display": true, "removed": false, "required": false, "displayName": "COUPON", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "DATE", "type": "string", "display": true, "required": false, "displayName": "DATE", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "ID LEAD", "type": "string", "display": true, "required": false, "displayName": "ID LEAD", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "row_number", "type": "string", "display": true, "removed": true, "readOnly": true, "required": false, "displayName": "row_number", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [ "COUPON" ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {}, "operation": "update", "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Foglio1" }, "documentId": { "__rl": true, "mode": "list", "value": "1lnRZodxZSOA0QSuzkAb7ZJcfFfNXpX7NcxMdckMTN90", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Coupon" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "JYR6a64Qecd6t8Hb", "name": "Google Sheets account" } }, "typeVersion": 4.5, "notes": "This googleSheets node performs automated tasks as part of the workflow." } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "", "connections": { "53342c2a-f707-4ed0-9054-7928e6832745": { "main": [ [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-1163e069", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-ca4fc643", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-f8533f1b", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-700ef447", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-d4c8e1d9", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-5482a9cd", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-4173c8d9", "type": "main", "index": 0 } ], [ { "node": "error-handler-53342c2a-f707-4ed0-9054-7928e6832745-12f073ed", "type": "main", "index": 0 } ] ] }, "18d04094-1ced-4431-9ba2-b9b33d76c453": { "main": [ [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-4e682188", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-93f52114", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-687e0f73", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-28e9896d", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-069439db", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-b4ae687f", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-89ceaa50", "type": "main", "index": 0 } ], [ { "node": "error-handler-18d04094-1ced-4431-9ba2-b9b33d76c453-6b75e128", "type": "main", "index": 0 } ] ] }, "59b9c124-f6eb-457d-b3cb-2c831b66db85": { "main": [ [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-6780ac7c", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-ad4c1cca", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-3de86c93", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-d57fb1d2", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-badaa02e", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-4c4b6794", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-59bb7417", "type": "main", "index": 0 } ], [ { "node": "error-handler-59b9c124-f6eb-457d-b3cb-2c831b66db85-49c50f90", "type": "main", "index": 0 } ] ] }, "9469dd95-04ac-4c74-abb3-674fec277f6e": { "main": [ [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-421683f7", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-837f17d0", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-fa34259c", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-95c24958", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-11973369", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-f5172c13", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-766c8800", "type": "main", "index": 0 } ], [ { "node": "error-handler-9469dd95-04ac-4c74-abb3-674fec277f6e-9dbdbd32", "type": "main", "index": 0 } ] ] }, "5b81c406-d70b-4a36-b4f4-8941373958b9": { "main": [ [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-5193f8b7", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-b7ca26e6", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-ccc2486a", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-0682c696", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-cd187988", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-740f9148", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-dd26b05b", "type": "main", "index": 0 } ], [ { "node": "error-handler-5b81c406-d70b-4a36-b4f4-8941373958b9-98a65544", "type": "main", "index": 0 } ] ] }, "e9eac3a2-0351-4457-ae1d-44d42974ab20": { "main": [ [ { "node": "error-handler-e9eac3a2-0351-4457-ae1d-44d42974ab20-3277cc1f", "type": "main", "index": 0 } ] ] }, "9edb0d07-b4fb-42f8-9555-1d3caf8998c7": { "main": [ [ { "node": "error-handler-9edb0d07-b4fb-42f8-9555-1d3caf8998c7-6e33165d", "type": "main", "index": 0 } ] ] }, "50f65f6b-8045-4cb1-9e3d-489f27cdb038": { "main": [ [ { "node": "error-handler-50f65f6b-8045-4cb1-9e3d-489f27cdb038-6ae2314b", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: Automate Drive-To-Store Lead Generation System (with coupon) on SuiteCRM. This workflow integrates 9 different services: webhook, stickyNote, httpRequest, formTrigger, set. It contains 29 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Automate Drive-To-Store Lead Generation System (with coupon) on SuiteCRM. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }