forked from enescingoz/awesome-n8n-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeduplicate Scraping AI Grants for Eligibility using AI.json
More file actions
891 lines (891 loc) · 34.3 KB
/
Copy pathDeduplicate Scraping AI Grants for Eligibility using AI.json
File metadata and controls
891 lines (891 loc) · 34.3 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
{
"nodes": [
{
"id": "c17e444e-0a5e-4bfe-8de6-c3185de4465d",
"name": "Grants to List",
"type": "n8n-nodes-base.splitOut",
"position": [
-240,
-180
],
"parameters": {
"options": {},
"fieldToSplitOut": "oppHits"
},
"typeVersion": 1
},
{
"id": "9251d39c-6098-42fa-aadd-3a22464dee64",
"name": "Get Grant Details",
"type": "n8n-nodes-base.httpRequest",
"position": [
280,
-280
],
"parameters": {
"url": "https://apply07.grants.gov/grantsws/rest/opportunity/details",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "form-urlencoded",
"bodyParameters": {
"parameters": [
{
"name": "oppId",
"value": "={{ $json.id }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "ade994d6-a1f8-45bf-a82e-83eb38da08d6",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
440,
-120
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "4d81b20e-0038-48d3-840c-3fcf8b798a0d",
"name": "Summarize Synopsis",
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
"position": [
460,
-280
],
"parameters": {
"text": "=Agency: {{ $json.synopsis.agencyName }}\nTitle: {{ $json.opportunityTitle }}\nSynopsis: {{ $json.synopsis.synopsisDesc }}",
"options": {
"systemPromptTemplate": "You've been given a grant opportunity listing. Help summarize the opportunity in simple terms."
},
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n \"goal\": { \"type\": [\"string\", \"null\"] },\n \"duration\": { \"type\": \"string\" },\n \"success_criteria\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n },\n \"good_to_know\": {\n\t\t \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n\t}\n}"
},
"typeVersion": 1
},
{
"id": "71e1a2e9-6690-4247-aae3-f5bd61019553",
"name": "Eligibility Factors",
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
"position": [
640,
-120
],
"parameters": {
"text": "=Agency: {{ $json.synopsis.agencyName }}\nTitle: {{ $json.opportunityTitle }}\nSynopsis: {{ $json.synopsis.synopsisDesc }}\nEligibility: {{ $json.synopsis.applicantEligibilityDesc }}",
"options": {
"systemPromptTemplate": "Help determine if we are eligible for this grant.\n\nWe are AI Consultants Limited (“Company”) and are the controllers of your personal data. Our registered office is Unit 29, Intelligent Park, Milton Road, Cambridge Cambridgeshire CB9 RDW, and our registered company number is 1234567.\n\nWe are part of a group of companies which provides consultancy services across the globe. Our other group companies are:\n\nAI Consultants Inc. of 2 Drydock Avenue, Suite 1210, Boston, MA 02210, USA\nAI Consultants (Singapore) Pte Ltd of 300 Beach Road, Singapore 199555\nAI Consultants Japan Inc, of 3-1-3 Minamiaoyama, Minato-ku, Tokyo, 107-0062\nIn the UK we are registered with the Information Commissioner’s Office under registration number Z9888888.\n\nIn the US we are registered with the Data Privacy Framework Program (DPF). To view the Company’s certification, please visit https://www.dataprivacyframework.gov/list.\n\nWe are a leading, worldwide product development service provider. We specialise in design engineering services, professional technical services and product technical support services (“Services”).\n\nAs the deep tech powerhouse of Capgemini, CC spearheads transformative projects to solve the toughest scientific and engineering challenges. Ambitious clients collaborate with us to create new-to-the-world technologies, services and products that have never been seen before. Our unique combination of technical, commercial and market expertise yields market-leading solutions that are hard to copy. This creates valuable intellectual property that generates protectable long-term value.\n\nWe work with some of the world’s biggest brands and most ambitious technology start-up ventures across a wide range of markets. From aerospace to agritech, consumer to industry, communications to healthcare, our knowledge of one sector can often be applied to another to create new breakthroughs. We focus on our clients’ success and we are trusted as integral partners in the future of their businesses.\n\nWe do important, difficult, radical and impactful things that benefit society. We helped develop the world's first 24/7 wrist-worn activity monitor, wireless pacemaker and wireless patient monitor, as well as the first connected drug inhaler. Our work led to the most densely packed cellular network in the world – orchestrating swarms of bots across highly automated warehouses. It produced the Bluetooth chip that connects your phone to your car and the latest satellite technology that lets people in remote locations across the world keep in touch."
},
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"eligibility_matches\": {\n\t\t \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n\t}\n}"
},
"typeVersion": 1
},
{
"id": "d741ef63-dcf3-452d-978c-8cbc27f55a33",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
600,
20
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "7354ed6d-50f5-4234-90d8-2d9d0c7eccd4",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
1000,
-120
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "2dffda98-18c6-4c7b-8fc3-0e6539642ea2",
"name": "Save to Tracker",
"type": "n8n-nodes-base.airtable",
"position": [
1420,
-20
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appiNoPRvhJxz9crl",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl",
"cachedResultName": "US Grants.gov Tracker"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblX93C9MNzizhibd",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl/tblX93C9MNzizhibd",
"cachedResultName": "Table 1"
},
"columns": {
"value": {
"URL": "=https://grants.gov/search-results-detail/{{ $('Get Grant Details').item.json.id }}",
"Goal": "={{ $json.output.goal }}",
"Notes": "={{ $json.output.good_to_know.join('\\n') }}",
"Title": "={{ $('Get Grant Details').item.json.opportunityTitle }}",
"Agency": "={{ $('Get Grant Details').item.json.synopsis.agencyContactName }}",
"Status": "New",
"Funding": "={{ $('Get Grant Details').item.json.synopsis.estimatedFunding }}",
"Duration": "={{ $json.output.duration }}",
"Award Floor": "={{ $('Get Grant Details').item.json.synopsis.awardFloor }}",
"Posted Date": "={{ $('Get Grant Details').item.json.synopsis.postingDate }}",
"Agency Email": "={{ $('Get Grant Details').item.json.synopsis.agencyContactEmail }}",
"Agency Phone": "={{ $('Get Grant Details').item.json.synopsis.agencyContactPhone }}",
"Eligibility?": "={{ $json.output.eligibility_matches.length > 0 ? 'Yes' : 'No' }}",
"Award Ceiling": "={{ $('Get Grant Details').item.json.synopsis.awardCeiling }}",
"Response Date": "={{ $('Get Grant Details').item.json.synopsis.responseDate }}",
"Success Criteria": "={{ $json.output.success_criteria.join('\\n') }}",
"Eligibility Notes": "={{ $json.output.eligibility_matches.join('\\n') }}",
"Opportunity Number": "={{ $('Get Grant Details').item.json.opportunityNumber }}"
},
"schema": [
{
"id": "Opportunity Number",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Opportunity Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "options",
"display": true,
"options": [
{
"name": "New",
"value": "New"
},
{
"name": "Under Review",
"value": "Under Review"
},
{
"name": "Interested",
"value": "Interested"
},
{
"name": "Not Interested",
"value": "Not Interested"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Goal",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Goal",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Success Criteria",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Success Criteria",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Notes",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Notes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Eligibility?",
"type": "options",
"display": true,
"options": [
{
"name": "Yes",
"value": "Yes"
},
{
"name": "No",
"value": "No"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Eligibility?",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Eligibility Notes",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Eligibility Notes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Duration",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Duration",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Agency",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Agency",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Agency Email",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Agency Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Agency Phone",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Agency Phone",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Posted Date",
"type": "dateTime",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Posted Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Response Date",
"type": "dateTime",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Response Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Funding",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Funding",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Award Ceiling",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Award Ceiling",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Award Floor",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Award Floor",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": []
},
"options": {},
"operation": "create"
},
"credentials": {
"airtableTokenApi": {
"id": "Und0frCQ6SNVX3VV",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "f0712788-b801-4070-a5c2-2f7ed620588e",
"name": "Only New Grants",
"type": "n8n-nodes-base.removeDuplicates",
"position": [
-60,
-180
],
"parameters": {
"options": {},
"operation": "removeItemsSeenInPreviousExecutions",
"dedupeValue": "={{ $json.id }}"
},
"typeVersion": 2
},
{
"id": "fb4ac14d-0bdd-40f7-9b31-3a23450b1f0b",
"name": "AI Grants since Yesterday",
"type": "n8n-nodes-base.httpRequest",
"position": [
-420,
-180
],
"parameters": {
"url": "https://apply07.grants.gov/grantsws/rest/opportunities/search",
"method": "POST",
"options": {},
"jsonBody": "{\n \"keyword\": \"ai\",\n \"cfda\": null,\n \"agencies\": null,\n \"sortBy\": \"openDate|desc\",\n \"rows\": 5000,\n \"eligibilities\": null,\n \"fundingCategories\": null,\n \"fundingInstruments\": null,\n \"dateRange\": \"1\",\n \"oppStatuses\": \"forecasted|posted\"\n}",
"sendBody": true,
"specifyBody": "json"
},
"typeVersion": 4.2
},
{
"id": "0446c882-764a-4c94-8c49-f368c50586a0",
"name": "Get New Eligible Grants Today",
"type": "n8n-nodes-base.airtable",
"position": [
-400,
500
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appiNoPRvhJxz9crl",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl",
"cachedResultName": "US Grants.gov Tracker"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblX93C9MNzizhibd",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl/tblX93C9MNzizhibd",
"cachedResultName": "Table 1"
},
"options": {},
"operation": "search",
"filterByFormula": "=AND(\n {Status} = 'New',\n {Eligibility?} = 'Yes',\n IS_SAME(DATETIME_FORMAT(Created, 'YYYY-MM-DD'), DATETIME_FORMAT(TODAY(), 'YYYY-MM-DD'))\n)"
},
"credentials": {
"airtableTokenApi": {
"id": "Und0frCQ6SNVX3VV",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "70bca43a-d00e-4ee6-828a-9926ba1d8fdb",
"name": "Generate Email",
"type": "n8n-nodes-base.html",
"position": [
-160,
500
],
"parameters": {
"html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\">\n<head>\n<!--[if gte mso 9]>\n<xml>\n <o:OfficeDocumentSettings>\n <o:AllowPNG/>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n</xml>\n<![endif]-->\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"x-apple-disable-message-reformatting\">\n <!--[if !mso]><!--><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n <title></title>\n \n <style type=\"text/css\">\n @media only screen and (min-width: 520px) {\n .u-row {\n width: 500px !important;\n }\n .u-row .u-col {\n vertical-align: top;\n }\n\n .u-row .u-col-100 {\n width: 500px !important;\n }\n\n}\n\n@media (max-width: 520px) {\n .u-row-container {\n max-width: 100% !important;\n padding-left: 0px !important;\n padding-right: 0px !important;\n }\n .u-row .u-col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n .u-row {\n width: 100% !important;\n }\n .u-col {\n width: 100% !important;\n }\n .u-col > div {\n margin: 0 auto;\n }\n}\nbody {\n margin: 0;\n padding: 0;\n}\n\ntable,\ntr,\ntd {\n vertical-align: top;\n border-collapse: collapse;\n}\n\np {\n margin: 0;\n}\n\n.ie-container table,\n.mso-container table {\n table-layout: fixed;\n}\n\n* {\n line-height: inherit;\n}\n\na[x-apple-data-detectors='true'] {\n color: inherit !important;\n text-decoration: none !important;\n}\n\ntable, td { color: #000000; } </style>\n \n \n\n</head>\n\n<body class=\"clean-body u_body\" style=\"margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #F7F8F9;color: #000000\">\n <!--[if IE]><div class=\"ie-container\"><![endif]-->\n <!--[if mso]><div class=\"mso-container\"><![endif]-->\n <table style=\"border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #F7F8F9;width:100%\" cellpadding=\"0\" cellspacing=\"0\">\n <tbody>\n <tr style=\"vertical-align: top\">\n <td style=\"word-break: break-word;border-collapse: collapse !important;vertical-align: top\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color: #F7F8F9;\"><![endif]-->\n \n \n \n<div class=\"u-row-container\" style=\"padding: 0px;background-color: #f7f8f9\">\n <div class=\"u-row\" style=\"margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;\">\n <div style=\"border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding: 0px;background-color: #f7f8f9;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px;\"><tr style=\"background-color: #ffffff;\"><![endif]-->\n \n<!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color: #f7f8f9;width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\" valign=\"top\"><![endif]-->\n<div class=\"u-col u-col-100\" style=\"max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;\">\n <div style=\"background-color: #f7f8f9;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\">\n <!--[if (!mso)&(!IE)]><!--><div style=\"box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\"><!--<![endif]-->\n \n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:32px 10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <!--[if mso]><table width=\"100%\"><tr><td><![endif]-->\n <h1 style=\"margin: 0px; line-height: 140%; text-align: center; word-wrap: break-word; font-family: arial black,AvenirNext-Heavy,avant garde,arial; font-size: 22px; font-weight: 400;\"><span><span><span><span><span><span>Latest AI Grants</span></span></span></span></span></span></h1>\n <!--[if mso]></td></tr></table><![endif]-->\n\n </td>\n </tr>\n </tbody>\n</table>\n\n <!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->\n </div>\n</div>\n<!--[if (mso)|(IE)]></td><![endif]-->\n <!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->\n </div>\n </div>\n </div>\n \n\n\n \n \n<div class=\"u-row-container\" style=\"padding: 0px;background-color: #f7f8f9\">\n <div class=\"u-row\" style=\"margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\">\n <div style=\"border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding: 0px;background-color: #f7f8f9;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px;\"><tr style=\"background-color: transparent;\"><![endif]-->\n \n<!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color: #ffffff;width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\" valign=\"top\"><![endif]-->\n<div class=\"u-col u-col-100\" style=\"max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;\">\n <div style=\"background-color: #ffffff;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\">\n <!--[if (!mso)&(!IE)]><!--><div style=\"box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\"><!--<![endif]-->\n \n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n{{\n$input.all().map((input,idx) => {\nreturn `\n <div>\n <div style=\"padding-top:14px;padding-bottom:24px\">\n <h3 style=\"margin-top:0;margin-bottom:7px;font-size:16px\">\n ${idx+1}. ${input.json.Title}\n </h3>\n <div style=\"margin-bottom:14px;font-size:12px;\">\n <strong>${input.json.Agency}</strong>\n ·\n <a href=\"${input.json.URL}\">See details</a>\n </div>\n <p style=\"margin-bottom:14px;font-size:14px\">\n <strong>Synopsis:</strong> ${input.json.Goal}\n </p>\n <ul style=\"font-size:14px;\">\n ${input.json['Success Criteria']\n .split('\\n')\n .map(text => `<li>${text}</li>`)\n .join('')\n }\n </ul>\n <div style=\"font-size:12px;\">\n <strong>Posted By</strong> ${input.json['Posted Date']\n .toDateTime()\n .format('EEE, dd MMM yyyy t')}\n <br/>\n <strong>Respond By</strong> ${input.json['Response Date']\n .toDateTime()\n .format('EEE, dd MMM yyyy t')}\n \n </div>\n</div> \n`\n}).join('<hr/>')\n}} \n </td>\n </tr>\n </tbody>\n</table>\n\n <!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->\n </div>\n</div>\n<!--[if (mso)|(IE)]></td><![endif]-->\n <!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->\n </div>\n </div>\n </div>\n \n\n\n \n \n<div class=\"u-row-container\" style=\"padding: 0px;background-color: transparent\">\n <div class=\"u-row\" style=\"margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\">\n <div style=\"border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding: 0px;background-color: transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px;\"><tr style=\"background-color: transparent;\"><![endif]-->\n \n<!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\" valign=\"top\"><![endif]-->\n<div class=\"u-col u-col-100\" style=\"max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;\">\n <div style=\"height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\">\n <!--[if (!mso)&(!IE)]><!--><div style=\"box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;\"><!--<![endif]-->\n \n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:24px 10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <div style=\"font-size: 14px; color: #7e8c8d; line-height: 140%; text-align: center; word-wrap: break-word;\">\n <p style=\"line-height: 140%;\">Autogenerated by n8n.</p>\n<p style=\"line-height: 140%;\">Brought to you by workflow #{{ $workflow.id }}</p>\n </div>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n <!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->\n </div>\n</div>\n<!--[if (mso)|(IE)]></td><![endif]-->\n <!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->\n </div>\n </div>\n </div>\n \n\n\n <!--[if (mso)|(IE)]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso]></div><![endif]-->\n <!--[if IE]></div><![endif]-->\n</body>\n\n</html>\n"
},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "12bd72f5-3028-4572-b59e-1cc143e44a86",
"name": "Everyday @ 9am",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-720,
460
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "ca62c507-bce5-4a63-be0e-e60591408668",
"name": "Everyday @ 8.30am",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-720,
-220
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8,
"triggerAtMinute": 30
}
]
}
},
"typeVersion": 1.2
},
{
"id": "032bec7e-5aff-4103-b81e-e5bc4a88ddde",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
-420
],
"parameters": {
"color": 7,
"width": 700,
"height": 480,
"content": "## 1. Fetch Latest AI Grants, Ignore Those Already Seen\n[Learn more about the Remove Duplicates node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.removeduplicates/)\n\nA cool feature of n8n's remove duplicates node is that it works across executions. What this means for this template is that the node will help us keep track of grant IDs to know if we've already processed them and if so, filter them out so we won't have duplicate alerts."
},
"typeVersion": 1
},
{
"id": "07147665-3571-4512-adce-2727dcb95240",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
180,
-520
],
"parameters": {
"color": 7,
"width": 1000,
"height": 720,
"content": "## 2. Quickly Determine Eligibility Using AI\n[Learn more about the Information Extractor node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.information-extractor/)\n\nQualifying Leads requires a lot of contextual reasoning taking into account many factors such as commercials, location and eligibility criteria. Whilst it's not guaranteed AI can or will solve this for your particular requirements, it can however get you a good distance of the way there!\n\nAI in this template intends to reduce time (and therefore cost) for a team member needs to spend per grant listing or increase their coverage of grants which they would otherwise miss due to capacity."
},
"typeVersion": 1
},
{
"id": "f4758b4d-727a-4ce8-b071-3388eb16b219",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1200,
-280
],
"parameters": {
"color": 7,
"width": 520,
"height": 480,
"content": "## 3. Save Results to Grant Tracker\n[Learn more about the Airtable Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.airtable/)\n\nIn n8n, it's easy to send your data anywhere to manage yourself, share with your team or reuse with other workflows. Here for demonstration purposes, we'll just store each grant as a row in our Airtable database.\n\nCheck out the sample Airtable here: https://airtable.com/appiNoPRvhJxz9crl/shrRdP6zstgsxjDKL"
},
"typeVersion": 1
},
{
"id": "a7861a21-021f-4629-b863-2163c7436d13",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
240
],
"parameters": {
"color": 7,
"width": 620,
"height": 500,
"content": "## 4. Generate Latest AI Grants Alert Email\n[Learn more about the HTML Template node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/)\n\nUsing our freshly collected AI grants, it would be nice if we can share them with our team members via email. A nicely formatted email digest can be generated using the HTML template node, with added links for greater impact.\n\nHere in this demonstration, we will loop through all eligible new grants and compile them into a newsletter format using the HTML node.\n"
},
"typeVersion": 1
},
{
"id": "4d09af53-92cb-4288-86d7-dcf695bfb358",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
100,
240
],
"parameters": {
"color": 7,
"width": 640,
"height": 500,
"content": "## 5. Send to a list of Subscribers\n[Learn more about the Gmail node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/)\n\nFinally, we can source a list of subscribers to send our generated email newsletter.\n\nHere, our subscriber list is another table alongside our grants table that we can import that list using the Airtable node. You can use any email provider that supports HTML but for this demonstration, we're using Gmail for simplicity sake."
},
"typeVersion": 1
},
{
"id": "784d59f3-5b1f-4404-bc04-4bd58cf03585",
"name": "Get Subscribers",
"type": "n8n-nodes-base.airtable",
"position": [
240,
500
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appiNoPRvhJxz9crl",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl",
"cachedResultName": "US Grants.gov Tracker"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblaS91hyhguntfaC",
"cachedResultUrl": "https://airtable.com/appiNoPRvhJxz9crl/tblaS91hyhguntfaC",
"cachedResultName": "Subscribers"
},
"options": {},
"operation": "search",
"filterByFormula": "AND({Status} = 'Active')"
},
"credentials": {
"airtableTokenApi": {
"id": "Und0frCQ6SNVX3VV",
"name": "Airtable Personal Access Token account"
}
},
"executeOnce": true,
"typeVersion": 2.1
},
{
"id": "3be0788b-90ef-4648-aa25-1170208a685d",
"name": "Send Subscriber Email",
"type": "n8n-nodes-base.gmail",
"position": [
480,
500
],
"webhookId": "37eeec7a-1982-4137-8473-313bfb6c5b42",
"parameters": {
"sendTo": "={{ $json.Email }}",
"message": "={{ $('Generate Email').first().json.html }}",
"options": {},
"subject": "Daily Newletter for Intersting US Grants"
},
"credentials": {
"gmailOAuth2": {
"id": "Sf5Gfl9NiFTNXFWb",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "14a65482-b314-4a2f-9ce3-87e3aae126f9",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
300
],
"parameters": {
"color": 7,
"width": 460,
"height": 200,
"content": "## Scheduled Triggers\n[Learn more about Scheduled Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger)\n\nScheduled triggers are a great way to run this template automatically in the morning ready for your team before they start their working day.\n\nFeel free to adjust the interval to a time which suits you!"
},
"typeVersion": 1
},
{
"id": "b172eb7a-58bc-4d4a-be22-796d34a59897",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-620
],
"parameters": {
"width": 460,
"height": 900,
"content": "## Try It Out!\n\n### This n8n templates demonstrates how to automatically ingest a source of leads at regular intervals and take advantage of n8n's remove duplicates node to simplify duplicate detection.\nAdditionally after the leads are captured, a simple alerts notification can be generated and shared with team members.\n\n### How it works\n* A scheduled trigger is set to fetch a list of AI grants listed on the grants.gov website in the past day.\n* A Remove Duplicates node is used to track Grant IDs to filter out those already processed by the workflow.\n* New grants are summarized and analysed by AI nodes to determine eligibility and interest which is then saved to an Airtable database.\n* Another scheduled trigger starts a little later than the first to collect and summarize the new grants\n* The results are then compiled into an email template using the HTML node, in the form of a newsletter designed to alert and brief team members of new AI grants.\n* This email is then sent to a list of subscribers using the gmail node.\n\n## How to use\n* Make a copy of sample Airtable here: https://airtable.com/appiNoPRvhJxz9crl/shrRdP6zstgsxjDKL\n* The filters for fetching the grants is currently set to the \"AI\" category. Feel free to change this to include more categories.\n* Not interested in grants, this template can works for other sources of leads just change the endpoint and how you're defining the item ID to track.\n\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
},
"typeVersion": 1
},
{
"id": "f9849413-4dad-44dc-92ec-8879d123bfd3",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
720,
40
],
"parameters": {
"width": 320,
"height": 120,
"content": "### Add your company details here!\nCompany details are added in the system prompt to help the AI determine eligibility. The more details the better!"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Merge": {
"main": [
[
{
"node": "Save to Tracker",
"type": "main",
"index": 0
}
]
]
},
"Everyday @ 9am": {
"main": [
[
{
"node": "Get New Eligible Grants Today",
"type": "main",
"index": 0
}
]
]
},
"Generate Email": {
"main": [
[
{
"node": "Get Subscribers",
"type": "main",
"index": 0
}
]
]
},
"Grants to List": {
"main": [
[
{
"node": "Only New Grants",
"type": "main",
"index": 0
}
]
]
},
"Get Subscribers": {
"main": [
[
{
"node": "Send Subscriber Email",
"type": "main",
"index": 0
}
]
]
},
"Only New Grants": {
"main": [
[
{
"node": "Get Grant Details",
"type": "main",
"index": 0
}
]
]
},
"Save to Tracker": {
"main": [
[]
]
},
"Everyday @ 8.30am": {
"main": [
[
{
"node": "AI Grants since Yesterday",
"type": "main",
"index": 0
}
]
]
},
"Get Grant Details": {
"main": [
[
{
"node": "Summarize Synopsis",
"type": "main",
"index": 0
},
{
"node": "Eligibility Factors",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Summarize Synopsis",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Eligibility Factors",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Summarize Synopsis": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Eligibility Factors": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"AI Grants since Yesterday": {
"main": [
[
{
"node": "Grants to List",
"type": "main",
"index": 0
}
]
]
},
"Get New Eligible Grants Today": {
"main": [
[
{
"node": "Generate Email",
"type": "main",
"index": 0
}
]
]
}
}
}