This workflow corresponds to n8n.io template #15692 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "lUVCkyA3cdjv5s4x",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Autonomous Vendor Onboarding Agent (Agent Q) v2",
"tags": [],
"nodes": [
{
"id": "84d334ea-09cf-410a-8d97-face74cf4e15",
"name": "\ud83e\udde0 Agent Q \u2014 MCTS: Map Vendor Portal Wizard Steps",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1168,
2464
],
"parameters": {
"text": "=You are Agent Q \u2014 an expert vendor onboarding orchestrator using MCTS (Monte Carlo Tree Search) reasoning.\n\nMap ALL wizard steps needed to onboard this vendor on the procurement portal:\n\nVendor Name: {{ $('Extract Vendor Data1').item.json.vendorName }}\nGST Number: {{ $('Extract Vendor Data1').item.json.gstNumber }}\nPAN Number: {{ $('Extract Vendor Data1').item.json.panNumber }}\nBank: {{ $('Extract Vendor Data1').item.json.bankName }} | Account: {{ $('Extract Vendor Data1').item.json.bankAccount }} | IFSC: {{ $('Extract Vendor Data1').item.json.ifscCode }}\nContact: {{ $('Extract Vendor Data1').item.json.contactName }} | {{ $('Extract Vendor Data1').item.json.contactEmail }} | {{ $('Extract Vendor Data1').item.json.contactPhone }}\nAddress: {{ $('Extract Vendor Data1').item.json.address }}\nMSME Status: {{ $('Extract Vendor Data1').item.json.msmeStatus }}\nGST Document: Available in Google Drive\nPAN Document: Available in Google Drive\n\nUsing MCTS reasoning, explore all possible wizard paths and return the optimal onboarding sequence.\n\nRespond ONLY with a valid JSON object (no markdown, no extra text):\n{\n \"optimal_path\": [\"Account Creation\", \"Company Details\", \"Banking Details\", \"Document Upload\", \"Verification\"],\n \"step_details\": [\n {\n \"step_id\": \"step_1\",\n \"step_name\": \"Account Creation\",\n \"fields_to_fill\": [\"company_name\", \"contact_email\", \"contact_phone\"],\n \"documents_required\": [],\n \"validation_rules\": [\"email must be valid format\", \"phone must be 10 digits\"],\n \"risk_level\": \"low\",\n \"estimated_time_seconds\": 30\n }\n ],\n \"total_steps\": 5,\n \"risk_assessment\": \"Overall low risk. GST format and bank IFSC are the most likely rejection points.\"\n}",
"options": {
"systemMessage": "You are Agent Q \u2014 an autonomous vendor onboarding orchestrator. You use MCTS (Monte Carlo Tree Search) to map all wizard steps on a procurement portal before executing them. Your job is to:\n1. Analyse all possible wizard step sequences (MCTS tree exploration)\n2. Choose the optimal path that minimises errors and retries\n3. Flag high-risk fields that commonly cause portal rejections\n4. Return a clean, structured JSON plan that downstream agents will execute step by step\n\nAlways respond with pure JSON only \u2014 no markdown fences, no preamble, no commentary."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "53ad33b0-0b6e-49f1-8b1c-bb8f12c6e5f4",
"name": "\u26a1 LLM \u2014 GPT-4o (MCTS Planner)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1168,
2656
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {
"maxTokens": 2000,
"temperature": 0.2
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "c727c4dc-2687-4767-869e-ac7c945184d6",
"name": "\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-608,
2464
],
"parameters": {
"text": "=Perform pre-submission field validation for the current vendor portal wizard step.\n\nCurrent Step: {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}\nStep Index: {{ $('Parse MCTS Wizard Plan1').item.json.currentStepIndex + 1 }} of {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.total_steps }}\n\nVendor Data to Validate:\n- Company Name: {{ $('Extract Vendor Data1').item.json.vendorName }}\n- GST Number: {{ $('Extract Vendor Data1').item.json.gstNumber }}\n- PAN Number: {{ $('Extract Vendor Data1').item.json.panNumber }}\n- Bank Account: {{ $('Extract Vendor Data1').item.json.bankAccount }}\n- IFSC Code: {{ $('Extract Vendor Data1').item.json.ifscCode }}\n- Bank Name: {{ $('Extract Vendor Data1').item.json.bankName }}\n- Contact Email: {{ $('Extract Vendor Data1').item.json.contactEmail }}\n- Contact Phone: {{ $('Extract Vendor Data1').item.json.contactPhone }}\n- Address: {{ $('Extract Vendor Data1').item.json.address }}\n- MSME Status: {{ $('Extract Vendor Data1').item.json.msmeStatus }}\n\nValidation Rules:\n- GST format: 15 characters, pattern ^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$\n- PAN format: 10 characters, pattern ^[A-Z]{5}[0-9]{4}[A-Z]{1}$\n- IFSC format: 11 characters, pattern ^[A-Z]{4}0[A-Z0-9]{6}$\n- Bank account: 9-18 digits\n- Email: valid email format\n- Phone: 10 digits\n- No field for this step should be null or empty\n\nRespond ONLY with a valid JSON object (no markdown):\n{\n \"decision\": \"GO\",\n \"validation_results\": [\n { \"field\": \"gstNumber\", \"status\": \"PASS\", \"issue\": null }\n ],\n \"critical_issues\": [],\n \"warnings\": [],\n \"corrections_needed\": [],\n \"confidence_score\": 0.97,\n \"critique_summary\": \"All fields validated successfully. Ready to proceed.\"\n}",
"options": {
"systemMessage": "You are Agent Q's Self-Critique module \u2014 the quality gate before every wizard step submission.\n\nYour responsibilities:\n1. FORMAT COMPLIANCE \u2014 Validate GST (15 chars, correct pattern), PAN (10 chars), IFSC (11 chars), bank account (9-18 digits), email, phone\n2. CROSS-FIELD CONSISTENCY \u2014 Company name should match GST registration, MSME status should be consistent\n3. COMPLETENESS \u2014 No required field for this step can be null or empty\n4. BUSINESS RULES \u2014 Bank details complete set (account + IFSC + bank name), contact details complete\n5. RISK SCORING \u2014 Rate confidence 0.0 to 1.0\n\nDecision logic:\n- Return \"GO\" only when confidence_score >= 0.85 and critical_issues is empty\n- Return \"NO-GO\" when any critical issue exists or confidence_score < 0.85\n\nAlways respond with pure JSON only \u2014 no markdown, no preamble."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "a9abc0c3-1870-43a4-b9f4-770fab835bb3",
"name": "\u26a1 LLM \u2014 GPT-4o (Self-Critique)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-608,
2656
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {
"maxTokens": 1500,
"temperature": 0.1
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "24c0aff7-f619-4b25-8b48-99b1c6264d2f",
"name": "\ud83e\udd16 Agent Q \u2014 Execute Vendor Portal Wizard Step",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
208,
2304
],
"parameters": {
"text": "=Execute the following vendor portal wizard step with the validated data below.\n\nStep to Execute: {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}\nStep Number: {{ $('Parse MCTS Wizard Plan1').item.json.currentStepIndex + 1 }} of {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.total_steps }}\nValidation Confidence: {{ $('Parse Critique Result1').item.json.critiqueResult.confidence_score }}\n\nValidated Vendor Data:\n- Company Name: {{ $('Extract Vendor Data1').item.json.vendorName }}\n- GST Number: {{ $('Extract Vendor Data1').item.json.gstNumber }}\n- PAN Number: {{ $('Extract Vendor Data1').item.json.panNumber }}\n- Bank Account: {{ $('Extract Vendor Data1').item.json.bankAccount }}\n- IFSC Code: {{ $('Extract Vendor Data1').item.json.ifscCode }}\n- Bank Name: {{ $('Extract Vendor Data1').item.json.bankName }}\n- Contact Name: {{ $('Extract Vendor Data1').item.json.contactName }}\n- Contact Email: {{ $('Extract Vendor Data1').item.json.contactEmail }}\n- Contact Phone: {{ $('Extract Vendor Data1').item.json.contactPhone }}\n- Address: {{ $('Extract Vendor Data1').item.json.address }}\n- MSME Status: {{ $('Extract Vendor Data1').item.json.msmeStatus }}\nGST Document: Uploaded from Google Drive\nPAN Document: Uploaded from Google Drive\n\nSimulate executing this step on the vendor portal and return the result.\n\nRespond ONLY with a valid JSON object (no markdown):\n{\n \"step_executed\": \"Account Creation\",\n \"step_number\": 1,\n \"fields_submitted\": { \"company_name\": \"ABC Pvt Ltd\", \"email\": \"contact@abc.com\" },\n \"step_status\": \"success\",\n \"vendor_id\": \"VND-2026-00142\",\n \"portal_credentials\": { \"username\": \"contact@abc.com\", \"temp_password\": \"V3nd@r#2026\" },\n \"execution_timestamp\": \"2026-05-08T10:30:00Z\",\n \"next_step_hint\": \"Proceed to Company Details\"\n}",
"options": {
"systemMessage": "You are Agent Q's Execution module. You simulate the act of filling in and submitting a vendor portal wizard step.\n\nYour job:\n1. Take the validated vendor data and the step name\n2. Determine exactly which fields to fill for that step\n3. Format field values precisely as a portal would expect them\n4. Simulate a successful submission and return structured result\n5. If this is the Account Creation step, generate a realistic vendor_id (format: VND-YYYY-NNNNN) and portal credentials\n6. For all other steps, vendor_id and portal_credentials should reflect already-captured values or null\n\nReturn ONLY pure JSON \u2014 no markdown, no commentary."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "c6b9a213-4476-4b43-89d4-d243d34ff0df",
"name": "\u26a1 LLM \u2014 GPT-4o (Step Executor)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
208,
2496
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {
"maxTokens": 1000,
"temperature": 0.2
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "4098166c-b280-4022-9765-9d0b101af999",
"name": "\ud83d\udd04 Agent Q \u2014 DPO: Correct & Retry Failed Step",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
208,
2672
],
"parameters": {
"text": "=A vendor portal wizard step was rejected. Apply DPO (Direct Policy Optimization) to correct the issue and prepare for retry.\n\nFailed Step: {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}\nCurrent Retry Count: {{ $('Extract Vendor Data1').item.json.retryCount }}\nMax Retries Allowed: 3\n\nCritique Issues Identified:\n{{ JSON.stringify($('Parse Critique Result1').item.json.critiqueResult.critical_issues) }}\n\nCorrections Needed:\n{{ JSON.stringify($('Parse Critique Result1').item.json.critiqueResult.corrections_needed) }}\n\nOriginal Vendor Data:\n- Company Name: {{ $('Extract Vendor Data1').item.json.vendorName }}\n- GST: {{ $('Extract Vendor Data1').item.json.gstNumber }}\n- PAN: {{ $('Extract Vendor Data1').item.json.panNumber }}\n- Bank Account: {{ $('Extract Vendor Data1').item.json.bankAccount }}\n- IFSC: {{ $('Extract Vendor Data1').item.json.ifscCode }}\n- Email: {{ $('Extract Vendor Data1').item.json.contactEmail }}\n\nApply the minimum correction necessary to fix the rejection and retry ONLY this step (not previous steps).\n\nRespond ONLY with a valid JSON object (no markdown):\n{\n \"dpo_action\": \"retry\",\n \"corrected_fields\": [\n { \"field\": \"gstNumber\", \"old_value\": \"27AABCT3518Q1ZV\", \"new_value\": \"27AABCT3518Q1ZV\" }\n ],\n \"retry_step_only\": true,\n \"dpo_rationale\": \"Corrected GST number formatting \u2014 trailing character was lowercase, normalised to uppercase.\",\n \"estimated_success_probability\": 0.94,\n \"escalation_reason\": null\n}",
"options": {
"systemMessage": "You are Agent Q's DPO (Direct Policy Optimization) module \u2014 the error recovery engine.\n\nWhen a wizard step is rejected, your job is to:\n1. READ the rejection/critique reason carefully\n2. IDENTIFY the root cause (formatting issue, missing field, wrong value, document problem)\n3. APPLY the minimum targeted correction needed \u2014 do NOT change fields that are not causing the issue\n4. RETRY only the failed step \u2014 previously passed steps are NOT re-run\n5. ESTIMATE probability of success after correction\n6. ESCALATE (dpo_action: 'escalate') only if the error is unresolvable (e.g., fundamentally wrong PAN number, bank account does not exist)\n\nDPO principle: smallest correction \u2192 highest retry success rate.\n\nReturn ONLY pure JSON \u2014 no markdown, no preamble."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "716b6e3d-86b6-4aaa-b7a0-9a25601b23f8",
"name": "\u26a1 LLM \u2014 GPT-4o (DPO Corrector)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
208,
2880
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {
"maxTokens": 1000,
"temperature": 0.1
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "4397f566-aea2-4315-aba8-a818c8ad5297",
"name": "\u2753 Retry Allowed? (Max 3 Attempts)",
"type": "n8n-nodes-base.if",
"position": [
736,
2672
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "retry-limit-check",
"operator": {
"type": "number",
"operation": "lt"
},
"leftValue": "={{ $json.retryCount }}",
"rightValue": 3
},
{
"id": "dpo-action-check",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.dpoResult.dpo_action }}",
"rightValue": "retry"
}
]
}
},
"typeVersion": 2
},
{
"id": "f9f54536-ab24-4a70-bdce-79df1cf8a226",
"name": "\ud83d\udd0d Filter \u2014 Status = Approved Only",
"type": "n8n-nodes-base.filter",
"position": [
-1968,
2464
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "status-check",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.Status }}",
"rightValue": "Approved"
}
]
}
},
"typeVersion": 2
},
{
"id": "8390bb97-f86a-4efd-a19c-890d87025930",
"name": "\ud83d\udce6 Extract & Prepare Vendor Data",
"type": "n8n-nodes-base.set",
"position": [
-1712,
2464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a1",
"name": "vendorName",
"type": "string",
"value": "={{ $json['Company Name'] }}"
},
{
"id": "a2",
"name": "gstNumber",
"type": "string",
"value": "={{ $json['GST Number'] }}"
},
{
"id": "a3",
"name": "panNumber",
"type": "string",
"value": "={{ $json['PAN Number'] }}"
},
{
"id": "a4",
"name": "bankAccount",
"type": "string",
"value": "={{ $json['Bank Account Number'] }}"
},
{
"id": "a5",
"name": "ifscCode",
"type": "string",
"value": "={{ $json['IFSC Code'] }}"
},
{
"id": "a6",
"name": "bankName",
"type": "string",
"value": "={{ $json['Bank Name'] }}"
},
{
"id": "a7",
"name": "contactName",
"type": "string",
"value": "={{ $json['Contact Person'] }}"
},
{
"id": "a8",
"name": "contactEmail",
"type": "string",
"value": "={{ $json['Contact Email'] }}"
},
{
"id": "a9",
"name": "contactPhone",
"type": "string",
"value": "={{ $json['Contact Phone'] }}"
},
{
"id": "a10",
"name": "address",
"type": "string",
"value": "={{ $json['Registered Address'] }}"
},
{
"id": "a11",
"name": "msmeStatus",
"type": "string",
"value": "={{ $json['MSME Status'] }}"
},
{
"id": "a12",
"name": "gstDriveFileId",
"type": "string",
"value": "={{ $json['GST Certificate Drive ID'] }}"
},
{
"id": "a13",
"name": "panDriveFileId",
"type": "string",
"value": "={{ $json['PAN Card Drive ID'] }}"
},
{
"id": "a14",
"name": "sheetRowId",
"type": "number",
"value": "={{ $json['row_number'] }}"
},
{
"id": "a15",
"name": "onboardingStartTime",
"type": "string",
"value": "={{ new Date().toISOString() }}"
},
{
"id": "a16",
"name": "retryCount",
"type": "number",
"value": 0
},
{
"id": "a17",
"name": "currentStepIndex",
"type": "number",
"value": 0
},
{
"id": "a18",
"name": "capturedVendorId",
"type": "string",
"value": ""
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8b5c6172-a67b-4416-b81c-023b61d04aa9",
"name": "\ud83d\udcc1 Google Drive \u2014 Download GST Certificate",
"type": "n8n-nodes-base.googleDrive",
"position": [
-1456,
2320
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Extract Vendor Data1').item.json.gstDriveFileId }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "05c1def0-013f-4654-9551-b5103f7f4240",
"name": "\ud83d\udcc1 Google Drive \u2014 Download PAN Card",
"type": "n8n-nodes-base.googleDrive",
"position": [
-1456,
2592
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Extract Vendor Data1').item.json.panDriveFileId }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "b8ad9c59-d99f-4586-b93a-d1d4806632ab",
"name": "\ud83d\udcd0 Parse MCTS Wizard Plan",
"type": "n8n-nodes-base.set",
"position": [
-896,
2464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b1",
"name": "wizardPlan",
"type": "object",
"value": "={{ (() => { try { const txt = $json.output; return JSON.parse(txt); } catch(e) { return { optimal_path: ['Account Creation','Company Details','Banking Details','Document Upload','Verification'], total_steps: 5, step_details: [] }; } })() }}"
},
{
"id": "b2",
"name": "currentStepIndex",
"type": "number",
"value": 0
},
{
"id": "b3",
"name": "completedSteps",
"type": "array",
"value": "=[]"
},
{
"id": "b4",
"name": "failedSteps",
"type": "array",
"value": "=[]"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "653e375d-365f-4510-8485-efea0ae7fa3c",
"name": "\ud83d\udcdd Parse Self-Critique Result",
"type": "n8n-nodes-base.set",
"position": [
-304,
2464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c1",
"name": "critiqueResult",
"type": "object",
"value": "={{ (() => { try { return JSON.parse($json.output); } catch(e) { return { decision: 'NO-GO', critical_issues: ['Parse error'], corrections_needed: [], confidence_score: 0, critique_summary: 'Failed to parse critique' }; } })() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f2fe3918-187e-4e42-8c82-a686cf88f96e",
"name": "\u2753 GO or NO-GO? \u2014 Proceed or Escalate",
"type": "n8n-nodes-base.if",
"position": [
-64,
2464
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "go-check",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.critiqueResult.decision }}",
"rightValue": "GO"
}
]
}
},
"typeVersion": 2
},
{
"id": "3d0af528-95ce-44a5-b034-c974d98548ca",
"name": "\ud83d\udcca Parse Wizard Step Result",
"type": "n8n-nodes-base.set",
"position": [
464,
2304
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "d1",
"name": "stepResult",
"type": "object",
"value": "={{ (() => { try { return JSON.parse($json.output); } catch(e) { return { step_status: 'success', vendor_id: null, portal_credentials: null }; } })() }}"
},
{
"id": "d2",
"name": "capturedVendorId",
"type": "string",
"value": "={{ JSON.parse($json.output).vendor_id || $('Extract Vendor Data1').item.json.capturedVendorId || '' }}"
},
{
"id": "d3",
"name": "capturedCredentials",
"type": "object",
"value": "={{ (() => { try { return JSON.parse($json.output).portal_credentials || null; } catch(e) { return null; } })() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "94f6ad02-fef7-4ccd-acdf-25f9f0d2d06a",
"name": "\u2753 More Wizard Steps Remaining?",
"type": "n8n-nodes-base.if",
"position": [
736,
2304
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "more-steps",
"operator": {
"type": "number",
"operation": "lt"
},
"leftValue": "={{ $('Parse MCTS Wizard Plan1').item.json.currentStepIndex + 1 }}",
"rightValue": "={{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.total_steps }}"
}
]
}
},
"typeVersion": 2
},
{
"id": "9802306b-398b-49b8-b0f9-a4cc733b5bd1",
"name": "\ud83d\udd22 Increment Step Counter",
"type": "n8n-nodes-base.set",
"position": [
992,
2176
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e1",
"name": "currentStepIndex",
"type": "number",
"value": "={{ $('Parse MCTS Wizard Plan1').item.json.currentStepIndex + 1 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ea855c0a-0b92-4bdf-95eb-6bada77c6997",
"name": "\ud83d\udcdd Parse DPO Correction Output",
"type": "n8n-nodes-base.set",
"position": [
464,
2672
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f1",
"name": "dpoResult",
"type": "object",
"value": "={{ (() => { try { return JSON.parse($json.output); } catch(e) { return { dpo_action: 'escalate', escalation_reason: 'Parse error in DPO response' }; } })() }}"
},
{
"id": "f2",
"name": "retryCount",
"type": "number",
"value": "={{ $('Extract Vendor Data1').item.json.retryCount + 1 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b8c9322e-81bd-46e0-8d2d-80e3fab896fb",
"name": "\ud83d\udce7 Gmail \u2014 Send Vendor Welcome Email",
"type": "n8n-nodes-base.gmail",
"position": [
992,
2432
],
"parameters": {
"sendTo": "={{ $('Extract Vendor Data1').item.json.contactEmail }}",
"message": "=<!DOCTYPE html>\n<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background: #f5f5f5;\">\n <div style=\"background: #1a73e8; padding: 24px 30px; border-radius: 10px 10px 0 0;\">\n <h1 style=\"color: white; margin: 0; font-size: 24px;\">Welcome, {{ $('Extract Vendor Data1').item.json.contactName }}!</h1>\n <p style=\"color: #d0e4ff; margin: 8px 0 0;\">Your vendor account is live and ready.</p>\n </div>\n <div style=\"background: white; padding: 30px; border-radius: 0 0 10px 10px; border: 1px solid #e0e0e0;\">\n <p style=\"color: #333;\">Congratulations! <strong>{{ $('Extract Vendor Data1').item.json.vendorName }}</strong> has been successfully onboarded to our procurement portal.</p>\n <div style=\"background: #f0f7ff; padding: 20px; border-radius: 8px; border-left: 4px solid #1a73e8; margin: 20px 0;\">\n <h3 style=\"margin-top: 0; color: #1a73e8; font-size: 16px;\">\ud83d\udd10 Your Portal Credentials</h3>\n <p style=\"margin: 6px 0;\"><strong>Vendor ID:</strong> {{ $('Parse Step Result1').item.json.capturedVendorId }}</p>\n <p style=\"margin: 6px 0;\"><strong>Portal Username:</strong> {{ $('Extract Vendor Data1').item.json.contactEmail }}</p>\n <p style=\"margin: 6px 0;\"><strong>Temporary Password:</strong> <code style=\"background:#eee;padding:2px 6px;border-radius:3px;\">{{ $('Parse Step Result1').item.json.capturedCredentials.temp_password }}</code></p>\n </div>\n <p style=\"color: #e53935; font-size: 13px;\">\u26a0\ufe0f <strong>Important:</strong> Please change your password immediately upon first login.</p>\n <div style=\"background: #f9f9f9; padding: 16px; border-radius: 8px; margin: 16px 0;\">\n <h4 style=\"margin-top:0; color:#555;\">\ud83d\udccb Onboarding Summary</h4>\n <p style=\"margin: 4px 0; font-size: 13px;\">GST Registered: {{ $('Extract Vendor Data1').item.json.gstNumber }}</p>\n <p style=\"margin: 4px 0; font-size: 13px;\">Bank: {{ $('Extract Vendor Data1').item.json.bankName }}</p>\n <p style=\"margin: 4px 0; font-size: 13px;\">MSME Status: {{ $('Extract Vendor Data1').item.json.msmeStatus }}</p>\n </div>\n <p style=\"color:#555;\">You can now submit invoices, track payments, and manage your vendor profile through the portal.</p>\n <p style=\"color:#555;\">For assistance, contact our procurement team.</p>\n <p style=\"margin-top: 24px;\">Best regards,<br><strong>Procurement Team</strong></p>\n </div>\n</body>\n</html>",
"options": {},
"subject": "=Welcome to Our Vendor Portal \u2014 Your Credentials Are Ready, {{ $('Extract Vendor Data1').item.json.contactName }}!"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "1d4fab39-7a8d-49f1-aae4-53319369c50d",
"name": "\ud83d\udcca Google Sheets \u2014 Log Onboarding Status",
"type": "n8n-nodes-base.googleSheets",
"position": [
992,
2624
],
"parameters": {
"columns": {
"value": {
"Vendor ID": "={{ $('Parse Step Result1').item.json.capturedVendorId }}",
"row_number": "={{ $('Extract Vendor Data1').item.json.sheetRowId }}",
"Retry Count": "={{ $('Extract Vendor Data1').item.json.retryCount }}",
"Portal Username": "={{ $('Extract Vendor Data1').item.json.contactEmail }}",
"Onboarding Status": "Completed",
"Total Steps Completed": "={{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.total_steps }}",
"Onboarding Completion Time": "={{ new Date().toISOString() }}",
"Onboarding Duration (mins)": "={{ Math.round((new Date() - new Date($('Extract Vendor Data1').item.json.onboardingStartTime)) / 60000) }}"
},
"schema": [
{
"id": "row_number",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": true,
"displayName": "row_number",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "Onboarding Status",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Onboarding Status",
"defaultMatch": false,
"canBeUsedToMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
]
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Vendors"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "YOUR_GOOGLE_SHEET_ID"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "bb33df25-affa-4df1-ac55-14a5b45a097f",
"name": "\ud83d\udd14 Slack \u2014 Notify Procurement Team",
"type": "n8n-nodes-base.slack",
"position": [
1264,
2512
],
"parameters": {
"text": "=\u2705 *Vendor Onboarding Completed!*\n\n*Company:* {{ $('Extract Vendor Data1').item.json.vendorName }}\n*Vendor ID:* {{ $('Parse Step Result1').item.json.capturedVendorId }}\n*Contact:* {{ $('Extract Vendor Data1').item.json.contactName }} ({{ $('Extract Vendor Data1').item.json.contactEmail }})\n*GST:* {{ $('Extract Vendor Data1').item.json.gstNumber }}\n*Bank:* {{ $('Extract Vendor Data1').item.json.bankName }}\n*Steps Completed:* {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.total_steps }}\n*Retries Used:* {{ $('Extract Vendor Data1').item.json.retryCount }}\n*Duration:* {{ Math.round((new Date() - new Date($('Extract Vendor Data1').item.json.onboardingStartTime)) / 60000) }} minutes\n*Credentials Sent To:* {{ $('Extract Vendor Data1').item.json.contactEmail }}\n\n\ud83e\udd16 _Completed autonomously by Agent Q (MCTS + Self-Critique + DPO)_",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "name",
"value": "YOUR_SLACK_CHANNEL_ID"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "7385316a-b508-4267-8cbf-acdbe57641f6",
"name": "\ud83d\udea8 Gmail \u2014 Send Escalation Alert",
"type": "n8n-nodes-base.gmail",
"position": [
992,
2816
],
"parameters": {
"sendTo": "user@example.com",
"message": "=<!DOCTYPE html>\n<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;\">\n <div style=\"background: #e53935; padding: 24px 30px; border-radius: 10px 10px 0 0;\">\n <h1 style=\"color: white; margin: 0; font-size: 22px;\">\u26a0\ufe0f Escalation Required</h1>\n <p style=\"color: #ffcdd2; margin: 6px 0 0;\">Agent Q could not complete onboarding automatically.</p>\n </div>\n <div style=\"background: white; padding: 30px; border-radius: 0 0 10px 10px; border: 1px solid #e0e0e0;\">\n <p>Agent Q has exhausted all retry attempts. Manual intervention is required.</p>\n <div style=\"background: #fff3f3; padding: 20px; border-radius: 8px; border-left: 4px solid #e53935; margin: 20px 0;\">\n <h3 style=\"margin-top: 0; color: #e53935;\">Escalation Details</h3>\n <p><strong>Vendor:</strong> {{ $('Extract Vendor Data1').item.json.vendorName }}</p>\n <p><strong>GST:</strong> {{ $('Extract Vendor Data1').item.json.gstNumber }}</p>\n <p><strong>PAN:</strong> {{ $('Extract Vendor Data1').item.json.panNumber }}</p>\n <p><strong>Failed Step:</strong> {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}</p>\n <p><strong>Total Retries:</strong> {{ $('Parse DPO Correction1').item.json.retryCount }} / 3</p>\n <p><strong>DPO Escalation Reason:</strong> {{ $('Parse DPO Correction1').item.json.dpoResult.escalation_reason }}</p>\n </div>\n <p>Please review the vendor data in Google Sheets and complete onboarding manually.</p>\n </div>\n</body>\n</html>",
"options": {},
"subject": "=\u26a0\ufe0f Vendor Onboarding Escalation: {{ $('Extract Vendor Data1').item.json.vendorName }} \u2014 Manual Review Required"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "44f3cd64-63db-4b71-ad0c-ab01861bab79",
"name": "\ud83d\udea8 Slack \u2014 Send Escalation Alert",
"type": "n8n-nodes-base.slack",
"position": [
1264,
2912
],
"parameters": {
"text": "=\ud83d\udea8 *Vendor Onboarding ESCALATION!*\n\n*Company:* {{ $('Extract Vendor Data1').item.json.vendorName }}\n*GST:* {{ $('Extract Vendor Data1').item.json.gstNumber }}\n*Failed Step:* {{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}\n*Retries Exhausted:* {{ $('Parse DPO Correction1').item.json.retryCount }}/3\n*Reason:* {{ $('Parse DPO Correction1').item.json.dpoResult.escalation_reason }}\n\n\ud83d\udccb _Row updated in Google Sheets. Manual intervention required._",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "name",
"value": "YOUR_SLACK_CHANNEL_ID"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "b7cb2475-fa05-4af5-b8f5-6518731daeb4",
"name": "\ud83d\udccb Google Sheets \u2014 Log Escalation Record",
"type": "n8n-nodes-base.googleSheets",
"position": [
1520,
2816
],
"parameters": {
"columns": {
"value": {
"row_number": "={{ $('Extract Vendor Data1').item.json.sheetRowId }}",
"Failed Step": "={{ $('Parse MCTS Wizard Plan1').item.json.wizardPlan.optimal_path[$('Parse MCTS Wizard Plan1').item.json.currentStepIndex] }}",
"Retry Count": "={{ $('Parse DPO Correction1').item.json.retryCount }}",
"Escalation Reason": "={{ $('Parse DPO Correction1').item.json.dpoResult.escalation_reason }}",
"Onboarding Status": "Escalated \u2014 Manual Review Required"
},
"schema": [
{
"id": "row_number",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": true,
"displayName": "row_number",
"defaultMatch": true,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
]
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Vendors"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "YOUR_GOOGLE_SHEET_ID"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "a2d1bd30-9772-4fe8-9639-a9b3acfd596e",
"name": "\ud83d\udccb Trigger \u2014 Vendor Approved in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-2240,
2480
],
"parameters": {
"event": "rowAdded",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 358936068,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fiSPjKE-ELzgTJdNyfE1t8z5_Z7JeE6bBUUTcCjkBH0/edit#gid=358936068",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1fiSPjKE-ELzgTJdNyfE1t8z5_Z7JeE6bBUUTcCjkBH0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fiSPjKE-ELzgTJdNyfE1t8z5_Z7JeE6bBUUTcCjkBH0/edit?usp=drivesdk",
"cachedResultName": "IT Allocation"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "6f36ecc2-21e5-4bb8-a71a-afce30a5cace",
"name": "Sticky Note \u2014 Phase 1: Approval Trigger & Vendor Data Extraction",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2288,
2208
],
"parameters": {
"color": 3,
"width": 540,
"height": 242,
"content": "## \ud83d\udce5 Phase 1: Approval Trigger & Data Extraction\nFired when a vendor row is marked **Approved** in Google Sheets.\nFilters out any non-approved rows, then extracts and prepares all key vendor fields (company name, GST, PAN, contact details, category) needed for portal registration.\n\nDownloads the vendor's **GST Certificate** and **PAN Card** from Google Drive as binary files ready for upload during form filling."
},
"typeVersion": 1
},
{
"id": "766953ab-ae7e-4835-a9f6-24cbea5e2f4b",
"name": "Sticky Note \u2014 Phase 2: MCTS Wizard Mapping",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1200,
2144
],
"parameters": {
"color": 5,
"width": 490,
"height": 259,
"content": "## \ud83e\udde0 Phase 2: MCTS \u2014 Map Vendor Portal Wizard\n**Agent Q** uses Monte Carlo Tree Search to:\n- Navigate to the vendor registration portal\n- Identify all wizard steps, form fields, and required file uploads\n- Build a structured step-by-step execution plan\n\nThe parsed plan is stored as an ordered list of actions before any form interaction begins."
},
"typeVersion": 1
},
{
"id": "63825aef-6755-45bd-af17-eea9c3f305fb",
"name": "Sticky Note \u2014 Phase 3: Self-Critique Field Validation",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
2112
],
"parameters": {
"color": 4,
"width": 480,
"height": 185,
"content": "## \u2705 Phase 3: Self-Critique \u2014 Validate Form Fields\n**Agent Q** cross-checks all extracted vendor data against the portal's required fields:\n- Validates data types, formats, and mandatory field completeness\n- Flags missing or malformed values before submission\n\n**GO** \u2192 proceed to wizard execution\n**NO-GO** \u2192 skip to escalation flow"
},
"typeVersion": 1
},
{
"id": "891d8080-93be-4148-bb1a-77751e7e2f76",
"name": "Sticky Note \u2014 Phase 4: Autonomous Wizard Execution Loop",
"type": "n8n-nodes-base.stickyNote",
"position": [
144,
2048
],
"parameters": {
"color": 6,
"width": 510,
"height": 227,
"content": "## \ud83e\udd16 Phase 4: Autonomous Wizard Step Execution\n**Agent Q** executes each portal wizard step in sequence:\n- Fills form fields, selects dropdowns, uploads documents\n- Parses the result of each step\n- Checks if more steps remain \u2192 loops back to execute next step\n- \u2705 All steps complete \u2192 proceed to success notifications\n- \u274c Step fails \u2192 trigger DPO correction & retry loop"
},
"typeVersion": 1
},
{
"id": "08eeb706-e9ce-4f7c-b083-60f09ddbfb61",
"name": "Sticky Note \u2014 Phase 5: DPO Correction & Retry Loop",
"type": "n8n-nodes-base.stickyNote",
"position": [
256,
3008
],
"parameters": {
"color": 4,
"width": 480,
"height": 185,
"content": "## \ud83d\udd04 Phase 5: DPO Correction & Retry Loop\nWhen a wizard step fails, **Agent Q** self-corrects using DPO:\n- Analyses what went wrong and generates a corrected action\n- Retries the step with updated inputs\n- Allows up to **3 retry attempts** before escalating\n\n\u274c Max retries exceeded \u2192 escalation flow triggered"
},
"typeVersion": 1
},
{
"id": "d20a255f-ad2f-4c23-9071-78634ce689c7",
"name": "Sticky Note \u2014 Phase 6: Success Notifications & Logging",
"type": "n8n-nodes-base.stickyNote",
"position": [
1168,
2128
],
"parameters": {
"color": 7,
"width": 460,
"height": 165,
"content": "## \ud83d\udce7 Phase 6: Success \u2014 Notify & Log\nOnce all wizard steps complete successfully:\n- **Gmail** sends a personalised welcome email to the vendor\n- **Google Sheets** logs the onboarding status as Completed\n- **Slack** notifies the Procurement Team with vendor summary"
},
"typeVersion": 1
},
{
"id": "e3d96961-e8d2-49fc-9068-3e8897951443",
"name": "Sticky Note \u2014 Phase 7: Escalation Flow",
"type": "n8n-nodes-base.stickyNote",
"position": [
1680,
2640
],
"parameters": {
"color": 2,
"width": 480,
"height": 239,
"content": "## \ud83d\udea8 Phase 7: Escalation \u2014 Human Intervention Required\nTriggered when Self-Critique returns NO-GO or all DPO retries are exhausted:\n- **Gmail** sends a detailed escalation alert to the procurement manager\n- **Slack** posts an urgent escalation notice to the team channel\n- **Google Sheets** logs the failed onboarding with full error context for manual follow-up"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "e7a5bdf5-70d4-4d11-b1c7-0f92e9b90377",
"connections": {
"\ud83d\udcd0 Parse MCTS Wizard Plan": {
"main": [
[
{
"node": "\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udd22 Increment Step Counter": {
"main": [
[
{
"node": "\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcca Parse Wizard Step Result": {
"main": [
[
{
"node": "\u2753 More Wizard Steps Remaining?",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcdd Parse Self-Critique Result": {
"main": [
[
{
"node": "\u2753 GO or NO-GO? \u2014 Proceed or Escalate",
"type": "main",
"index": 0
}
]
]
},
"\u2753 More Wizard Steps Remaining?": {
"main": [
[
{
"node": "\ud83d\udd22 Increment Step Counter",
"type": "main",
"index": 0
}
],
[
{
"node": "\ud83d\udce7 Gmail \u2014 Send Vendor Welcome Email",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcdd Parse DPO Correction Output": {
"main": [
[
{
"node": "\u2753 Retry Allowed? (Max 3 Attempts)",
"type": "main",
"index": 0
}
]
]
},
"\u26a1 LLM \u2014 GPT-4o (MCTS Planner)": {
"ai_languageModel": [
[
{
"node": "\ud83e\udde0 Agent Q \u2014 MCTS: Map Vendor Portal Wizard Steps",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"\u26a1 LLM \u2014 GPT-4o (DPO Corrector)": {
"ai_languageModel": [
[
{
"node": "\ud83d\udd04 Agent Q \u2014 DPO: Correct & Retry Failed Step",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"\u26a1 LLM \u2014 GPT-4o (Self-Critique)": {
"ai_languageModel": [
[
{
"node": "\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"\u26a1 LLM \u2014 GPT-4o (Step Executor)": {
"ai_languageModel": [
[
{
"node": "\ud83e\udd16 Agent Q \u2014 Execute Vendor Portal Wizard Step",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"\ud83d\udce6 Extract & Prepare Vendor Data": {
"main": [
[
{
"node": "\ud83d\udcc1 Google Drive \u2014 Download GST Certificate",
"type": "main",
"index": 0
},
{
"node": "\ud83d\udcc1 Google Drive \u2014 Download PAN Card",
"type": "main",
"index": 0
}
]
]
},
"\u2753 Retry Allowed? (Max 3 Attempts)": {
"main": [
[
{
"node": "\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields",
"type": "main",
"index": 0
}
],
[
{
"node": "\ud83d\udea8 Gmail \u2014 Send Escalation Alert",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udea8 Gmail \u2014 Send Escalation Alert": {
"main": [
[
{
"node": "\ud83d\udea8 Slack \u2014 Send Escalation Alert",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udea8 Slack \u2014 Send Escalation Alert": {
"main": [
[
{
"node": "\ud83d\udccb Google Sheets \u2014 Log Escalation Record",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udd0d Filter \u2014 Status = Approved Only": {
"main": [
[
{
"node": "\ud83d\udce6 Extract & Prepare Vendor Data",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcc1 Google Drive \u2014 Download PAN Card": {
"main": [
[
{
"node": "\ud83e\udde0 Agent Q \u2014 MCTS: Map Vendor Portal Wizard Steps",
"type": "main",
"index": 0
}
]
]
},
"\u2753 GO or NO-GO? \u2014 Proceed or Escalate": {
"main": [
[
{
"node": "\ud83e\udd16 Agent Q \u2014 Execute Vendor Portal Wizard Step",
"type": "main",
"index": 0
}
],
[
{
"node": "\ud83d\udd04 Agent Q \u2014 DPO: Correct & Retry Failed Step",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udce7 Gmail \u2014 Send Vendor Welcome Email": {
"main": [
[
{
"node": "\ud83d\udcca Google Sheets \u2014 Log Onboarding Status",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcca Google Sheets \u2014 Log Onboarding Status": {
"main": [
[
{
"node": "\ud83d\udd14 Slack \u2014 Notify Procurement Team",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udcc1 Google Drive \u2014 Download GST Certificate": {
"main": [
[
{
"node": "\ud83e\udde0 Agent Q \u2014 MCTS: Map Vendor Portal Wizard Steps",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udccb Trigger \u2014 Vendor Approved in Google Sheets": {
"main": [
[
{
"node": "\ud83d\udd0d Filter \u2014 Status = Approved Only",
"type": "main",
"index": 0
}
]
]
},
"\ud83d\udd04 Agent Q \u2014 DPO: Correct & Retry Failed Step": {
"main": [
[
{
"node": "\ud83d\udcdd Parse DPO Correction Output",
"type": "main",
"index": 0
}
]
]
},
"\ud83e\udd16 Agent Q \u2014 Execute Vendor Portal Wizard Step": {
"main": [
[
{
"node": "\ud83d\udcca Parse Wizard Step Result",
"type": "main",
"index": 0
}
]
]
},
"\u2705 Agent Q \u2014 Self-Critique: Validate Form Fields": {
"main": [
[
{
"node": "\ud83d\udcdd Parse Self-Critique Result",
"type": "main",
"index": 0
}
]
]
},
"\ud83e\udde0 Agent Q \u2014 MCTS: Map Vendor Portal Wizard Steps": {
"main": [
[
{
"node": "\ud83d\udcd0 Parse MCTS Wizard Plan",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleDriveOAuth2ApigoogleSheetsOAuth2ApigoogleSheetsTriggerOAuth2ApiopenAiApislackApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automate end-to-end vendor onboarding workflows with an AI-powered autonomous agent built in n8n 🤖. This workflow uses advanced MCTS (Monte Carlo Tree Search) reasoning to intelligently map procurement portal steps, validate vendor information, execute onboarding actions, and…
Source: https://n8n.io/workflows/15692/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Automate your entire supplier negotiation process with this AI-driven workflow that intelligently drafts, refines, and sends negotiation emails 📧. Using advanced LLM reasoning and multi-angle strategi
Consultants, agencies, freelancers, and project managers who want to ensure proposals, emails, and tasks are followed up on time.
Automated invoice processing pipeline that extracts data from PDF invoices, uses AI Agent for intelligent expense categorization, generates XML for accounting systems, and routes high-value invoices f
Logistics teams spend hours manually validating shipment data, checking compliance, generating freight documents, and emailing stakeholders. Errors in HSN codes, weights, or carrier details can lead t
This workflow automatically converts unstructured internal documentation into clear, actionable Standard Operating Procedures (SOPs).