-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Expand file tree
/
Copy pathAI-Driven Lead Management and Inquiry Automation with ERPNext & n8n.json
More file actions
733 lines (733 loc) · 21 KB
/
Copy pathAI-Driven Lead Management and Inquiry Automation with ERPNext & n8n.json
File metadata and controls
733 lines (733 loc) · 21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
{
"meta": {
"instanceId": "e4f78845dfed9ddcfba1945ae00d12e9a7d76eab052afd19299228ce02349d86"
},
"nodes": [
{
"id": "23291d25-3e1a-4b0d-9b1d-d066e8c04a1f",
"name": "Customer Lead AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-640,
460
],
"parameters": {
"text": "=**System Prompt:**\n\nYou are an AI assistant designed to process new leads and generate appropriate responses. Your role includes analyzing lead notes, categorizing them, and generating an email from the system to inform the relevant contact about the inquiry. Do not send the email as if it is directly from the customer; instead, draft it as a notification from the system summarizing the inquiry.\n\n### **Process Flow**\n\n1. **Analyzing Lead Notes:**\n - Extract key details such as the customer name, organization, contact information, and their specific request. \n - Determine if the inquiry relates to products, services, or solutions offered by the company.\n\n2. **Finding the Appropriate Contact(s):**\n - Search the contact database to find the responsible person(s) for the relevant product, service, or solution. \n - If one person is responsible, provide their email. \n - If multiple people are responsible, list all emails separated by commas.\n\n3. **Generating an Email Notification:**\n - Draft a professional email as a notification from the system.\n - Summarize the customer’s inquiry.\n - Include all relevant details to assist the recipient in addressing the inquiry.\n\n4. **Handling Invalid Leads:**\n - If the inquiry is unrelated to products, services, or solutions (e.g., job inquiries or general product inquiries), classify it as invalid and return: \n `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n### **Output Requirements**\n\n1. **For Relevant Leads:**\n - **Email Address(es):** Provide the appropriate email(s). \n - **Email Message Body:** Generate an email notification from the system summarizing the inquiry.\n\n2. **For Invalid Leads:**\n - Return: `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n\n### **Email Template for Relevant Leads**\n\n**Email Address(es):** [Relevant Email IDs]\n\n**Email Message Body:**\n\n_Subject: New Inquiry from Customer Regarding [Product/Service/Solution]_ \n\nDear [Recipient(s)], \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** [Customer Name] \n**Organization:** [Organization Name] \n**Contact Information:** [Contact Details] \n\n**Inquiry Summary:** \n[Summarized description of the customer's request, e.g., “The customer is seeking to upgrade their restroom facilities with touchless soap dispensers and tissue holders installed behind mirrors. They have requested a site visit to assess the location and provide a proposal.”] \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \n[Your System Name] \n\n\n### **Example Output**\n\n**Input Lead Notes:**\n*\"Dear Syncbricks, We are looking to Develop Workflow Automation Soluition for our company, can you let us know the details what do you offer in tems of this.\"*\n\n**Output:**\n\n- **Email Address(es):** employee@syncbricks.com\n\n- **Email Message Body:** \n\n_Subject: Workflow Automation Platform Integration_ \n\nDear -Emploiyee Name (s) --, \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** Amjid Ali \n**Organization:** Syncbricks LLC\n**Contact Information:** 123456789 \n\n**Inquiry Summary:** \nThe customer is asking for workflow automation for their company \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \nSyncbricks LLC\n\n---\nHere are the Lead Details\nLead Name : {{ $json.data.lead_name }}\nCompany : {{ $json.data.company_name }}\nSource : {{ $json.data.source }}\nNotes : {{ $json.data.notes }}\nCity : {{ $json.data.city }}\nCountry : {{ $json.data.country }}\nMobile : {{ $json.data.mobile_no }}",
"options": {},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "1831dc36-910b-4a72-a90e-b411f105a8c3",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-800,
800
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "hTl3a2XqteCwExYY",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "79713c56-2f7c-4872-90e4-331715f54048",
"name": "Abbriviations",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-640,
800
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit#gid=0",
"cachedResultName": "abbrivaitions"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit?usp=drivesdk",
"cachedResultName": "Abbriviations List"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "L3lApjbQfMm36LLX",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "73b1e3c9-4703-4f87-8399-e7a9bf368d4c",
"name": "Lead Body",
"type": "n8n-nodes-base.set",
"position": [
-1640,
640
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "82a674a2-4d12-45f2-b276-cc95cf7b2e93",
"name": "body",
"type": "object",
"value": "={{ $json.body }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5f25d846-c639-49e5-bea2-160000bfb104",
"name": "Source Website and Status Open",
"type": "n8n-nodes-base.if",
"position": [
-1920,
640
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2b184de2-a64e-44e3-8f25-645539681533",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.source }}",
"rightValue": "Website"
},
{
"id": "9632cf65-11a1-483c-95c8-94bfe84fb243",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.status }}",
"rightValue": "Open"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "12ba65c9-0890-4862-9704-98492eb8f637",
"name": "Microsoft Outlook",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1180,
580
],
"parameters": {
"subject": "={{ $('Fields for Outlook').item.json.subject }}",
"bodyContent": "={{ $json.html }}\n<a href=\"https://erpnext.syncbricks.com/app/lead/{{ $('Webhook').item.json.body.name }}\" target=\"_blank\" rel=\"noopener noreferrer\">Here is Lead {{ $('Source Website and Status Open').item.json.body.name }} </a>\n",
"toRecipients": "= {{ $('Fields for Outlook').item.json.email_addresses }}",
"additionalFields": {
"bodyContentType": "html"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "9gy3uvf3pmBdpEsq",
"name": "Microsoft Outlook Al Ansari"
}
},
"typeVersion": 2
},
{
"id": "b1410997-3705-4234-918e-a14e4ccc6b70",
"name": "Email Body Text Generated by AI",
"type": "n8n-nodes-base.set",
"position": [
700,
580
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "cdce31fb-2ec9-45ce-a4ac-a6ff9c811dc3",
"name": "email_body",
"type": "string",
"value": "={{ $json.email_body }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b10684b9-9f72-42b3-a9f9-c54e711ceb59",
"name": "Fields for Outlook",
"type": "n8n-nodes-base.code",
"position": [
360,
600
],
"parameters": {
"jsCode": "// Input text from the `output` field\nconst textOutput = $json?.output || '';\n\n// Function to extract values from the text\nfunction extractFields(text) {\n const fields = {};\n\n // Regular expressions to extract each field\n const emailMatch = text.match(/\\*\\*Email Address\\(es\\):\\*\\*\\s*([^\\n]+)/);\n const subjectMatch = text.match(/_Subject:\\s*([^_]+)/);\n const emailBodyMatch = text.match(/Dear[\\s\\S]+/);\n\n // Assign extracted values to the fields\n fields.email_addresses = emailMatch ? emailMatch[1].trim() : null;\n fields.subject = subjectMatch ? subjectMatch[1].trim() : null;\n fields.email_body = emailBodyMatch ? emailBodyMatch[0].trim() : null;\n\n return fields;\n}\n\n// Extract fields from the output\nconst extractedFields = extractFields(textOutput);\n\n// Return the fields as JSON\nreturn {\n json: extractedFields\n};\n"
},
"typeVersion": 2
},
{
"id": "e2c10569-fde2-425c-8b20-fdb32a6e2bd5",
"name": "Email Body for Outlook",
"type": "n8n-nodes-base.code",
"position": [
860,
580
],
"parameters": {
"jsCode": "// Input email body\nconst emailBody = $json.email_body || '';\n\n// Function to convert plain text email body into HTML\nfunction formatEmailBodyAsHtml(body) {\n // Replace markdown-like sections with corresponding HTML\n let htmlBody = body\n .replace(/\\*\\*Customer Name:\\*\\* (.+)/, '<p><strong>Customer Name:</strong> $1</p>')\n .replace(/\\*\\*Organization:\\*\\* (.+)/, '<p><strong>Organization:</strong> $1</p>')\n .replace(/\\*\\*Contact Information:\\*\\* (.+)/, '<p><strong>Contact Information:</strong> $1</p>')\n .replace(/\\*\\*Inquiry Summary:\\*\\*\\s*([\\s\\S]+?)(?=\\n\\n\\*\\*Action Required:)/, '<p><strong>Inquiry Summary:</strong> $1</p>')\n .replace(/\\*\\*Action Required:\\*\\*\\s*([\\s\\S]+)/, '<p><strong>Action Required:</strong> $1</p>');\n\n // Wrap each paragraph in `<p>` tags for better readability\n htmlBody = htmlBody\n .replace(/Dear (.+?),/, '<p>Dear <strong>$1</strong>,</p>')\n .replace(/Thank you,\\s+(.+)/, '<p>Thank you,<br><strong>$1</strong></p>');\n\n return htmlBody;\n}\n\n// Convert the email body into HTML\nconst formattedHtmlBody = formatEmailBodyAsHtml(emailBody);\n\n// Return the formatted HTML\nreturn {\n html: formattedHtmlBody\n};\n"
},
"typeVersion": 2
},
{
"id": "3297550b-ed78-4528-ad65-facdc879590a",
"name": "Inquiry has Notes",
"type": "n8n-nodes-base.if",
"position": [
-1080,
640
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bc81994a-2ad8-4af7-8c58-2c7e58a0fd2e",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.data.notes }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e2544a27-8b6d-4bb0-84f1-00c3a5e66978",
"name": "Inquiry is Valid?",
"type": "n8n-nodes-base.if",
"position": [
40,
620
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ddd5e8a2-277f-4db6-b38d-28a7b91a2f66",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.output }}",
"rightValue": "**Invalid Lead - Not related to products, services, or solutions.**"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "39cc73e7-ceb3-4e8e-a5bc-55648595f784",
"name": "Company Profile",
"type": "n8n-nodes-base.googleDocsTool",
"position": [
-540,
800
],
"parameters": {
"operation": "get",
"documentURL": "you-must-provide-the-doc-id"
},
"credentials": {
"googleDocsOAuth2Api": {
"id": "RdTuYvYpBqEKhIQ3",
"name": "Google Docs account"
}
},
"typeVersion": 2
},
{
"id": "8ee24c59-1acb-4d76-a136-74e69d694a49",
"name": "Company Policies",
"type": "n8n-nodes-base.googleDocsTool",
"position": [
-420,
780
],
"parameters": {
"operation": "get",
"documentURL": "you-must-provide-the-doc-id"
},
"credentials": {
"googleDocsOAuth2Api": {
"id": "RdTuYvYpBqEKhIQ3",
"name": "Google Docs account"
}
},
"typeVersion": 2
},
{
"id": "a5db3aa7-8a77-4553-9c13-a96c51f32745",
"name": "Company Contact Database",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-300,
780
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "=Telephone Directory"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "L3lApjbQfMm36LLX",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "f3e73266-faa4-4e6d-8c60-92669d64233b",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2000,
257.53836663807056
],
"parameters": {
"color": 6,
"width": 297.84037615575886,
"height": 643.0692298205195,
"content": "### Filter the Lead\nI have done only for theose which are open and where the source is Website. You can remove this if you want to have all leads."
},
"typeVersion": 1
},
{
"id": "0056e35c-4901-406d-9a95-f6da26808841",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
280
],
"parameters": {
"color": 3,
"width": 302.58963031819115,
"height": 660,
"content": "### Output from AI Agent\nIf the INquiry is invalid, not related to the products and services offered, it will invalidate that you can optionnally link the invalid output to email or anything. Options are limitless"
},
"typeVersion": 1
},
{
"id": "5e0e9561-0fb8-4225-aa59-58e25abc8ca1",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
280.0000000000002
],
"parameters": {
"color": 7,
"width": 764.2159851725196,
"height": 648.5051458745236,
"content": "### Customer Experience Agent (AI)\nNow this Node is an AI Agent who is speicalized to understand the Lead Source and the Inquiry sent by Cusomter. The Agent will look at company information, which has detials of producuts and services defined in Google Docs, and the Contacts Sheet where a column must be added mentioning that who is the person dealing in which products, solutions and services. Once the inquiry is about speicifc product solution and service it will look from the sheet and then will decide to whom the email has to be sent. Details is defined in the Agent.\nMake sure to drag fields from http request node"
},
"typeVersion": 1
},
{
"id": "5a3ca9c9-07c2-4c74-ba8c-6b14f487fc4d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2420,
260
],
"parameters": {
"color": 5,
"width": 398,
"height": 642,
"content": "### Once the Lead is generatd in ERP\n\nConsider creating creating an inquiry web form in ERPNext and let the Website Visitor fill that Inquiry form, as soon as the iqnuiry form is filled this workflow will start.\n\nMake sure to create a webhook in ERPNext. Follow Below steps in ERPNext.\n\nGo to Wehbooks \nDoctype : Lead\nTrigger : on_insert\n\nPaste this webhook there, as test first and finally production"
},
"typeVersion": 1
},
{
"id": "cf930f52-d06b-40c1-91f5-fa1c3dfee09a",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
618.1625654107004,
260
],
"parameters": {
"color": 4,
"width": 388.6432532629275,
"height": 662,
"content": "### Email Body\nGet only Email body from Previous Node and then Convert this to HTML Format so that it looks professional. \n"
},
"typeVersion": 1
},
{
"id": "a1023b2b-3e0d-486f-9050-8ff98ff060b5",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1440,
260
],
"parameters": {
"color": 5,
"width": 248.905549047384,
"height": 654.6630436071407,
"content": "### Get Details of Lead from ERPNext. For us most important is Notes"
},
"typeVersion": 1
},
{
"id": "732046b2-967a-4e0c-85e4-ae04e8c0f9cf",
"name": "Sticky Note13",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
260
],
"parameters": {
"color": 6,
"width": 222.5278407657604,
"height": 651.0941643427163,
"content": "### Get Lead ID\nThis will extract the Lead Name in ERPNext. Ensure to send doc.name from the webhook in ERPnext\n\nIt will then send this to next node to get full details of this lead."
},
"typeVersion": 1
},
{
"id": "b80448ee-5a15-4569-99e4-c3e616a5600d",
"name": "Sticky Note14",
"type": "n8n-nodes-base.stickyNote",
"position": [
1035.2592266730085,
260
],
"parameters": {
"color": 6,
"width": 399.43186296400074,
"height": 662,
"content": "### Send Email\n\nNow drag and drop the fields from Previous Nodes. Email Addresses Subject and Body.\n\nRemember all fields are selected by AI Agent, whom to send email, what to send and so on. \n\nYou can alternatively inform your employees by whatsapp for quick action."
},
"typeVersion": 1
},
{
"id": "3d190d34-f6e0-47bc-9216-d312d1d6ee38",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2920,
260
],
"parameters": {
"color": 4,
"width": 475.27306699862953,
"height": 636.1483291619771,
"content": "## Developed by Amjid Ali\n\nThank you for using this workflow template. It has taken me countless hours of hard work, research, and dedication to develop, and I sincerely hope it adds value to your work.\n\nIf you find this template helpful, I kindly ask you to consider supporting my efforts. Your support will help me continue improving and creating more valuable resources.\n\nYou can contribute via PayPal here:\n\nhttp://paypal.me/pmptraining\n\nFor Full Course about ERPNext or Automation using AI follow below link\n\nhttp://lms.syncbricks.com\n\nAdditionally, when sharing this template, I would greatly appreciate it if you include my original information to ensure proper credit is given.\n\nThank you for your generosity and support!\nEmail : amjid@amjidali.com\nhttps://linkedin.com/in/amjidali\nhttps://syncbricks.com\nhttps://youtube.com/@syncbricks"
},
"typeVersion": 1
},
{
"id": "cfd7effc-92aa-43c6-9fc5-054b53de74a2",
"name": "Sticky Note16",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
280
],
"parameters": {
"color": 5,
"width": 248.905549047384,
"height": 654.6630436071407,
"content": "### Inquiry with Notes\nIf inquiry is having notes then only it will forward to next node."
},
"typeVersion": 1
},
{
"id": "e5b0992c-e360-4323-82cb-c7ddec45deb5",
"name": "Get Lead Data from ERPNext",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1360,
640
],
"parameters": {
"url": "=https://erpnext.syncbricks.com/api/resource/Lead/{{ $('Source Website and Status Open').item.json.body.name }}",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "erpNextApi"
},
"credentials": {
"erpNextApi": {
"id": "PInpnsxvPkvaiW0z",
"name": "ERPNext account"
}
},
"typeVersion": 4.2
},
{
"id": "87508043-baf5-4fa6-aa38-0f06881dc267",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
280,
280
],
"parameters": {
"color": 3,
"width": 302.58963031819115,
"height": 660,
"content": "### Prepare for Email\nThis node will get approprate Fields for Email \nEmail Addresses:\nSubject : \nEmail Body : "
},
"typeVersion": 1
},
{
"id": "2b4c1e91-c64b-43cb-aba2-c6f8f5a17c79",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-2300,
640
],
"webhookId": "a39ea4e2-99b7-4ae1-baff-9fb370333e2a",
"parameters": {
"path": "new-lead-generated-in-erpnext",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2
}
],
"pinData": {},
"connections": {
"Webhook": {
"main": [
[
{
"node": "Source Website and Status Open",
"type": "main",
"index": 0
}
]
]
},
"Lead Body": {
"main": [
[
{
"node": "Get Lead Data from ERPNext",
"type": "main",
"index": 0
}
]
]
},
"Abbriviations": {
"ai_tool": [
[
{
"node": "Customer Lead AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Company Profile": {
"ai_tool": [
[
{
"node": "Customer Lead AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Company Policies": {
"ai_tool": [
[
{
"node": "Customer Lead AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Inquiry has Notes": {
"main": [
[
{
"node": "Customer Lead AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Inquiry is Valid?": {
"main": [
[
{
"node": "Fields for Outlook",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Customer Lead AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Fields for Outlook": {
"main": [
[
{
"node": "Email Body Text Generated by AI",
"type": "main",
"index": 0
}
]
]
},
"Customer Lead AI Agent": {
"main": [
[
{
"node": "Inquiry is Valid?",
"type": "main",
"index": 0
}
]
]
},
"Email Body for Outlook": {
"main": [
[
{
"node": "Microsoft Outlook",
"type": "main",
"index": 0
}
]
]
},
"Company Contact Database": {
"ai_tool": [
[
{
"node": "Customer Lead AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Lead Data from ERPNext": {
"main": [
[
{
"node": "Inquiry has Notes",
"type": "main",
"index": 0
}
]
]
},
"Source Website and Status Open": {
"main": [
[
{
"node": "Lead Body",
"type": "main",
"index": 0
}
]
]
},
"Email Body Text Generated by AI": {
"main": [
[
{
"node": "Email Body for Outlook",
"type": "main",
"index": 0
}
]
]
}
}
}AI-Driven Lead Management and Inquiry Automation with ERPNext & n8n