My brother, I understand it now!
this is the sub flow
{
"name": "ADMIN MESSAGING",
"nodes": [
{
"parameters": {
"operation": "sendAndWait",
"chatId": "6817067052",
"message": "A new user has requested for registration:\n\n[name]\n[email]",
"approvalOptions": {
"values": {
"approvalType": "double"
}
},
"options": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
480,
340
],
"id": "a3e2810e-9816-4019-8cad-1ea057cdcabe",
"name": "Telegram",
"webhookId": "af268926-5f43-4629-be37-9ba4c0552bb8",
"alwaysOutputData": true,
"credentials": {
"telegramApi": {
"id": "njKf0i6ith28nBsM",
"name": "Telegram account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e547aa9e-18e8-4149-87c5-2ab180264c60",
"name": "status",
"value": "={{ $json.data.approved }}",
"type": "boolean"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
700,
340
],
"id": "d3c03727-1dce-40e2-a5e5-29e4e55fe9f3",
"name": "Edit Fields",
"alwaysOutputData": true
},
{
"parameters": {
"workflowInputs": {
"values": [
{
"name": "name"
},
{
"name": "email"
}
]
}
},
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1.1,
"position": [
240,
340
],
"id": "c9dbf1fc-8c3e-46fe-96eb-173245a09d68",
"name": "When Executed by Another Workflow"
}
],
"pinData": {},
"connections": {
"Telegram": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "7914a8ed-bc7d-485e-94ad-46ff99d90431",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "76a114090afc4c64a210017df49d602599ac79ad55af611fa5c5323e3c54e15b"
},
"id": "Mkb2DUqpJbDRKLRK",
"tags": []
}```
type or paste code here
**this is the main workflow
{
"name": "CUSOTMR REG TELEGRAM PROCESS",
"nodes": [
{
"parameters": {
"description": "Maintain a human like conversation\n\nThese are the rules:\na) Use a conversational tone and concise language, and avoid unnecessarily complex jargon.\nb) Use short, punchy sentences. Example: \"And then… you enter the room. Your heart drops. The pressure is on.\"\nc) Use simple language. 10th grade readability or lower. Example: \"Emails help businesses tell customers about their stuff.\"\nd) Use rhetorical fragments to improve readability. Example: “The good news? My 3-step process can be applied to any business.\"\ne) Use bullet points when relevant. Example: “Because anytime someone loves your product, chances are they’ll:\n\n- buy from you again\n- refer you to their friend\n\nf) Use analogies or examples often. Example: \"Creating an email course with AI is easier than stealing candies from a baby.\"\ng) Split up long sentences. Example: “Even if you make your clients an offer they decline…[break]… You shouldn’t give up on the deal.”\nh) Include personal anecdotes. Example: \"I recently asked ChatGPT to write me…\"\ni) Use bold and italic formatting to emphasize words.\nj) Do not use emojis or hashtags\nk) Avoid overly promotional words like \"game-changing,\" \"unlock,\" \"master,\" \"skyrocket,\" or \"revolutionize.\"\nm) Important - vary sentence length within a paragraph.\nn) Avoid the use of emojis, asterisks, hashtags, or underscores.\n\np) Avoid bolds, italics, and markdown formatting unless asked for\nq) Don't refer to yourself or add an intro or outro.\n\n\n- When the user sedns the name and email for verification, call the n8n workflow tool node\n\n\n"
},
"type": "@n8n/n8n-nodes-langchain.toolThink",
"typeVersion": 1,
"position": [
-1920,
60
],
"id": "cb9d0860-0b28-47d2-b8df-8fd10daf33a0",
"name": "Think"
},
{
"parameters": {
"jsCode": "const minDelaySec = 3; // 3 seconds\nconst maxDelaySec = 7; // 7 seconds\n\nconst randomDelay = Math.floor(Math.random() * (maxDelaySec - minDelaySec + 1)) + minDelaySec;\n\nreturn [\n {\n json: {\n delay: randomDelay, // Delay in seconds\n output: $input.first().json.output // Save AI Agent's response\n },\n },\n];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-2700,
200
],
"id": "814a5187-c562-4dc5-8ad3-87063f3faaf3",
"name": "Code"
},
{
"parameters": {
"amount": "={{ $json.delay }}"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-2480,
200
],
"id": "ea380222-abb7-4a06-adff-9c89215d3f12",
"name": "Wait",
"webhookId": "d359f573-daee-4818-95f2-5a5ab9d91bfb"
},
{
"parameters": {
"jsCode": "const sessionId = $input.first().json.sessionId;\n\nif (sessionId) {\n // Session exists — redirect or flag it\n return [\n {\n json: {\n sessionStatus: \"exists\",\n sessionId: sessionId\n }\n }\n ];\n} else {\n // Session doesn't exist — handle as new\n return [\n {\n json: {\n sessionStatus: \"new\"\n }\n }\n ];\n}\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-2480,
-160
],
"id": "ad30e40b-b2b0-49cf-ab4f-98bbfa592067",
"name": "Code1"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.sessionStatus }}",
"rightValue": "=exists",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "64c7aabc-fe0b-4cd0-a6b4-3498c0b3f337"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "EXISTS"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "8d88a350-9725-4d2d-854d-5d95a7e767ed",
"leftValue": "={{ $json.sessionStatus }}",
"rightValue": "new",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "NEW"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-2260,
-160
],
"id": "1a208db3-9284-4101-9449-2c6292817ee4",
"name": "Switch"
},
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.2,
"position": [
-2700,
-160
],
"id": "ac5d6327-f1ce-4d0f-9d3e-19824a8ca27f",
"name": "Telegram Trigger",
"webhookId": "4d6834dc-ea03-4dc0-b9f8-fea69807ab92",
"credentials": {
"telegramApi": {
"id": "njKf0i6ith28nBsM",
"name": "Telegram account"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{ $json.output }}",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-2260,
200
],
"id": "cdbc5829-5645-411b-9ee3-373947ff5c3a",
"name": "Telegram",
"webhookId": "5601175e-1dcd-4b85-b852-5cf2613e29b1",
"credentials": {
"telegramApi": {
"id": "njKf0i6ith28nBsM",
"name": "Telegram account"
}
}
},
{
"parameters": {
"name": "admin_message",
"description": "call this tool to get a boolean value.",
"workflowId": {
"__rl": true,
"value": "Mkb2DUqpJbDRKLRK",
"mode": "list",
"cachedResultName": "ADMIN MESSAGING"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('name', ``, 'string') }}",
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email', ``, 'string') }}"
},
"matchingColumns": [],
"schema": [
{
"id": "name",
"displayName": "name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "email",
"displayName": "email",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2.1,
"position": [
-1800,
60
],
"id": "72bcb989-531c-4a65-b6d7-e1dc579053b6",
"name": "Call n8n Workflow Tool"
},
{
"parameters": {
"modelName": "models/gemini-2.0-flash",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
-2040,
60
],
"id": "3dbe24a7-1822-4b0e-b12f-3ed2b008464d",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"id": "o5srcEe89YbGzPxj",
"name": "Google Gemini(PaLM) Api account"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $('Telegram Trigger').item.json.message.text }}",
"options": {
"systemMessage": "## AI Expert in Trading Industry:\n\n### 1. DESCRIPTION:\n- *Language of prompt:* English\n- *Communication Level:* Beginner to Intermediate\n- *Core identity and personality of the AI:* Supportive, friendly, engaging, empathetic, knowledgeable in trading\n- *Primary purpose and expertise:* To assist users as a support agent for a trading industry company, providing trading signals, account setup guidance, and educational resources.\n\n### 2. RULES AND GUIDELINES:\n- *Core behavioral principles:* Empathy, clarity, and prompt assistance\n- *Ethical boundaries and limitations:* Respect user privacy, avoid financial advice\n- *Response style and tone:* Friendly, supportive, and informative without excessive use of exclamation marks\n- *Emoticon usage:* Only use emoticons exactly where they appear in the question flow. Do not add, remove, or move any emoticons.\n- *Handling multiple messages:* If a user sends multiple messages in quick succession, respond to the first message and acknowledge the subsequent messages in a single, consolidated response to avoid repetition.\n\n\n###3. CONVERSATION STYLE:\n\na) Use a conversational tone, concise language and avoid unnecessarily complex jargon.\nb) Use short punchy sentences. Example: \"And then… you enter the room. Your heart drops. The pressure is on.\"\nc) Use simple language. 10th grade readability or lower. Example: \"Emails help businesses tell customers about their stuff.\"\nd) Use rhetorical fragments to improve readability. Example: “The good news? My 3-step process can be applied to any business\"\ne) Use bullet points when relevant. Example: “Because anytime someone loves your product, chances are they’ll:\n\n- buy from you again\n- refer you to their friends\"\n\nf) Use analogies or examples often. Example: \"Creating an email course with AI is easier than stealing candies from a baby\"\ng) Split up long sentences. Example: “Even if you make your clients an offer they decline…[break]…you shouldn’t give up on the deal.”\nh) Include personal anecdotes. Example: \"I recently asked ChatGPT to write me…\"\ni) Use bold and italic formatting to emphasize words.\nj) Do not use emojis or hashtags\nk) Avoid overly promotional words like \"game-changing,\" \"unlock,\" \"master,\" \"skyrocket,\" or \"revolutionize.\"\nm) Important - vary sentences length within a paragraph.\nn) Avoid the use of emojis, asterisks, hashtags, or underscores.\n\np) Avoid bolds, italics, and markdown formatting unless asked for\nq) Don't refer to yourself or add an intro or outro.\n\n\n\n### 4. COMPANY FAQ:\n- *Q: How can I gain access to the exclusive signals and premium community?*\n - A: You can unlock the full potential of our premium services by clicking the following link: https://buy.stripe.com/14k7vldYz5Pw5JS8ww\n- *Q: What payment options are available for non-UK residents?*\n - A: Non-UK residents can use Stripe for payment: https://buy.stripe.com/14k7vldYz5Pw5JS8ww\n- *Q: What payment options are available for UK residents?*\n - A: UK residents can use PlugandPay for payment: https://wwwtheforexcomplex.plugandpay.nl/checkout/tfxc-premium-checkout\n- *Q: Can I pay using Bitcoin or USDT?*\n - A: Yes, you can use the following addresses for payment:\n - Bitcoin: bc1q3prr5zywvm34dhhsnecfpql8yfvaga4prze6u5\n - USDT ERC-20: 0x612D63dA1aE515d94Bf0E357477451a3A1A3111D\n- *Q: Are there any countries where your services are not available?*\n - A: Yes, residents from the following countries are not able to use our services: Albania, American Samoa, Australia, Belarus, Bermuda, Bosnia and Herzegovina, Burma/Myanmar, Burundi, Canada, Central African Republic, China, Crimea, Cuba, Democratic Republic of the Congo, Eritrea, Former Federal Republic of Yugoslavia, Guam, Iran, Iraq, ISIL (Da’esh) & Al-Qaida & The Taliban, Libya, Mali, Montenegro, North Korea, Northern Mariana Islands, Puerto Rico, Republic of Guinea, Republic of Guinea-Bissau, Russia, Sevastopol, Sierra Leone, Singapore, Somalia, South Sudan, Sudan, Syria, United States of America, United States Virgin Islands, Venezuela, Yemen, and Zimbabwe.\n- *Q: What is the registration process for new members?*\n - A: Follow these steps to register:\n 1. Use the referral link provided to create an account on Vantage's website.\n 2. Fund your account with the equivalent of 300 USD.\n 3. Verify your account with your documents and send me the account number.\n 4. I will verify the registration from my end.\n 5. Once the registration/deposit shows, I’ll send you invite links to my channels.\n- *Q: How do I enable the 50% deposit bonus?*\n - A: Follow these steps to enable the bonus:\n 1. Visit Vantagemarkets.com and log in.\n 2. Navigate to the \"Promotion\" section.\n 3. Opt-in for the \"50 deposit bonus.\"\n- *Q: How can I make a deposit with the broker?*\n - A: To make a deposit, follow these steps:\n 1. Visit the Vantage website and go to the \"funds\" option.\n 2. Choose \"deposit funds\" and select your preferred method.\n 3. Once your account shows the funds, let us know.\n\n\n##Customer Regsitration verification.\n- When the user mentions something about completing the registration process, ask for the name that they have used and the email they have used for registration and save it on\n\n[name]\n[email]\n\n- Send the admin a message and use the Telegram tool (Admin_message) and display the name and email of the user to the admin and wait for the response.\n\n##STATUS OF CHECKING IF THE USER IS REGISTERED\nGET the response and:\nIf the user is APPROVED, welcome the user. \nIf the user is NOT APPROVED, acknowledge to the user that he is not registered and may have to try again. \n\nIf the admin approves the message, continue the workflow.\n\nThis is the current prompt"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.8,
"position": [
-2008,
-160
],
"id": "613c6648-4a8e-4d82-b1ea-09cc9758de4e",
"name": "AI Agent"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{$json.output}}",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-1600,
-160
],
"id": "d72f49a1-52e3-4881-a457-47c23cb2f5f7",
"name": "Telegram1",
"webhookId": "9d0eeec1-81e6-43fb-bab9-9492f9fb2462",
"credentials": {
"telegramApi": {
"id": "njKf0i6ith28nBsM",
"name": "Telegram account"
}
}
}
],
"pinData": {},
"connections": {
"Think": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Code1": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
],
[]
]
},
"Switch": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"Call n8n Workflow Tool": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Telegram1",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"callerPolicy": "workflowsFromSameOwner"
},
"versionId": "8f12a06d-fa27-44a6-8520-5228fcc943e8",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "76a114090afc4c64a210017df49d602599ac79ad55af611fa5c5323e3c54e15b"
},
"id": "LGIIcXJw6mrz0OuF",
"tags": []
}
All good?