-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathBusiness Analysis Workflow - AI Marketing Hub.json
More file actions
1933 lines (1933 loc) · 89.6 KB
/
Copy pathBusiness Analysis Workflow - AI Marketing Hub.json
File metadata and controls
1933 lines (1933 loc) · 89.6 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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"name": "Business Analysis Pro Workflow Free (20 Oct 2025)",
"nodes": [
{
"parameters": {
"jsCode": "// --- Data Mappings ---\n// This object maps the country name from the form to the DataForSEO location_code.\nconst countryToLocationCode = {\n \"Albania\": 2008, \"Algeria\": 2012, \"Angola\": 2024, \"Argentina\": 2032,\n \"Armenia\": 2051, \"Australia\": 2036, \"Austria\": 2040, \"Azerbaijan\": 2031,\n \"Bahrain\": 2048, \"Bangladesh\": 2050, \"Belgium\": 2056, \"Bolivia\": 2068,\n \"Bosnia and Herzegovina\": 2070, \"Brazil\": 2076, \"Bulgaria\": 2100,\n \"Burkina Faso\": 2854, \"Cambodia\": 2116, \"Cameroon\": 2120, \"Canada\": 2124,\n \"Chile\": 2152, \"Colombia\": 2170, \"Costa Rica\": 2188, \"Cote d'Ivoire\": 2384,\n \"Croatia\": 2191, \"Cyprus\": 2196, \"Czechia\": 2203, \"Denmark\": 2208,\n \"Ecuador\": 2218, \"Egypt\": 2818, \"El Salvador\": 2222, \"Estonia\": 2233,\n \"Finland\": 2246, \"France\": 2250, \"Germany\": 2276, \"Ghana\": 2288,\n \"Greece\": 2300, \"Guatemala\": 2320, \"Hong Kong\": 2344, \"Hungary\": 2348,\n \"India\": 2356, \"Indonesia\": 2360, \"Ireland\": 2372, \"Israel\": 2376,\n \"Italy\": 2380, \"Japan\": 2392, \"Jordan\": 2400, \"Kazakhstan\": 2398,\n \"Kenya\": 2404, \"Latvia\": 2428, \"Lithuania\": 2440, \"Malaysia\": 2458,\n \"Malta\": 2470, \"Mexico\": 2484, \"Moldova\": 2498, \"Monaco\": 2492,\n \"Morocco\": 2504, \"Myanmar (Burma)\": 2104, \"Netherlands\": 2528,\n \"New Zealand\": 2554, \"Nicaragua\": 2558, \"Nigeria\": 2566,\n \"North Macedonia\": 2807, \"Norway\": 2578, \"Pakistan\": 2586, \"Panama\": 2591,\n \"Paraguay\": 2600, \"Peru\": 2604, \"Philippines\": 2608, \"Poland\": 2616,\n \"Portugal\": 2620, \"Romania\": 2642, \"Saudi Arabia\": 2682, \"Senegal\": 2686,\n \"Serbia\": 2688, \"Singapore\": 2702, \"Slovakia\": 2703, \"Slovenia\": 2705,\n \"South Africa\": 2710, \"South Korea\": 2410, \"Spain\": 2724, \"Sri Lanka\": 2144,\n \"Sweden\": 2752, \"Switzerland\": 2756, \"Taiwan\": 2158, \"Thailand\": 2764,\n \"Tunisia\": 2788, \"Turkiye\": 2792, \"Ukraine\": 2804,\n \"United Arab Emirates\": 2784, \"United Kingdom\": 2826, \"United States\": 2840,\n \"Uruguay\": 2858, \"Venezuela\": 2862, \"Vietnam\": 2704\n};\n\n// This object maps the language name from the form to the DataForSEO language_code.\nconst languageToLanguageCode = {\n \"Albanian\": \"sq\", \"Arabic\": \"ar\", \"Armenian\": \"hy\", \"Azeri\": \"az\",\n \"Bengali\": \"bn\", \"Bosnian\": \"bs\", \"Bulgarian\": \"bg\",\n \"Chinese (Simplified)\": \"zh-CN\", \"Chinese (Traditional)\": \"zh-TW\",\n \"Croatian\": \"hr\", \"Czech\": \"cs\", \"Danish\": \"da\", \"Dutch\": \"nl\",\n \"English\": \"en\", \"Estonian\": \"et\", \"Finnish\": \"fi\", \"French\": \"fr\",\n \"German\": \"de\", \"Greek\": \"el\", \"Hebrew\": \"he\", \"Hindi\": \"hi\",\n \"Hungarian\": \"hu\", \"Indonesian\": \"id\", \"Italian\": \"it\", \"Japanese\": \"ja\",\n \"Korean\": \"ko\", \"Latvian\": \"lv\", \"Lithuanian\": \"lt\", \"Macedonian\": \"mk\",\n \"Malay\": \"ms\", \"Norwegian (Bokmål)\": \"nb\", \"Polish\": \"pl\",\n \"Portuguese\": \"pt\", \"Romanian\": \"ro\", \"Russian\": \"ru\", \"Serbian\": \"sr\",\n \"Slovak\": \"sk\", \"Slovenian\": \"sl\", \"Spanish\": \"es\", \"Swedish\": \"sv\",\n \"Tagalog\": \"tl\", \"Thai\": \"th\", \"Turkish\": \"tr\", \"Ukrainian\": \"uk\",\n \"Urdu\": \"ur\", \"Vietnamese\": \"vi\"\n};\n\n// --- Main Logic ---\n// This loop goes through each item (form submission) sent to the node.\nfor (const item of items) {\n // Get the country and language names from the incoming JSON data.\n const countryName = item.json.Country;\n const languageName = item.json.Language;\n\n // Find the corresponding codes from the mapping objects.\n // If a match isn't found, it will result in 'null'.\n const locationCode = countryToLocationCode[countryName] ?? null;\n const languageCode = languageToLanguageCode[languageName] ?? null;\n\n // Add the new code fields to the JSON object.\n item.json.location_code = locationCode;\n item.json.language_code = languageCode;\n}\n\n// Return the modified items to be used in the next node.\nreturn items;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-256,
-736
],
"id": "8af420dc-ed2e-47b0-8f6e-55fa7d544fed",
"name": "Get Country & Language Code"
},
{
"parameters": {
"formTitle": "Page SEO/GEO Check",
"formFields": {
"values": [
{
"fieldLabel": "Page URL",
"placeholder": "example.com"
},
{
"fieldLabel": "Country",
"fieldType": "dropdown",
"fieldOptions": {
"values": [
{
"option": "Australia"
},
{
"option": "Austria"
},
{
"option": "Bahrain"
},
{
"option": "Bangladesh"
},
{
"option": "Belgium"
},
{
"option": "Brazil"
},
{
"option": "Bulgaria"
},
{
"option": "Canada"
},
{
"option": "Chile"
},
{
"option": "Colombia"
},
{
"option": "Croatia"
},
{
"option": "Cyprus"
},
{
"option": "Czechia"
},
{
"option": "Denmark"
},
{
"option": "Egypt"
},
{
"option": "Estonia"
},
{
"option": "Finland"
},
{
"option": "France"
},
{
"option": "Germany"
},
{
"option": "Greece"
},
{
"option": "Hong Kong"
},
{
"option": "Hungary"
},
{
"option": "India"
},
{
"option": "Indonesia"
},
{
"option": "Ireland"
},
{
"option": "Israel"
},
{
"option": "Italy"
},
{
"option": "Japan"
},
{
"option": "Jordan"
},
{
"option": "Kazakhstan"
},
{
"option": "Kenya"
},
{
"option": "Malaysia"
},
{
"option": "Mexico"
},
{
"option": "Morocco"
},
{
"option": "Netherlands"
},
{
"option": "New Zealand"
},
{
"option": "Nigeria"
},
{
"option": "Norway"
},
{
"option": "Pakistan"
},
{
"option": "Philippines"
},
{
"option": "Poland"
},
{
"option": "Portugal"
},
{
"option": "Romania"
},
{
"option": "Saudi Arabia"
},
{
"option": "Serbia"
},
{
"option": "Singapore"
},
{
"option": "South Africa"
},
{
"option": "South Korea"
},
{
"option": "Spain"
},
{
"option": "Sri Lanka"
},
{
"option": "Sweden"
},
{
"option": "Switzerland"
},
{
"option": "Taiwan"
},
{
"option": "Thailand"
},
{
"option": "Tunisia"
},
{
"option": "Turkiye"
},
{
"option": "Ukraine"
},
{
"option": "United Arab Emirates"
},
{
"option": "United Kingdom"
},
{
"option": "United States"
},
{
"option": "Vietnam"
}
]
}
},
{
"fieldLabel": "Language",
"fieldType": "dropdown",
"fieldOptions": {
"values": [
{
"option": "Arabic"
},
{
"option": "Bengali"
},
{
"option": "Bulgarian"
},
{
"option": "Chinese (Simplified)"
},
{
"option": "Chinese (Traditional)"
},
{
"option": "Croatian"
},
{
"option": "Czech"
},
{
"option": "Danish"
},
{
"option": "Dutch"
},
{
"option": "English"
},
{
"option": "Estonian"
},
{
"option": "Finnish"
},
{
"option": "French"
},
{
"option": "German"
},
{
"option": "Greek"
},
{
"option": "Hebrew"
},
{
"option": "Hindi"
},
{
"option": "Hungarian"
},
{
"option": "Indonesian"
},
{
"option": "Italian"
},
{
"option": "Japanese"
},
{
"option": "Korean"
},
{
"option": "Macedonian"
},
{
"option": "Malay"
},
{
"option": "Norwegian (Bokmål)"
},
{
"option": "Polish"
},
{
"option": "Portuguese"
},
{
"option": "Romanian"
},
{
"option": "Russian"
},
{
"option": "Serbian"
},
{
"option": "Slovak"
},
{
"option": "Spanish"
},
{
"option": "Swedish"
},
{
"option": "Tagalog"
},
{
"option": "Thai"
},
{
"option": "Turkish"
},
{
"option": "Ukrainian"
},
{
"option": "Urdu"
},
{
"option": "Vietnamese"
}
]
}
}
]
},
"options": {}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
-448,
-736
],
"id": "450235a2-4696-4ce0-bff4-231115c20a01",
"name": "Submit Form",
"webhookId": "YOUR-WEBHOOK-ID-HERE"
},
{
"parameters": {
"content": "## -> Get all Data and prepare report",
"height": 256,
"width": 1024,
"color": 2
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
496,
-816
],
"id": "7a165840-1ab6-4360-9363-f538dbebcecc",
"name": "Sticky Note4"
},
{
"parameters": {
"content": "# -> Input",
"height": 256,
"width": 576,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-512,
-816
],
"id": "dae48f45-737a-48ff-92d5-a6109597715a",
"name": "Sticky Note2"
},
{
"parameters": {
"toolDescription": "Makes an HTTP request and returns the response data. \nCorrect input example: \"https://example.com\"",
"method": "POST",
"url": "https://api.firecrawl.dev/v1/scrape",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer YOUR-API-KEY"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"url\": \"{{ $fromAI('url_search') }}\",\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"parsePDF\": false,\n \"maxAge\": 14400000\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequestTool",
"typeVersion": 4.2,
"position": [
480,
-960
],
"id": "c718850e-d68e-4b5f-bd0b-22293d3b6dbf",
"name": "URL_search"
},
{
"parameters": {
"content": "## Business Intelligence Analysis",
"height": 256,
"width": 400,
"color": 6
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
80,
-816
],
"id": "112cec77-0d79-4d87-95a8-55d200a87caa",
"name": "Sticky Note7"
},
{
"parameters": {
"jsCode": "// n8n Function node\n// Generate a random session ID like cc##### (5 digits)\n\nconst randomNumber = Math.floor(10000 + Math.random() * 90000); // Ensures 5 digits\nconst sessionId = `cc${randomNumber}`;\n\nreturn [\n {\n json: {\n session_id: sessionId\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-80,
-736
],
"id": "08e140ba-2b71-49b0-b11c-11e296802250",
"name": "Session ID"
},
{
"parameters": {
"dataTableId": {
"__rl": true,
"value": "wa0kkSaygUdBVzcF",
"mode": "list",
"cachedResultName": "Business Data",
"cachedResultUrl": "/projects/6s3sOILcGEL9TSZr/datatables/wa0kkSaygUdBVzcF"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"session_id": "={{ $('Session ID').item.json.session_id }}",
"client_name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('client_name', ``, 'string') }}",
"client_country": "={{ $('Submit Form').item.json.Country }}",
"client_language": "={{ $('Submit Form').item.json.Language }}",
"client_website": "={{ $('Submit Form').item.json['Page URL'] }}",
"client_description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('client_description', ``, 'string') }}",
"target_audience_personas": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('target_audience_personas', ``, 'string') }}",
"brand_personality_matrix": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('brand_personality_matrix', ``, 'string') }}",
"unique_value_proposition": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('unique_value_proposition', ``, 'string') }}",
"people_ask": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('people_ask', ``, 'string') }}",
"customer_journey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('customer_journey', ``, 'string') }}",
"customer_persona_trait": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('customer_persona_trait', ``, 'string') }}",
"eeat_signal_integration": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('eeat_signal_integration', ``, 'string') }}",
"GEO_tactic": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('GEO_tactic', ``, 'string') }}",
"call_to_action": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('call_to_action', ``, 'string') }}"
},
"matchingColumns": [],
"schema": [
{
"id": "session_id",
"displayName": "session_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "client_name",
"displayName": "client_name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "client_country",
"displayName": "client_country",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "client_language",
"displayName": "client_language",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "client_website",
"displayName": "client_website",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "client_description",
"displayName": "client_description",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "target_audience_personas",
"displayName": "target_audience_personas",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "brand_personality_matrix",
"displayName": "brand_personality_matrix",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "unique_value_proposition",
"displayName": "unique_value_proposition",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "people_ask",
"displayName": "people_ask",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "customer_journey",
"displayName": "customer_journey",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "customer_persona_trait",
"displayName": "customer_persona_trait",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "eeat_signal_integration",
"displayName": "eeat_signal_integration",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "GEO_tactic",
"displayName": "GEO_tactic",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "call_to_action",
"displayName": "call_to_action",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.dataTableTool",
"typeVersion": 1,
"position": [
640,
-960
],
"id": "172fa273-fc9e-4412-928c-ea59481d0678",
"name": "insert_row_in_data_table"
},
{
"parameters": {
"messages": {
"message": [
{
"content": "=You are Perplexity, a helpful search assistant trained by Perplexity AI.\n\n## Your Mission\nWrite an accurate, detailed, and comprehensive answer to the user's query using the provided search results. Your answer must be correct, high-quality, and written by an expert using an unbiased and journalistic tone.\n\n## Context Awareness\n**Date:** {{ $now }} \n**Market Focus:** {{ $('Submit Form').item.json.Country }} \n**Language:** {{ $('Submit Form').item.json.Language }}\n\n**CRITICAL:** Write your entire answer in {{ $('Submit Form').item.json.Language }}. All content, explanations, and analysis must be in this language.\n\n## Search Results Usage\n- Your answer must be informed by the provided \"Search results\"\n- Use only the information from search results and your existing knowledge\n- Answer must be self-contained and respond fully to the query\n- If search results are empty or unhelpful, answer with existing knowledge\n- If you don't know the answer or the premise is incorrect, explain why\n\n## Citation Requirements\n- Cite search results using [index] at the end of sentences when needed\n- Example: \"Ice is less dense than water[1][2].\"\n- NO SPACE between the last word and the citation\n- Cite the most relevant results that answer the query\n- Avoid citing irrelevant results\n- Do not cite more than three results per sentence\n- Omit bibliographies at the end of answers\n\n## Markdown Formatting\n\n### Headers and Structure\n- Use level 2 headers (##) for main sections\n- Use bolding (****) for subsections\n- Never start your answer with a header\n- Use single new lines for list items and double new lines for paragraphs\n\n### Lists\n- Prefer unordered lists\n- Only use ordered lists (numbered) when presenting ranks or if it makes sense\n- NEVER mix ordered and unordered lists\n- Do NOT nest lists together\n\n### Code and Math\n- Use markdown code blocks for code snippets, including the language for syntax highlighting\n- Wrap all math expressions in LaTeX using \\( \\) for inline and \\[ \\] for block formulas\n- Example: \\(x^4 = x - 3\\)\n- Never use single dollar signs ($) for LaTeX expressions\n- Never use the \\\\label instruction in LaTeX\n\n### Style\n- Bold text sparingly, primarily for emphasis within paragraphs\n- Use italics for terms or phrases that need highlighting without strong emphasis\n- Maintain a clear visual hierarchy:\n - Level 2 Main headers (##): Large\n - Bolded Subheaders (****): Slightly smaller, bolded\n - List items: Regular size, no bold\n - Paragraph text: Regular size, no bold\n\n### Other Guidelines\n- Use markdown to format paragraphs, tables, and quotes when applicable\n- When comparing things (vs), format the comparison as a markdown table instead of a list\n- Do not include URLs or links in the answer\n- Use tables for comparisons—they are much more readable than lists\n\n## Content Guidelines\n- Skip the preamble and just provide the answer without telling the user what you are doing\n- Be concise and direct\n- Avoid repeating copyrighted content verbatim (e.g., song lyrics, news articles, book passages)\n- Only answer with original text\n- Never directly output song lyrics\n- Write in {{ $('Submit Form').item.json.Language }}\n\n## Market Context\nWhen answering queries related to business, marketing, or competitive analysis:\n- Focus on {{ $('Submit Form').item.json.Country }} market context\n- Use local terminology and examples relevant to {{ $('Submit Form').item.json.Country }}\n- Consider local business practices, regulations, and consumer behavior\n- Provide insights specific to the {{ $('Submit Form').item.json.Country }} market when applicable\n\nNow provide your answer.",
"role": "system"
},
{
"content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('message1_Text', ``, 'string') }}"
}
]
},
"options": {
"returnRelatedQuestions": true
},
"requestOptions": {}
},
"type": "n8n-nodes-base.perplexityTool",
"typeVersion": 1,
"position": [
160,
-960
],
"id": "90eaf99e-ff09-49d5-becb-506bb16ef71d",
"name": "online_Search",
"credentials": {
"perplexityApi": {
"id": "zYJVzWohvdoOiRYB",
"name": "Perplexity account"
}
}
},
{
"parameters": {
"content": "",
"height": 176,
"width": 272,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
672,
-544
],
"id": "78325ee1-e0ce-4245-93fb-62ea2d56fbef",
"name": "Sticky Note3"
},
{
"parameters": {
"content": "",
"height": 176,
"width": 1296,
"color": 6
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-512,
-1008
],
"id": "ee161257-36b1-4d09-a4be-187f7000dc88",
"name": "Sticky Note8"
},
{
"parameters": {
"content": "**Workflow created by [@AgriciDaniel](https://www.youtube.com/@AgriciDaniel)**\n* [AI Marketing Hub](https://www.skool.com/ai-marketing-hub)\n* [AI Marketing Hub Pro](https://www.skool.com/ai-marketing-hub-pro)",
"height": 96,
"width": 272,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
672,
-384
],
"id": "631ea8bc-c63b-4d10-a4a0-9b5b64091f2f",
"name": "Sticky Note9"
},
{
"parameters": {
"description": "Call this tool for SERP data.",
"workflowId": {
"__rl": true,
"value": "VjpOW2V2aNV9HpQJ",
"mode": "list",
"cachedResultUrl": "/workflow/VjpOW2V2aNV9HpQJ",
"cachedResultName": "Laboratory — Business Analysis Workflow Tools"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"function": "serp_search",
"keyword": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('keyword', ``, 'string') }}",
"location_code": "={{ $('Get Country & Language Code').item.json.location_code }}",
"language_code": "={{ $('Get Country & Language Code').item.json.language_code }}"
},
"matchingColumns": [],
"schema": [
{
"id": "function",
"displayName": "function",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "keyword",
"displayName": "keyword",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": true
},
{
"id": "location_code",
"displayName": "location_code",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "language_code",
"displayName": "language_code",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2.2,
"position": [
-160,
-960
],
"id": "95559e77-0a13-4f60-bfa2-7f7d30aba442",
"name": "serp_Search"
},
{
"parameters": {
"description": "Call this tool for AI mode SERP data.",
"workflowId": {
"__rl": true,
"value": "VjpOW2V2aNV9HpQJ",
"mode": "list",
"cachedResultUrl": "/workflow/VjpOW2V2aNV9HpQJ",
"cachedResultName": "Laboratory — Business Analysis Workflow Tools"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"function": "ai_mode",
"keyword": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('keyword', ``, 'string') }}",
"location_code": "={{ $('Get Country & Language Code').item.json.location_code }}",
"language_code": "={{ $('Get Country & Language Code').item.json.language_code }}"
},
"matchingColumns": [],
"schema": [
{
"id": "function",
"displayName": "function",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "keyword",
"displayName": "keyword",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": true
},
{
"id": "location_code",
"displayName": "location_code",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "language_code",
"displayName": "language_code",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2.2,
"position": [
0,
-960
],
"id": "7f8e6f17-b0ac-4229-b22b-a6cb40e50c7f",
"name": "ai_Mode"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.toolThink",
"typeVersion": 1.1,
"position": [
-480,
-960
],
"id": "a812c74c-143f-491a-86ab-f6f9daf1e40d",
"name": "Think_tool"
},
{
"parameters": {
"model": "sonar-pro",
"messages": {
"message": [
{
"content": "=You are Perplexity, an expert research assistant trained by Perplexity AI, specialized in conducting comprehensive, in-depth research.\n\n## Your Mission\nConduct thorough, multi-source research to provide a comprehensive, expert-level analysis of the user's query. Your research should be exhaustive, well-structured, and actionable.\n\n## Context Awareness\n**Date:** {{ $now }} \n**Market Focus:** {{ $('Submit Form').item.json.Country }} \n**Language:** {{ $('Submit Form').item.json.Language }}\n\n**CRITICAL:** Write your entire research report in {{ $('Submit Form').item.json.Language }}. All content, analysis, insights, and recommendations must be in this language.\n\n## Research Depth Requirements\n- Explore the topic from multiple angles and perspectives\n- Synthesize information from diverse, credible sources\n- Identify patterns, trends, and insights across sources\n- Provide strategic analysis, not just information summary\n- Include both quantitative data and qualitative insights\n- Address potential counterarguments or alternative viewpoints\n- Offer actionable recommendations based on findings\n\n## Market-Specific Research Focus\nWhen researching business, competitive, or market-related topics:\n- **Prioritize {{ $('Submit Form').item.json.Country }}-specific data and insights**\n- Analyze local market dynamics, regulations, and consumer behavior\n- Compare local practices with international benchmarks when relevant\n- Identify opportunities and challenges specific to {{ $('Submit Form').item.json.Country }}\n- Use local case studies and examples\n- Consider cultural and economic factors unique to the market\n- Provide localized strategic recommendations\n\n## Citation Requirements\n- Cite all sources using [index] at the end of sentences\n- Example: \"Market research indicates strong growth in e-commerce[1][3].\"\n- NO SPACE between the last word and the citation\n- Cite multiple sources for key claims to show consensus\n- Use citations throughout the report, not just at the end\n- Do not cite more than three results per sentence\n- Prioritize citing original, authoritative sources over aggregators\n\n## Report Structure\n\nYour deep research report should follow this structure:\n\n### Executive Summary (Optional)\n- 2-3 sentence overview of key findings\n- Only include for complex topics requiring summary\n\n### Main Analysis\n- Use level 2 headers (##) for major sections\n- Use bolding (****) for subsections within those sections\n- Organize information logically (e.g., by theme, chronology, or priority)\n- Never start with a header—begin with direct analysis\n\n### Key Insights\n- Highlight the most important findings\n- Connect dots between different pieces of information\n- Identify patterns and trends\n\n### Strategic Recommendations (When Applicable)\n- Provide 3-5 actionable recommendations based on research\n- Explain the rationale behind each recommendation\n- Consider feasibility for {{ $('Submit Form').item.json.Country }} market\n\n## Markdown Formatting\n\n### Headers and Structure\n- Use level 2 headers (##) for main sections\n- Use bolding (****) for subsections\n- Use single new lines for list items and double new lines for paragraphs\n- Maintain clear visual hierarchy throughout\n\n### Lists and Tables\n- Prefer unordered lists for most content\n- Use ordered lists only for rankings, steps, or priorities\n- NEVER mix ordered and unordered lists\n- Use markdown tables for comparisons—much more readable than lists\n- Format vs comparisons as tables with clear columns\n\n### Code and Math\n- Use markdown code blocks with language specification for syntax highlighting\n- Wrap math expressions in LaTeX: \\( \\) for inline, \\[ \\] for block\n- Never use single dollar signs ($) for LaTeX\n- Never use the \\\\label instruction\n\n### Style and Emphasis\n- Bold sparingly for key terms and critical insights\n- Use italics for terms needing subtle emphasis\n- Keep visual hierarchy clear: Level 2 headers > Bolded subheaders > Body text\n- Use tables to organize complex comparative data\n\n### Content Guidelines\n- Do not include URLs or links in the report\n- Omit bibliographies at the end\n- Be comprehensive but concise—every sentence should add value\n- Skip preambles—start directly with analysis\n- Avoid repeating copyrighted content verbatim\n- Never directly output song lyrics or extensive quoted material\n\n## Quality Standards\n\n### Depth\n- Go beyond surface-level information\n- Explain the \"why\" and \"how,\" not just the \"what\"\n- Connect research findings to broader implications\n\n### Accuracy\n- Verify information across multiple sources when possible\n- Note when sources conflict and explain why\n- Acknowledge limitations or gaps in available data\n\n### Relevance\n- Stay focused on answering the original query\n- Filter out tangential information\n- Prioritize insights most valuable to {{ $('Submit Form').item.json.Country }} market\n\n### Tone\n- Expert-level analysis with journalistic objectivity\n- Unbiased presentation of findings\n- Clear, professional language in {{ $('Submit Form').item.json.Language }}\n- Accessible to non-experts while maintaining rigor\n\n## Special Instructions for Competitive/Business Research\n\nWhen conducting competitive or business intelligence research:\n\n1. **Market Landscape:** Map out the competitive environment in {{ $('Submit Form').item.json.Country }}\n2. **Key Players:** Identify and analyze major competitors with market-specific focus\n3. **Trends & Dynamics:** Highlight emerging trends affecting the {{ $('Submit Form').item.json.Country }} market\n4. **Opportunities & Threats:** Use local market context to identify strategic opportunities\n5. **Benchmarking:** Compare against both local and international standards when relevant\n6. **Actionability:** Ensure all insights can be translated into business decisions\n\n## Edge Cases\n- If search results are insufficient, supplement with existing knowledge while noting limitations\n- If the premise of the query is incorrect, explain why and provide correct context\n- If there are multiple valid interpretations, address the most relevant one for {{ $('Submit Form').item.json.Country }} market\n\nRemember: This is DEEP research. Your goal is to provide comprehensive, strategic, expert-level analysis that goes significantly beyond what a simple search would reveal. Write entirely in {{ $('Submit Form').item.json.Language }}.\n\nNow conduct your deep research.",
"role": "system"
},
{
"content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('message1_Text', ``, 'string') }}"
}
]
},
"options": {
"returnRelatedQuestions": true
},
"requestOptions": {}
},
"type": "n8n-nodes-base.perplexityTool",
"typeVersion": 1,
"position": [
320,
-960
],
"id": "1c71a132-6f09-4c04-aa64-7b1856f0ff84",
"name": "deep_research",
"credentials": {
"perplexityApi": {
"id": "zYJVzWohvdoOiRYB",
"name": "Perplexity account"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "models/gemini-2.5-pro",
"mode": "list",
"cachedResultName": "models/gemini-2.5-pro"
},
"messages": {
"values": [
{
"content": "=# Business Data Intelligence Agent\n\n**Model Configuration:** Temperature: 0.2 | Top-P: 0.85 | Max Tokens: 4000\n\n---\n\n## Mission\n\nExtract 14 business intelligence fields from the client's website and save to database via `insert_row_in_data_table`.\n\n**Current Context:**\n- **Date:** {{ $now.toFormat(\"dd LLLL yyyy\") }}\n- **Page URL:** {{ $('Submit Form').item.json['Page URL'] }}\n- **Market:** {{ $('Submit Form').item.json.Country }}\n- **Language:** {{ $('Submit Form').item.json.Language }}\n\n**Success = All 14 fields saved to database**\n\n---\n\n## Core Execution Pattern\n\n**MANDATORY SEQUENCE - Execute in exact order:**\n\n```\n1. URL_search (scrape website)\n2. get_internal_links (discover site structure)\n3. think_tool (synthesize core data)\n4. online_Search (brand research in target language)\n5. think_tool (brand analysis)\n6. deep_research (audience + market in target language)\n7. serp_Search OR ai_Mode (competitor keywords)\n8. think_tool (customer intelligence)\n9. think_tool (quality validation - ALL 14 fields)\n10. insert_row_in_data_table (save to database)\n```\n\n---\n\n## Few-Shot Examples: Correct Execution\n\n### Example 1: Core Data Extraction Pattern\n\n**Input Prefix:** WEBSITE_SCRAPE\n\n**Output Prefix:** CORE_DATA_EXTRACTION\n\n```\n✅ CORRECT Extraction:\nAfter URL_search returns website content:\n\n\"CORE DATA EXTRACTED:\n\nclient_name: [Found in header/title - exact business name]\nclient_website: [Clean domain only - no https://, no www]\nExample: 'acmecorp.com' NOT 'https://www.acmecorp.com'\n\nclient_description (2-4 sentences):\n'[Business Name] provides [specific services] to [target market] in [geographic area]. Founded in [year if available], the company specializes in [key differentiator]. They serve [customer segment] with [unique approach].'\n\ncall_to_action: '[Exact CTA button text from website]'\nExamples: 'Get Started', 'Request Quote', 'Contact Us', 'Buy Now'\n\nSource: [which page/section - homepage/about/hero]\"\n\n❌ WRONG Extraction:\n\"Found the business name. Moving to next step.\"\n[No actual extraction, no format validation, no source documentation]\n```\n\n### Example 2: Internal Links Analysis\n\n**Input Prefix:** SITE_STRUCTURE\n\n**Output Prefix:** NAVIGATION_ANALYSIS\n\n```\n✅ CORRECT Analysis:\nAfter get_internal_links returns links:\n\n\"INTERNAL STRUCTURE ANALYSIS:\n\nTotal links found: 23\n\nKey pages identified:\n- About: [URL] - '[Title/description if available]'\n- Services: [URL] - '[Title/description]'\n- Team: [URL] - '[Title/description]'\n- Blog: [URL] - '[Title/description]'\n- Contact: [URL] - '[Title/description]'\n\nStrategic value:\n- About page: Will use for client_description, eeat_signal_integration\n- Services page: Will use for unique_value_proposition\n- Blog: Evidence for eeat_signal_integration\n- Team page: Credentials for eeat_signal_integration\n\nPriority scrape targets: [About, Services] for deeper intelligence\n\nNote: [Some links have no title/description - will identify by URL pattern]\"\n\n❌ WRONG Analysis:\n\"Got the internal links.\"\n[No categorization, no strategic planning for which pages to use]\n```\n\n### Example 3: customer_journey Format (CRITICAL)\n\n**Input Prefix:** JOURNEY_MAPPING\n\n**Output Prefix:** FORMATTED_JOURNEY\n\n```\n✅ CORRECT Format (uses \\n):\n\"customer_journey\": \"Awareness: Potential customers discover the business through local search, social media recommendations, and word-of-mouth referrals from satisfied clients.\\nConsideration: They compare services by reviewing the website portfolio, reading customer testimonials, and requesting initial consultations to assess expertise.\\nPurchase: Decision is made based on transparent pricing, professional communication, proven track record, and alignment with their specific project needs.\\nLoyalty: Customers return due to consistent quality, reliable service delivery, ongoing support, and the relationship built during initial projects.\"\n\n❌ WRONG Formats:\n\"Awareness (discovery), Consideration (evaluation), Purchase (decision), Loyalty (retention)\"\n[Uses parentheses and commas instead of \\n]\n\n\"Awareness: discovery\\n\\nConsideration: evaluation\"\n[Double newlines or missing stages]\n\n\"1. Awareness: discovery 2. Consideration: evaluation\"\n[Numbered list format]\n```\n\n### Example 4: people_ask Format (CRITICAL)\n\n**Input Prefix:** QUESTION_EXTRACTION\n\n**Output Prefix:** FORMATTED_QUESTIONS\n\n```\n✅ CORRECT Format (numbered with \\n separator):\n\"people_ask\": \"1. What services does the business offer?\\n2. How long has the company been operating?\\n3. What areas do they serve?\\n4. What makes them different from competitors?\\n5. How can I request a consultation?\"\n\nMust be:\n- Numbered format (1-5)\n- Uses \\n separator between questions\n- Exactly 5 questions (not 3, not 7)\n- Each ends with \"?\"\n- Questions in target language if not English\n\n❌ WRONG Formats:\n\"people_ask\": \"[\\\"Question 1?\\\", \\\"Question 2?\\\", \\\"Question 3?\\\"]\"\n[JSON format - old format, only 3 questions]\n\n\"people_ask\": \"What services? How long operating? What areas?\"\n[No numbers, no question marks, not 5 questions]\n\n\"people_ask\": \"1. Q1? 2. Q2? 3. Q3? 4. Q4? 5. Q5? 6. Q6?\"\n[6 questions instead of exactly 5, no \\n separator]\n```\n\n### Example 5: Quality Validation Pattern\n\n**Input Prefix:** PRE_SAVE_CHECK\n\n**Output Prefix:** VALIDATION_RESULTS\n\n```\n✅ CORRECT Validation:\n\"QUALITY VALIDATION:\n\n1. client_description: ✓\n - 2-4 sentences: YES (3 sentences)\n - Includes services: YES\n - Includes geographic area: YES\n - Includes differentiator: YES\n\n2. brand_personality_matrix: ✓\n - Exactly 5 traits: YES (Professional, Trustworthy, Local, Experienced, Customer-focused)\n - Format: Trait1, Trait2, Trait3, Trait4, Trait5\n\n3. people_ask: ✓\n - Numbered format (1-5): YES\n - Uses \\n separator: YES\n - Exactly 5 questions: YES\n - All end with '?': YES\n\n4. customer_journey: ✓\n - Uses \\n separator: YES\n - Has 4 stages: YES (Awareness, Consideration, Purchase, Loyalty)\n - No parentheses/commas: YES\n\n5. customer_persona_trait: ✓\n - 4-6 sentences: YES (5 sentences)\n - Has name, age, occupation, city: YES\n\n6. GEO_tactic: ✓\n - 3-5 competitor keywords: YES (4 keywords)\n - Keywords in [target language]: YES\n\n7. All 14 fields populated: YES\n\nREADY TO SAVE: YES\"\n\n❌ WRONG Validation:\n\"Everything looks good.\"\n[No field-by-field check, no format verification, no counts]\n```\n\n---\n\n## 14 Required Fields Specification\n\n| Field | Format | Validation Rules |\n|:------|:-------|:-----------------|\n| `client_name` | string | Official business name from website |\n| `client_country` | string | {{ $('Submit Form').item.json.Country }} (fixed) |\n| `client_language` | string | {{ $('Submit Form').item.json.Language }} (fixed) |\n| `client_website` | string | Clean domain: `example.com` (NO https://, NO www) |\n| `client_description` | string | 2-4 sentences: services + geographic area + years/founding + differentiator |\n| `target_audience_personas` | string | Demographics (age, income) + geographic location + psychographics + needs |\n| `brand_personality_matrix` | string | Exactly 5 traits: \"Trait1, Trait2, Trait3, Trait4, Trait5\" |\n| `unique_value_proposition` | string | Key differentiator vs competitors |\n| `people_ask` | string | Numbered with `\\n`: `\"1. Question one?\\n2. Question two?\\n3. Question three?\\n4. Question four?\\n5. Question five?\"` (exactly 5) |\n| `customer_journey` | string | Use `\\n` separator: `\"Awareness: [text]\\nConsideration: [text]\\nPurchase: [text]\\nLoyalty: [text]\"` |\n| `customer_persona_trait` | string | 4-6 sentences: name + age (number) + occupation + city + needs + values |\n| `eeat_signal_integration` | string | Expertise signals: blog, certifications, awards, years, credentials |\n| `GEO_tactic` | string | Scope + positioning + 3-5 competitor keywords (target language) + strategy |\n| `call_to_action` | string | Primary CTA button text from website |\n\n---\n\n## Master Execution Template\n\n**Use think_tool for ALL analysis phases. Fill relevant sections.**\n\n**Phase Identifier:** [1-Core | 2-Brand | 3-Customer | 4-Validation]\n\n```\nTHINK_TOOL_ANALYSIS:\n\n=== PHASE [X]: [Phase Name] ===\n\n[PHASE 1 - Core Data Extraction]\nWEBSITE SCRAPE ANALYSIS:\n\nFrom URL_search:\nclient_name: [extracted from header/title/about]\nclient_website: [domain only - no https/www]\nclient_description draft:\n\"[Sentence 1: services]. [Sentence 2: geographic area and years]. [Sentence 3: key differentiator].\"\ncall_to_action: [exact CTA button text]\n\nFrom get_internal_links:\nTotal links: [count]\nKey pages found:\n- About: [URL] - Use for: [which fields]\n- Services: [URL] - Use for: [which fields]\n- Team/Blog: [URL] - Use for: [eeat signals]\n- [Other relevant pages]\n\nPages to scrape deeper: [prioritized list]\n\n[PHASE 2 - Brand Analysis]\nBRAND INTELLIGENCE:\n\nFrom online_Search (in {{ $('Submit Form').item.json.Language }}):\nQuery used: \"[business name] [industry] {{ $('Submit Form').item.json.Language }}\"\n\nbrand_personality_matrix (must be exactly 5):\n1. [Trait 1 - based on tone/messaging]\n2. [Trait 2]\n3. [Trait 3]\n4. [Trait 4]\n5. [Trait 5]\nFormat: \"Trait1, Trait2, Trait3, Trait4, Trait5\"\n\nunique_value_proposition:\n\"[What makes them unique - materials/process/expertise/niche]\"\n\neeat_signal_integration:\n- Blog: [YES/NO - if yes, what topics]\n- Certifications: [list if found]\n- Awards: [list if found]\n- Years in business: [X years if found]\n- Team credentials: [if found]\nSummary: \"[Consolidated expertise signals]\"\n\n[PHASE 3 - Customer Intelligence]\nAUDIENCE & MARKET ANALYSIS:\n\nFrom deep_research (in {{ $('Submit Form').item.json.Language }}):\nQuery used: \"[business type] target audience {{ $('Submit Form').item.json.Country }} {{ $('Submit Form').item.json.Language }}\"\n\ntarget_audience_personas:\n\"[Age range: X-Y], [income level: $X-Y or economic class], [geographic: city/region/country], [psychographics: values, priorities], [specific needs: what they seek]\"\n\npeople_ask (must be exactly 5, numbered format with \\n):\nQuestion extraction approach: [how derived - from website FAQ, common queries, service pages]\n1. \"[Question 1 in target language]?\"\n2. \"[Question 2]?\"\n3. \"[Question 3]?\"\n4. \"[Question 4]?\"\n5. \"[Question 5]?\"\nFormatted output: \"1. Question one?\\n2. Question two?\\n3. Question three?\\n4. Question four?\\n5. Question five?\"\n\ncustomer_journey (must use \\n):\n- Awareness: [how they discover - channels and triggers]\n- Consideration: [how they evaluate - comparison factors]\n- Purchase: [decision factors - why they choose]\n- Loyalty: [retention factors - why they return]\nFormat: \"Awareness: [text]\\nConsideration: [text]\\nPurchase: [text]\\nLoyalty: [text]\"\n\ncustomer_persona_trait (4-6 sentences):\n\"[Name, age X, occupation] lives in [city]. [Sentence 2: their needs/challenges]. [Sentence 3: their values/priorities]. [Sentence 4: why they chose this business]. [Optional sentence 5-6: additional context].\"\n\nFrom serp_Search OR ai_Mode (in {{ $('Submit Form').item.json.Language }}):\nQuery: \"[main service/product] {{ $('Submit Form').item.json.Country }}\"\n\nGEO_tactic:\n\"Geographic Scope: [Local/Regional/National/International]\nMarket: {{ $('Submit Form').item.json.Country }} ({{ $('Submit Form').item.json.Language }})\nPositioning: [Premium/Mid-Market/Budget]\n\nCompetitor Keywords (in {{ $('Submit Form').item.json.Language }}):\n- [keyword 1]\n- [keyword 2]\n- [keyword 3]\n- [keyword 4]\n- [keyword 5]\n\nStrategy: [How to compete - specific approach based on market analysis]\"\n\n[PHASE 4 - Quality Validation]\nPRE-SAVE VALIDATION:\n\nField-by-field check:\n\n1. client_description:\n □ 2-4 sentences: [YES/NO - count: X]\n □ Services included: [YES/NO]\n □ Geographic area: [YES/NO]\n □ Differentiator: [YES/NO]\n Status: [PASS/FAIL]\n\n2. brand_personality_matrix:\n □ Exactly 5 traits: [YES/NO - count: X]\n □ Format: \"Trait1, Trait2, Trait3, Trait4, Trait5\": [YES/NO]\n Status: [PASS/FAIL]\n\n3. people_ask:\n □ Numbered format (1-5): [YES/NO]\n □ Uses \\n separator: [YES/NO]\n □ Exactly 5 questions: [YES/NO - count: X]\n □ All end with \"?\": [YES/NO]\n □ Correct language: [YES/NO]\n Status: [PASS/FAIL]\n\n4. customer_journey:\n □ Uses \\n separator: [YES/NO]\n □ No parentheses: [YES/NO]\n □ No commas as separators: [YES/NO]\n □ Has all 4 stages: [YES/NO - list them]\n Status: [PASS/FAIL]\n\n5. customer_persona_trait:\n □ 4-6 sentences: [YES/NO - count: X]\n □ Has name: [YES/NO]\n □ Has age (number): [YES/NO]\n □ Has occupation: [YES/NO]\n □ Has city: [YES/NO]\n Status: [PASS/FAIL]\n\n6. GEO_tactic:\n □ 3-5 competitor keywords: [YES/NO - count: X]\n □ Keywords in {{ $('Submit Form').item.json.Language }}: [YES/NO]\n □ Has strategy section: [YES/NO]\n Status: [PASS/FAIL]\n\n7. client_website:\n □ No https://: [YES/NO]\n □ No www: [YES/NO]\n Status: [PASS/FAIL]\n\n8. All 14 fields populated: [YES/NO]\n List any missing: [field names]\n\nOVERALL STATUS: [READY TO SAVE / NEEDS FIXES]\n\nIf NEEDS FIXES: [list specific corrections needed]\n```\n\n---\n\n## Critical Rules\n\n### ✅ ALWAYS DO:\n\n1. **Execute ALL research tools** - URL_search, get_internal_links, online_Search, deep_research, serp_Search/ai_Mode\n2. **Use think_tool after EACH research phase** - document findings immediately\n3. **Search in target language** - ALL queries must use {{ $('Submit Form').item.json.Language }}\n4. **Validate before saving** - complete PHASE 4 quality check\n5. **Use exact formats** - customer_journey with `\\n`, people_ask with numbered format and `\\n`\n6. **Clean domain format** - remove https:// and www from client_website\n7. **Count requirements** - exactly 5 traits, exactly 5 questions, 2-4 sentences, 4-6 sentences\n8. **Use get_internal_links strategically** - identify which pages have needed information\n9. **Extract from tool outputs only** - never hallucinate data\n10. **Complete full workflow** - don't stop until database insert succeeds\n\n### ❌ NEVER DO:\n\n1. Skip get_internal_links tool\n2. Use English for non-English markets\n3. Format customer_journey with parentheses or commas\n4. Provide 3 or 7 questions (must be exactly 5)\n5. Include https:// or www in client_website\n6. Save without PHASE 4 validation\n7. Use fewer or more than 5 brand traits\n8. Skip think_tool documentation phases\n9. Hallucinate data not in tool outputs\n10. Stop before successful database insert\n\n---\n\n## Execution Workflow\n\n### Step 1: Website Intelligence\n\n```\nCall URL_search with: {{ $('Submit Form').item.json['Page URL'] }}\n↓\nCall get_internal_links with: {{ $('Submit Form').item.json['Page URL'] }}\n↓\nCall think_tool → Use PHASE 1 template\n - Extract: client_name, client_website, client_description, call_to_action\n - Analyze site structure from internal links\n - Identify pages for deeper extraction (About, Services, Team, Blog)\n - Prioritize which pages to scrape for specific fields\n```\n\n### Step 2: Brand Intelligence\n\n```\nCall online_Search with query in {{ $('Submit Form').item.json.Language }}:\n \"[business name] [industry] {{ $('Submit Form').item.json.Language }}\"\n↓\nCall think_tool → Use PHASE 2 template\n - Extract: brand_personality_matrix (exactly 5 traits)\n - Extract: unique_value_proposition\n - Extract: eeat_signal_integration (from website + search)\n```\n\n### Step 3: Customer & Market Intelligence\n\n```\nCall deep_research with query in {{ $('Submit Form').item.json.Language }}:\n \"[business type] target audience {{ $('Submit Form').item.json.Country }} {{ $('Submit Form').item.json.Language }}\"\n↓\nCall serp_Search OR ai_Mode with query in {{ $('Submit Form').item.json.Language }}:\n \"[main service/product] {{ $('Submit Form').item.json.Country }}\"\n↓\nCall think_tool → Use PHASE 3 template\n - Extract: target_audience_personas\n - Extract: people_ask (exactly 5 questions, numbered format with \\n)\n - Extract: customer_journey (with \\n separator)\n - Extract: customer_persona_trait (4-6 sentences with name, age, occupation, city)\n - Extract: GEO_tactic (with 3-5 competitor keywords in target language)\n```\n\n### Step 4: Quality Validation & Database Save\n\n```\nCall think_tool → Use PHASE 4 template\n - Validate ALL 14 fields against format requirements\n - Count sentences, traits, questions\n - Verify formats (numbered with \\n, \\n separator, no https/www)\n - Check language correctness\n↓\nIf validation PASSES:\n Call insert_row_in_data_table with all 14 fields\n↓\nIf validation FAILS:\n Fix issues and re-validate before saving\n```\n\n---\n\n## Common Formatting Errors (AVOID)\n\n| ❌ Wrong | ✅ Correct |\n|:---------|:-----------|\n| `client_website: \"https://www.example.com\"` | `client_website: \"example.com\"` |\n| `people_ask: \"[\\\"Q1?\\\", \\\"Q2?\\\", \\\"Q3?\\\", \\\"Q4?\\\", \\\"Q5?\\\"]\"` (JSON format) | `people_ask: \"1. Question one?\\n2. Question two?\\n3. Question three?\\n4. Question four?\\n5. Question five?\"` |\n| `people_ask: \"1. Q1? 2. Q2? 3. Q3?\"` (only 3 questions, no \\n) | `people_ask: \"1. Q1?\\n2. Q2?\\n3. Q3?\\n4. Q4?\\n5. Q5?\"` (5 questions with \\n) |\n| `customer_journey: \"Awareness (discovery), Consideration (evaluation)\"` | `customer_journey: \"Awareness: discovery\\nConsideration: evaluation\\nPurchase: decision\\nLoyalty: retention\"` |\n| `brand_personality_matrix: \"Professional, Trustworthy, Innovative\"` (3) | `brand_personality_matrix: \"Professional, Trustworthy, Innovative, Reliable, Local\"` (5) |\n| Queries in English for Spanish market | All queries in {{ $('Submit Form').item.json.Language }} |\n| `client_description: \"They provide services.\"` (1 sentence) | `client_description: \"[2-4 sentences with services, area, years, differentiator]\"` |\n| Saving without validation | Always complete PHASE 4 validation first |\n\n---\n\n## Stop Sequences\n\n```\n---END EXTRACTION---\nANALYSIS COMPLETE\n```\n\n---\n\n## Begin Execution\n\n**Execute this EXACT workflow NOW:**\n\n```\nSTEP 1: URL_search → {{ $('Submit Form').item.json['Page URL'] }}\nSTEP 2: get_internal_links → {{ $('Submit Form').item.json['Page URL'] }}\nSTEP 3: think_tool → PHASE 1 (Core Data Extraction)\nSTEP 4: online_Search → [business research in target language]\nSTEP 5: think_tool → PHASE 2 (Brand Analysis)\nSTEP 6: deep_research → [audience research in target language]\nSTEP 7: serp_Search OR ai_Mode → [competitor keywords in target language]\nSTEP 8: think_tool → PHASE 3 (Customer Intelligence)\nSTEP 9: think_tool → PHASE 4 (Quality Validation)\nSTEP 10: insert_row_in_data_table → [all 14 fields]\n```\n[If a tool fails, try again]\n```\n\n**START NOW with STEP 1.**"
}
]
},
"simplify": false,
"options": {
"codeExecution": false,
"maxOutputTokens": 7000,
"temperature": 0.2,
"topP": 0.9,
"maxToolsIterations": 50
}
},
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"typeVersion": 1,
"position": [
160,
-736
],
"id": "efe0543d-5caf-4d83-960d-5afa121b9b39",
"name": "Business Analyst",
"credentials": {
"googlePalmApi": {
"id": "8eDMUtP7P20s67XX",
"name": "Gemini API 10/10/2025"
}
}
},
{
"parameters": {
"content": "## -> Reference data",
"height": 256,
"width": 256,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
400,
-544
],
"id": "8b7e53f4-11e5-4612-8940-63758b72d51a",
"name": "Sticky Note10"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3b9b69d8-ab3e-4ee0-b6d3-2dcfb41832ea",
"name": "session_id",
"value": "={{ $('Get Business Data').item.json.session_id }}",
"type": "string"
},
{
"id": "60ec7b85-f558-4bdf-b79d-f24907184718",
"name": "location_code",
"value": "={{ $('Get Country & Language Code').item.json.location_code }}",
"type": "number"
},
{
"id": "833bc73b-7f47-4d27-9ff5-e814028b1fe1",
"name": "language_code",
"value": "={{ $('Get Country & Language Code').item.json.language_code }}",