-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvestorX.json
More file actions
607 lines (607 loc) · 47.1 KB
/
Copy pathInvestorX.json
File metadata and controls
607 lines (607 loc) · 47.1 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
{
"name": "InvestorX",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 0 6 * * 1-5"
}
]
}
},
"id": "3e33c2fa-da3c-4ead-8c6f-2eaab4be25a2",
"name": "Daily Market Intelligence",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [
-1680,
112
],
"retryOnFail": true
},
{
"parameters": {
"url": "https://newsapi.org/v2/everything",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"sendQuery": true,
"specifyQuery": "json",
"jsonQuery": "={\n \"q\": \"\\\"stock market\\\" OR \\\"investment opportunity\\\" OR \\\"IPO\\\" OR \\\"earnings report\\\" OR \\\"federal reserve\\\" OR \\\"startup funding\\\" OR \\\"fintech\\\" OR \\\"emerging markets\\\" OR \\\"small business\\\" OR \\\"innovation\\\" OR \\\"value investing\\\" OR \\\"growth stocks\\\"\",\n \"language\": \"en\",\n \"sortBy\": \"popularity\",\n \"from\": \"={{ new Date().toISOString().split('T')[0] }}\",\n \"pageSize\": \"50\",\n \"excludeDomains\": \"reddit.com,twitter.com,facebook.com\"\n}",
"sendHeaders": true,
"specifyHeaders": "json",
"jsonHeaders": "{\n \"User-Agent\": \"Investment-Intelligence-Bot/1.0\"\n}",
"options": {}
},
"id": "6b5cc4c7-cc76-4a3a-9b5c-c7a39ced260d",
"name": "Fetch Market News",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
-1152,
112
],
"retryOnFail": true,
"credentials": {
"httpQueryAuth": {
"id": "2nZbSJP8PpYeXGY6",
"name": "News API"
}
}
},
{
"parameters": {
"jsCode": "// SIMPLIFIED Process Reddit Sentiment - Fixed for n8n\n// This handles the data structure mismatch\n\n// Get the news items - they come as individual items, not wrapped\nconst newsItems = $input.all();\n\n// Initialize Reddit analysis with defaults\nlet redditAnalysis = {\n posts: [],\n summary: { \n total_posts: 0, \n avg_sentiment: 0, \n trending_symbols: [],\n sentiment_distribution: { bullish: 0, neutral: 0, bearish: 0 }\n },\n hot_topics: []\n};\n\nconsole.log(\"Number of input branches:\", $input.length);\nconsole.log(\"News items count:\", newsItems.length);\n\n// Check if we have Reddit data (second input branch)\nif ($input.length > 1) {\n const redditInput = $input.all()[$input.all().length - 1]; // Get last input\n if (redditInput?.json) {\n redditAnalysis = redditInput.json;\n console.log(\"Reddit data found:\", redditAnalysis.summary?.total_posts || 0, \"posts\");\n }\n}\n\n// Process each news article\nconst enhancedArticles = newsItems.map((item, index) => {\n const article = item.json;\n \n // Simple Reddit validation check\n let reddit_mentions = 0;\n let reddit_sentiment = 0;\n \n // Extract symbols from article title for matching\n const articleSymbols = (article.title || '').match(/\\b[A-Z]{2,5}\\b/g) || [];\n \n // Check for Reddit discussions about same topics\n if (redditAnalysis.posts && redditAnalysis.posts.length > 0) {\n redditAnalysis.posts.forEach(post => {\n // Check for symbol overlap\n const commonSymbols = articleSymbols.filter(symbol => \n post.symbols && post.symbols.includes(symbol)\n );\n \n if (commonSymbols.length > 0) {\n reddit_mentions++;\n reddit_sentiment += post.sentiment;\n }\n \n // Check for keyword overlap (simplified)\n const articleWords = (article.title || '').toLowerCase().split(' ');\n const postWords = post.title.toLowerCase().split(' ');\n \n const hasOverlap = articleWords.some(word => \n word.length > 4 && postWords.some(postWord => postWord.includes(word))\n );\n \n if (hasOverlap) {\n reddit_mentions += 0.5; // Partial match\n reddit_sentiment += post.sentiment * 0.5;\n }\n });\n }\n \n // Calculate priority score\n const baseScore = article.score || 0;\n let priorityBonus = 0;\n \n if (reddit_mentions > 0) {\n priorityBonus += reddit_mentions > 1 ? 3 : 1; // Social validation bonus\n }\n \n if (Math.abs(reddit_sentiment) > 2) {\n priorityBonus += 2; // Strong sentiment bonus\n }\n \n const priorityScore = baseScore + priorityBonus;\n \n return {\n ...article,\n priority_score: priorityScore,\n reddit_intelligence: {\n reddit_mentions: Math.floor(reddit_mentions),\n reddit_sentiment: reddit_mentions > 0 ? reddit_sentiment / reddit_mentions : 0,\n social_validation: reddit_mentions >= 2\n }\n };\n});\n\n// Sort by priority and take top articles\nconst topArticles = enhancedArticles\n .sort((a, b) => b.priority_score - a.priority_score)\n .slice(0, 8);\n\n// Create market intelligence summary\nconst marketIntelligence = {\n news_summary: {\n total_articles: enhancedArticles.length,\n avg_base_score: enhancedArticles.length > 0 ? \n enhancedArticles.reduce((sum, a) => sum + (a.score || 0), 0) / enhancedArticles.length : 0,\n avg_priority_score: enhancedArticles.length > 0 ?\n enhancedArticles.reduce((sum, a) => sum + a.priority_score, 0) / enhancedArticles.length : 0,\n social_validated: enhancedArticles.filter(a => a.reddit_intelligence.social_validation).length,\n source_distribution: {\n newsapi: enhancedArticles.filter(a => a.source_type === 'newsapi').length,\n marketaux: enhancedArticles.filter(a => a.source_type === 'marketaux').length\n }\n },\n \n reddit_intelligence: {\n total_discussions: redditAnalysis.summary.total_posts,\n market_sentiment: redditAnalysis.summary.avg_sentiment,\n trending_stocks: redditAnalysis.summary.trending_symbols,\n sentiment_breakdown: redditAnalysis.summary.sentiment_distribution,\n top_discussions: redditAnalysis.hot_topics,\n analysis_quality: redditAnalysis.posts ? \n redditAnalysis.posts.filter(p => p.category === 'analysis').length : 0,\n subreddits_analyzed: redditAnalysis.summary.subreddits_analyzed || []\n },\n \n convergence_signals: {\n stories_with_reddit_validation: topArticles.filter(a => a.reddit_intelligence.social_validation).length,\n avg_reddit_sentiment_on_news: topArticles\n .filter(a => a.reddit_intelligence.reddit_mentions > 0)\n .reduce((sum, a, _, arr) => arr.length > 0 ? sum + a.reddit_intelligence.reddit_sentiment / arr.length : 0, 0),\n trending_overlap: redditAnalysis.summary.trending_symbols && redditAnalysis.summary.trending_symbols.length > 0\n },\n \n ai_context: {\n high_priority_stories: topArticles.length,\n social_sentiment_direction: redditAnalysis.summary.avg_sentiment > 1 ? 'bullish' : \n redditAnalysis.summary.avg_sentiment < -1 ? 'bearish' : 'neutral',\n content_freshness: topArticles.filter(a => a.hoursAgo <= 6).length,\n engagement_potential: topArticles.length > 0 ? \n Math.round(topArticles.reduce((sum, a) => sum + a.priority_score, 0) / topArticles.length) : 0\n }\n};\n\nconsole.log(\"Final output:\", {\n articles_count: topArticles.length,\n reddit_posts: redditAnalysis.summary.total_posts,\n avg_priority: marketIntelligence.ai_context.engagement_potential\n});\n\nreturn [{\n json: {\n articles: topArticles,\n market_intelligence: marketIntelligence,\n processing_timestamp: new Date().toISOString(),\n total_sources: {\n news_apis: 2,\n reddit_sources: redditAnalysis.summary.subreddits_analyzed?.length || 0,\n total_data_points: enhancedArticles.length + redditAnalysis.summary.total_posts\n }\n }\n}];"
},
"id": "eb1d343d-d6e7-4ba3-ad48-b414c5339807",
"name": "Process Reddit Sentiment",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-704,
144
]
},
{
"parameters": {
"jsCode": "// Enhanced Format Content Output - Fixed JSON Parsing\nconst aiResponse = $input.first().json;\n\n// Default fallback structure in case of errors\nlet contentAngles = {\n stories: [],\n summary: \"AI parsing error - manual review required. The AI model may have returned a non-JSON response.\"\n};\n\n// Enhanced JSON parsing with multiple fallback strategies\ntry {\n // Get the AI response text\n let aiContent = aiResponse.text || aiResponse.content || '{}';\n\n // Handle different AI response formats\n if (Array.isArray(aiResponse.content)) {\n // Extract text from array format (Anthropic API format)\n aiContent = aiResponse.content[0]?.text || '{}';\n }\n\n // Clean up markdown code blocks if present\n if (aiContent.includes('```json')) {\n const jsonMatch = aiContent.match(/```json\\s*([\\s\\S]*?)\\s*```/);\n if (jsonMatch) {\n aiContent = jsonMatch[1].trim();\n }\n } else if (aiContent.includes('```')) {\n // Handle generic code blocks\n const codeMatch = aiContent.match(/```[\\s\\S]*?\\s*([\\s\\S]*?)\\s*```/);\n if (codeMatch) {\n aiContent = codeMatch[1].trim();\n }\n }\n\n // Additional cleanup for common AI formatting issues\n aiContent = aiContent\n .replace(/^Here's.*?:\\s*/i, '') // Remove intro text\n .replace(/^```json\\s*/i, '') // Remove opening code block\n .replace(/```\\s*$/i, '') // Remove closing code block\n .trim();\n\n // Try to parse the cleaned content\n const parsedContent = JSON.parse(aiContent);\n\n // Validate the structure\n if (parsedContent && typeof parsedContent === 'object') {\n if (parsedContent.stories && Array.isArray(parsedContent.stories)) {\n contentAngles = parsedContent;\n console.log(`Successfully parsed ${parsedContent.stories.length} stories`);\n } else {\n console.log('Parsed content but missing stories array');\n contentAngles.summary = \"Parsed AI response but stories array not found\";\n }\n }\n} catch (error) {\n console.error(\"Error parsing AI response:\", error);\n console.error(\"Raw AI content:\", aiResponse);\n\n // Try one more fallback - look for any JSON-like structure\n try {\n const rawText = JSON.stringify(aiResponse);\n const jsonMatch = rawText.match(/\\{[\\s\\S]*\"stories\"[\\s\\S]*\\}/);\n if (jsonMatch) {\n const fallbackContent = JSON.parse(jsonMatch[0]);\n if (fallbackContent.stories) {\n contentAngles = fallbackContent;\n console.log(\"Recovered with fallback parsing\");\n }\n }\n } catch (fallbackError) {\n console.error(\"Fallback parsing also failed:\", fallbackError);\n }\n}\n\n// Add compliance disclaimers\nconst disclaimer = \"Educational content only. Not financial advice. Do your own research.\";\n\n// Format for different outputs\nfunction formatForEmail(data) {\n let emailBody = `\n <h2>📈 Daily Investment Intelligence Brief</h2>\n <p><strong>Date:</strong> ${new Date().toLocaleDateString('en-US', {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n })}</p>\n \n <h3>🎯 Top Investment Angles</h3>\n `;\n\n if (data.stories && data.stories.length > 0) {\n data.stories.forEach((story, index) => {\n emailBody += `\n <div style=\"margin-bottom: 20px; padding: 15px; border-left: 3px solid #007acc;\">\n <h4>${index + 1}. ${story.title || 'Market Opportunity'}</h4>\n <p><strong>Angle:</strong> ${story.main_angle || 'Analysis pending'}</p>\n <p><strong>Key Insight:</strong> ${story.key_insight || 'Data review needed'}</p>\n <p><strong>Tweet Draft:</strong> <em>${story.tweet_draft || 'Content in development'}</em></p>\n <p><strong>Engagement Prediction:</strong> ${story.engagement_prediction || 'TBD'}/10</p>\n ${story.risk_flags ? `<p style=\\\"color: #d63384;\\\"><strong>⚠️ Risk Flags:</strong> ${story.risk_flags}</p>` : ''}\n </div>\n `;\n });\n } else {\n emailBody += `<p>${data.summary || 'No stories to display.'}</p>`;\n }\n\n emailBody += `\n <h3>📊 Market Sentiment Summary</h3>\n <p>${data.summary || 'Analysis in progress'}</p>\n \n <hr>\n <p style=\\\"font-size: 12px; color: #666;\\\">${disclaimer}</p>\n `;\n\n return emailBody;\n}\n\nfunction formatForDiscord(data) {\n let discordContent = `🚀 **Daily Investment Intelligence**\\\\n\\\\n`;\n\n if (data.stories && data.stories.length > 0) {\n data.stories.slice(0, 3).forEach((story, index) => {\n discordContent += `**${index + 1}. ${story.title || 'Market Update'}**\\\\n`;\n discordContent += `📈 ${story.main_angle || 'Analysis pending'}\\\\n`;\n discordContent += `🎯 Engagement Score: ${story.engagement_prediction || 'TBD'}/10\\\\n\\\\n`;\n });\n } else {\n discordContent += `${data.summary || 'No stories to display.'}`\n }\n\n discordContent += `\\\\n*${disclaimer}*`;\n return discordContent;\n}\n\n// Calculate highest score for auto-post decision\nconst highestScore = contentAngles.stories && contentAngles.stories.length > 0\n ?\n Math.max(...contentAngles.stories.map(s => s.engagement_prediction || 0)) :\n 0;\n\n// Format final output\nconst formattedOutput = {\n email_body: formatForEmail(contentAngles),\n discord_content: formatForDiscord(contentAngles),\n tweet_drafts: contentAngles.stories || [],\n highest_engagement_score: highestScore,\n auto_post_eligible: highestScore >= 8,\n compliance_review_needed: contentAngles.stories?.some(s => s.risk_flags) || false,\n summary: contentAngles.summary || 'Daily intelligence analysis complete',\n timestamp: new Date().toISOString(),\n total_stories: contentAngles.stories?.length || 0,\n disclaimer: disclaimer\n};\n\nreturn [{\n json: formattedOutput\n}];"
},
"id": "75ad84de-cede-495b-8410-9c1c5a76d1f5",
"name": "Format Content Output",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-128,
128
]
},
{
"parameters": {
"sendTo": "investorxblog@gmail.com",
"subject": "=📈 Daily Investment Intelligence - {{$now.format('MMM DD, YYYY')}}",
"message": "={{$json.email_body}}",
"options": {}
},
"id": "8475459f-bc9d-4b61-b50a-469baf2232a6",
"name": "Send Daily Brief",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
192,
-48
],
"webhookId": "bb7cd04e-46fb-4795-a853-416876e3a234",
"retryOnFail": true,
"credentials": {
"gmailOAuth2": {
"id": "1zCDXIKtdRCW14pN",
"name": "Gmail account"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "auto-post-condition",
"leftValue": "={{$json.auto_post_eligible}}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equal"
}
},
{
"id": "compliance-check",
"leftValue": "={{$json.compliance_review_needed}}",
"rightValue": false,
"operator": {
"type": "boolean",
"operation": "equal"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "ad1fa171-65c7-411f-a6b7-39376ea91751",
"name": "Auto-Post Gate",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
192,
352
]
},
{
"parameters": {
"text": "={{$json.tweet_drafts[0]?.tweet_draft + '\\n\\n' + $json.disclaimer}}",
"additionalFields": {}
},
"id": "151d8c9d-23c1-4d90-9e7d-7ab779deee26",
"name": "X/Twitter Post",
"type": "n8n-nodes-base.twitter",
"typeVersion": 2,
"position": [
464,
256
],
"credentials": {
"twitterOAuth2Api": {
"id": "tFedTdpnvTkHanql",
"name": "X account"
}
}
},
{
"parameters": {
"jsCode": "// Performance Analytics Calculator\nconst currentData = $input.first().json;\n\n// Mock historical data structure (in real implementation, this would come from Notion database)\nconst historicalData = {\n last_7_days: [\n { date: '2024-01-20', engagement_score: 7, actual_engagement: 85 },\n { date: '2024-01-19', engagement_score: 6, actual_engagement: 62 },\n { date: '2024-01-18', engagement_score: 8, actual_engagement: 94 },\n { date: '2024-01-17', engagement_score: 5, actual_engagement: 48 },\n { date: '2024-01-16', engagement_score: 9, actual_engagement: 112 },\n { date: '2024-01-15', engagement_score: 7, actual_engagement: 78 },\n { date: '2024-01-14', engagement_score: 6, actual_engagement: 55 }\n ],\n follower_growth: {\n start_week: 1250,\n end_week: 1267,\n growth_rate: 1.36\n }\n};\n\n// Calculate performance metrics\nfunction calculateROI(data) {\n const totalPredicted = data.reduce((sum, item) => sum + item.engagement_score, 0);\n const totalActual = data.reduce((sum, item) => sum + item.actual_engagement, 0);\n \n return {\n prediction_accuracy: Math.round((totalActual / (totalPredicted * 10)) * 100), // Convert to percentage\n avg_engagement: Math.round(totalActual / data.length),\n trend: totalActual > (totalPredicted * 8) ? 'improving' : 'declining'\n };\n}\n\nfunction identifyBestPerformers(data) {\n return data\n .filter(item => item.actual_engagement > 80)\n .map(item => ({\n date: item.date,\n score: item.engagement_score,\n performance: item.actual_engagement,\n efficiency: Math.round(item.actual_engagement / item.engagement_score)\n }));\n}\n\n// Generate performance report\nconst roi = calculateROI(historicalData.last_7_days);\nconst bestPerformers = identifyBestPerformers(historicalData.last_7_days);\n\nconst performanceReport = {\n report_date: new Date().toISOString(),\n period: 'last_7_days',\n metrics: {\n prediction_accuracy: roi.prediction_accuracy + '%',\n average_engagement: roi.avg_engagement,\n performance_trend: roi.trend,\n follower_growth_rate: historicalData.follower_growth.growth_rate + '%'\n },\n best_performers: bestPerformers,\n content_analysis: {\n high_scoring_themes: ['innovation', 'fintech', 'small business'],\n optimal_posting_times: ['7:30 AM', '12:30 PM', '6:00 PM'],\n engagement_patterns: {\n contrarian_takes: 'High performance (+23% above average)',\n data_backed_insights: 'Moderate performance (+8% above average)',\n educational_content: 'Consistent performance (baseline)'\n }\n },\n recommendations: [\n 'Increase contrarian analysis content',\n 'Focus on innovation and fintech themes',\n 'Maintain current posting schedule',\n 'A/B test thread vs single post formats'\n ],\n current_session: {\n stories_processed: currentData.total_stories,\n highest_score: currentData.highest_engagement_score,\n auto_post_eligible: currentData.auto_post_eligible\n }\n};\n\nreturn [{ json: performanceReport }];"
},
"id": "55d71f67-db77-428b-b5ef-d953ff719f38",
"name": "Performance Analytics",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
192,
208
]
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "claude-3-5-sonnet-20240620",
"mode": "list",
"cachedResultName": "claude-3-5-sonnet-20240620"
},
"messages": {
"values": [
{
"content": "=You are an expert investment analyst creating content for professional investors. Generate investor-focused content angles for these news stories.\n\nGUIDELINES:\n\nFocus on growth + value hybrid opportunities with innovation focus\n\nMaintain cautiously optimistic perspective\n\nPrioritize tech, fintech, emerging markets, small business\n\nGenerate contrarian takes backed by data\n\nProfessional but accessible tone (knowledgeable friend)\n\nMix technical terms with plain explanations\n\nEach angle should be 150-200 characters for X/Twitter\n\nInclude engagement hooks and actionable insights\n\nNews Data: {{JSON.stringify($json)}}\n\nFor each top story, provide:\n\nMain angle (contrarian perspective)\n\nKey insight (data-backed)\n\nTweet draft (150-200 chars)\n\nEngagement prediction (1-10)\n\nRisk flags (if any)\n\nFormat as JSON with structured response."
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.anthropic",
"typeVersion": 1,
"position": [
-416,
128
],
"id": "cd2ac1f7-a033-4855-b5e7-f96cf108531b",
"name": "Message a model",
"retryOnFail": true,
"credentials": {
"anthropicApi": {
"id": "gMlor80ZtbrIM8Bv",
"name": "Anthropic account"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "2a757547-a076-4107-a379-082584d1f00d",
"leftValue": "={{$json.articles.length}}",
"rightValue": 0,
"operator": {
"type": "number",
"operation": "gt"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-576,
144
],
"id": "e5c80cd3-a611-4a16-9175-6ba817a5efb3",
"name": "If"
},
{
"parameters": {
"jsCode": "// Enhanced Reddit Investment Intelligence\n// Replace the current Reddit Sentiment Analysis node with this logic\n\nconst items = $input.all();\n\n// EXPANDED SUBREDDIT LIST - Mix of serious analysis and market pulse\nconst subreddits = [\n // High-quality analysis subreddits\n 'SecurityAnalysis',\n 'ValueInvesting', \n 'investing',\n 'financialindependence',\n 'SecurityAnalysis',\n 'StockMarket',\n \n // Active trading and market pulse\n 'stocks',\n 'options',\n 'pennystocks',\n 'ValueStocks',\n 'growthstocks',\n \n // Sector-specific (rotate daily)\n 'technology',\n 'fintech', \n 'biotech',\n 'energy',\n 'realestate',\n \n // International markets\n 'investing_discussion',\n 'EuropeanOptions',\n 'CanadianInvestor'\n];\n\n// Get day of week to rotate focus\nconst dayOfWeek = new Date().getDay();\nconst sectorRotation = {\n 1: ['technology', 'fintech', 'artificial'], // Monday - Tech\n 2: ['biotech', 'LifeSciences', 'medicine'], // Tuesday - Healthcare \n 3: ['energy', 'mining', 'oil'], // Wednesday - Energy\n 4: ['realestate', 'REIT', 'construction'], // Thursday - Real Estate\n 5: ['financialindependence', 'SecurityAnalysis', 'ValueInvesting'], // Friday - Fundamentals\n 6: ['stocks', 'StockMarket', 'options'], // Saturday - General\n 0: ['investing', 'SecurityAnalysis', 'ValueInvesting'] // Sunday - Quality analysis\n};\n\n// Select subreddits based on day + always include core ones\nconst coreSubreddits = ['investing', 'SecurityAnalysis', 'ValueInvesting', 'stocks'];\nconst dailyFocus = sectorRotation[dayOfWeek] || [];\nconst selectedSubreddits = [...new Set([...coreSubreddits, ...dailyFocus])];\n\n// Multiple API calls for better data\nconst redditCalls = [\n // Hot posts from combined subreddits\n `https://api.reddit.com/r/${selectedSubreddits.join('+')}/hot.json?limit=25`,\n \n // Top posts from last 24h for trending topics\n `https://api.reddit.com/r/${selectedSubreddits.slice(0,5).join('+')}/top.json?t=day&limit=15`,\n \n // New posts for breaking news\n `https://api.reddit.com/r/SecurityAnalysis+investing+StockMarket/new.json?limit=10`\n];\n\n// Function to make Reddit API call with better headers\nasync function fetchRedditData(url) {\n try {\n const response = await fetch(url, {\n headers: {\n 'User-Agent': 'Investment-Intelligence-Bot/2.0 (Educational Research)',\n 'Accept': 'application/json'\n }\n });\n \n if (!response.ok) {\n console.log(`Reddit API error: ${response.status}`);\n return null;\n }\n \n return await response.json();\n } catch (error) {\n console.log(`Reddit fetch error: ${error.message}`);\n return null;\n }\n}\n\n// Enhanced sentiment analysis\nfunction analyzeSentiment(text) {\n if (!text || typeof text !== 'string') return 0;\n \n const textLower = text.toLowerCase();\n \n // Positive indicators\n const positive = {\n 'strong buy': 4, 'bullish': 3, 'undervalued': 3, 'opportunity': 2,\n 'growth': 2, 'upside': 2, 'strong': 2, 'buy': 2, 'positive': 1,\n 'good': 1, 'optimistic': 2, 'breakout': 3, 'rally': 2,\n 'beat earnings': 3, 'exceed': 2, 'outperform': 2\n };\n \n // Negative indicators \n const negative = {\n 'strong sell': -4, 'bearish': -3, 'overvalued': -3, 'risk': -1,\n 'decline': -2, 'weak': -2, 'sell': -2, 'negative': -1,\n 'bad': -1, 'pessimistic': -2, 'crash': -3, 'dump': -2,\n 'miss earnings': -3, 'underperform': -2, 'bubble': -2\n };\n \n let score = 0;\n \n // Score based on keywords\n for (const [word, weight] of Object.entries(positive)) {\n if (textLower.includes(word)) score += weight;\n }\n \n for (const [word, weight] of Object.entries(negative)) {\n if (textLower.includes(word)) score += weight; // weight is already negative\n }\n \n return Math.max(-10, Math.min(10, score)); // Cap between -10 and +10\n}\n\n// Extract stock symbols from text\nfunction extractStockSymbols(text) {\n if (!text) return [];\n \n // Match $SYMBOL or common patterns\n const symbolRegex = /\\$([A-Z]{1,5})\\b|(?:^|\\s)([A-Z]{2,5})(?:\\s|$)/g;\n const symbols = [];\n let match;\n \n while ((match = symbolRegex.exec(text)) !== null) {\n const symbol = match[1] || match[2];\n if (symbol && symbol.length <= 5 && symbol.length >= 2) {\n symbols.push(symbol);\n }\n }\n \n return [...new Set(symbols)]; // Remove duplicates\n}\n\n// Process Reddit data\nfunction processRedditPosts(redditData) {\n if (!redditData?.data?.children) return [];\n \n return redditData.data.children\n .map(post => {\n const data = post.data;\n const fullText = `${data.title} ${data.selftext || ''}`;\n const sentiment = analyzeSentiment(fullText);\n const symbols = extractStockSymbols(data.title);\n \n return {\n title: data.title,\n score: data.score || 0,\n comments: data.num_comments || 0,\n sentiment: sentiment,\n symbols: symbols,\n url: `https://reddit.com${data.permalink}`,\n subreddit: data.subreddit,\n created: data.created_utc,\n author: data.author,\n upvote_ratio: data.upvote_ratio,\n text_length: fullText.length,\n category: categorizePost(data.title, data.selftext)\n };\n })\n .filter(post => \n post.score >= 10 && // Minimum engagement\n post.comments >= 2 && // Has discussion\n post.text_length > 20 && // Substantial content\n !post.title.toLowerCase().includes('daily thread') // Skip daily threads\n );\n}\n\n// Categorize posts for better analysis\nfunction categorizePost(title, text) {\n const content = `${title} ${text || ''}`.toLowerCase();\n \n if (content.match(/\\bdd\\b|due diligence|analysis|valuation/)) return 'analysis';\n if (content.match(/earnings|report|results|guidance/)) return 'earnings';\n if (content.match(/news|announcement|breaking/)) return 'news';\n if (content.match(/discussion|thoughts|opinion/)) return 'discussion';\n if (content.match(/ipo|spac|merger|acquisition/)) return 'corporate_action';\n \n return 'general';\n}\n\n// Main execution\nasync function main() {\n let allPosts = [];\n \n // Fetch from multiple endpoints\n for (const url of redditCalls) {\n const data = await fetchRedditData(url);\n if (data) {\n const posts = processRedditPosts(data);\n allPosts = [...allPosts, ...posts];\n }\n \n // Small delay between calls\n await new Promise(resolve => setTimeout(resolve, 100));\n }\n \n // Remove duplicates and sort by relevance\n const uniquePosts = allPosts\n .filter((post, index, self) => \n index === self.findIndex(p => p.title === post.title)\n )\n .sort((a, b) => {\n // Prioritize high engagement + sentiment\n const scoreA = (a.score * 0.3) + (a.comments * 0.2) + (Math.abs(a.sentiment) * 10) + (a.symbols.length * 5);\n const scoreB = (b.score * 0.3) + (b.comments * 0.2) + (Math.abs(b.sentiment) * 10) + (b.symbols.length * 5);\n return scoreB - scoreA;\n })\n .slice(0, 15); // Top 15 posts\n \n // Analyze trends\n const symbolCounts = {};\n const categoryBreakdown = {};\n let totalSentiment = 0;\n \n uniquePosts.forEach(post => {\n // Count symbol mentions\n post.symbols.forEach(symbol => {\n symbolCounts[symbol] = (symbolCounts[symbol] || 0) + 1;\n });\n \n // Count categories\n categoryBreakdown[post.category] = (categoryBreakdown[post.category] || 0) + 1;\n \n totalSentiment += post.sentiment;\n });\n \n // Get trending symbols (mentioned multiple times)\n const trendingSymbols = Object.entries(symbolCounts)\n .filter(([symbol, count]) => count >= 2)\n .sort((a, b) => b[1] - a[1])\n .slice(0, 5)\n .map(([symbol, count]) => ({ symbol, mentions: count }));\n \n const avgSentiment = uniquePosts.length > 0 ? totalSentiment / uniquePosts.length : 0;\n \n return {\n posts: uniquePosts,\n summary: {\n total_posts: uniquePosts.length,\n avg_sentiment: parseFloat(avgSentiment.toFixed(2)),\n trending_symbols: trendingSymbols,\n category_breakdown: categoryBreakdown,\n subreddits_analyzed: selectedSubreddits,\n sentiment_distribution: {\n bullish: uniquePosts.filter(p => p.sentiment > 2).length,\n neutral: uniquePosts.filter(p => Math.abs(p.sentiment) <= 2).length,\n bearish: uniquePosts.filter(p => p.sentiment < -2).length\n }\n },\n hot_topics: uniquePosts.slice(0, 5).map(p => ({\n title: p.title,\n sentiment: p.sentiment,\n symbols: p.symbols,\n engagement: p.score + p.comments\n }))\n };\n}\n\n// Execute and return results\nreturn main().then(result => {\n return [{ json: result }];\n}).catch(error => {\n console.error('Reddit analysis failed:', error);\n return [{\n json: {\n posts: [],\n summary: { error: 'Reddit API unavailable', total_posts: 0, avg_sentiment: 0 },\n hot_topics: []\n }\n }];\n});"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-1568,
-224
],
"id": "6fa3d0f5-0d4c-46a4-99f8-d071512d6244",
"name": "Enhanced Reddit Analysis",
"retryOnFail": true,
"disabled": true
},
{
"parameters": {
"url": "=https://www.alphavantage.co/query?function=NEWS_SENTIMENT&tickers={{$node[\"Daily Market Intelligence\"].json[\"ticker\"]}}&apikey=KMPIWDJQKLOFYCVH",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1136,
-416
],
"id": "d8b77d15-9a93-4343-89c0-4c828c59170a",
"name": "Alpha Vantage Data",
"disabled": true
},
{
"parameters": {
"url": "https://api.marketaux.com/v1/news/all",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"sendQuery": true,
"specifyQuery": "json",
"jsonQuery": "={\n \"industries\": \"Financial Services,Technology,Healthcare,Energy,Consumer,Real Estate\",\n \"published_after\": \"{{ $now.minus({days: 1}).toFormat('yyyy-MM-dd') + 'T' + $now.minus({days: 1}).toFormat('HH:mm') }}\",\n \"language\": \"en\",\n \"countries\": \"us,ca,gb,de,fr\",\n \"min_match_score\": \"50\",\n \"sort\": \"entity_match_score\",\n \"limit\": \"30\",\n \"include_entities\": \"true\",\n \"filter_entities\": \"true\"\n}",
"sendHeaders": true,
"specifyHeaders": "json",
"jsonHeaders": "{\n \"User-Agent\": \"Investment-Intelligence-Bot/2.0\",\n \"Accept\": \"application/json\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1152,
-48
],
"id": "e456a1ab-7df4-40b1-a853-4e3e5a4cf92a",
"name": "Marketaux",
"retryOnFail": true,
"waitBetweenTries": 5000,
"credentials": {
"httpQueryAuth": {
"id": "OTckOBmoipJH8QEO",
"name": "marketaux API"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
-992,
-16
],
"id": "27d56727-bf45-48fa-94c0-3feeddcbcd6a",
"name": "Merge"
},
{
"parameters": {
"jsCode": "// Enhanced Filter & Score for NewsAPI + Marketaux\nconst items = $input.all();\n\n// Combine articles from both NewsAPI and Marketaux\nlet allArticles = [];\n\nitems.forEach(item => {\n if (item.json.articles) {\n // NewsAPI format\n item.json.articles.forEach(article => {\n allArticles.push({\n ...article,\n source_type: 'newsapi',\n source_name: article.source?.name || 'Unknown'\n });\n });\n } else if (item.json.data) {\n // Marketaux format\n item.json.data.forEach(article => {\n allArticles.push({\n title: article.title,\n description: article.description,\n url: article.url,\n urlToImage: article.image_url,\n publishedAt: article.published_at,\n content: article.snippet,\n source: { name: article.source },\n source_type: 'marketaux',\n source_name: article.source,\n entities: article.entities || [], // Marketaux advantage\n industries: article.industries || [],\n countries: article.countries || []\n });\n });\n }\n});\n\n// INVESTMENT INTELLIGENCE SCORING SYSTEM\n\n// High-impact keywords with weighted scoring\nconst investmentKeywords = {\n // Core investment terms (high weight)\n 'ipo': 5, 'earnings': 4, 'revenue': 3, 'guidance': 4,\n 'merger': 4, 'acquisition': 4, 'buyout': 5, 'takeover': 4,\n 'valuation': 3, 'undervalued': 4, 'overvalued': 3,\n 'dividend': 3, 'split': 3, 'spinoff': 4,\n \n // Innovation & growth (medium-high weight) \n 'innovation': 3, 'breakthrough': 4, 'disruptive': 3,\n 'startup': 3, 'funding': 3, 'venture capital': 4,\n 'artificial intelligence': 4, 'ai': 3, 'machine learning': 3,\n 'blockchain': 2, 'fintech': 3, 'saas': 2,\n \n // Market dynamics (medium weight)\n 'federal reserve': 4, 'interest rate': 3, 'inflation': 3,\n 'recession': 3, 'bull market': 3, 'bear market': 3,\n 'volatility': 2, 'correction': 3, 'rally': 2,\n \n // Sector-specific (medium weight)\n 'small business': 2, 'small cap': 3, 'mid cap': 2,\n 'emerging markets': 3, 'growth stock': 3, 'value stock': 3,\n 'dividend stock': 2, 'blue chip': 2,\n \n // Strategic/Corporate (medium weight)\n 'strategic': 2, 'restructuring': 3, 'turnaround': 3,\n 'management change': 3, 'ceo': 2, 'leadership': 2,\n 'expansion': 2, 'partnership': 2, 'joint venture': 3\n};\n\n// Exclusion keywords (immediate filter out)\nconst exclusionKeywords = [\n 'meme stock', 'wallstreetbets', 'reddit army',\n 'pump and dump', 'penny stock scam',\n 'cryptocurrency crash', 'bitcoin speculation',\n 'political scandal', 'celebrity gossip',\n 'sports betting', 'gambling'\n];\n\n// Premium source bonuses\nconst premiumSources = {\n 'reuters': 2, 'bloomberg': 2, 'wall street journal': 2,\n 'financial times': 2, 'cnbc': 1, 'marketwatch': 1,\n 'seeking alpha': 1, 'morningstar': 1, 'barron\\'s': 2,\n 'forbes': 1, 'business insider': 1\n};\n\n// Industry focus scoring\nconst targetIndustries = {\n 'technology': 2, 'financial services': 2, 'healthcare': 1,\n 'energy': 1, 'consumer': 1, 'real estate': 1,\n 'fintech': 3, 'biotech': 2, 'renewable energy': 2\n};\n\nfunction scoreArticle(article) {\n const title = (article.title || '').toLowerCase();\n const description = (article.description || '').toLowerCase();\n const content = title + ' ' + description;\n \n let score = 0;\n let scoreDetails = [];\n \n // 1. EXCLUSION CHECK (immediate elimination)\n for (const excluded of exclusionKeywords) {\n if (content.includes(excluded)) {\n return { \n score: 0, \n reason: 'excluded_content',\n details: [`Excluded: ${excluded}`]\n };\n }\n }\n \n // 2. KEYWORD SCORING\n let keywordMatches = 0;\n for (const [keyword, weight] of Object.entries(investmentKeywords)) {\n if (content.includes(keyword)) {\n score += weight;\n keywordMatches++;\n scoreDetails.push(`${keyword}: +${weight}`);\n }\n }\n \n // Minimum keyword threshold\n if (keywordMatches === 0) {\n return { \n score: 0, \n reason: 'no_investment_relevance',\n details: ['No investment keywords found']\n };\n }\n \n // 3. SOURCE QUALITY BONUS\n const source = (article.source_name || '').toLowerCase();\n for (const [premiumSource, bonus] of Object.entries(premiumSources)) {\n if (source.includes(premiumSource)) {\n score += bonus;\n scoreDetails.push(`Premium source (${premiumSource}): +${bonus}`);\n break;\n }\n }\n \n // 4. RECENCY BONUS\n const publishedAt = new Date(article.publishedAt);\n const hoursAgo = (Date.now() - publishedAt.getTime()) / (1000 * 60 * 60);\n \n if (hoursAgo <= 2) {\n score += 3;\n scoreDetails.push('Breaking news: +3');\n } else if (hoursAgo <= 6) {\n score += 2;\n scoreDetails.push('Very recent: +2');\n } else if (hoursAgo <= 12) {\n score += 1;\n scoreDetails.push('Recent: +1');\n } else if (hoursAgo > 48) {\n score -= 2;\n scoreDetails.push('Too old: -2');\n }\n \n // 5. MARKETAUX ENTITY BONUS\n if (article.source_type === 'marketaux' && article.entities && article.entities.length > 0) {\n score += 1;\n scoreDetails.push(`Entities detected: +1 (${article.entities.length})`);\n }\n \n // 6. INDUSTRY FOCUS BONUS\n if (article.industries && article.industries.length > 0) {\n for (const industry of article.industries) {\n const industryLower = industry.toLowerCase();\n for (const [targetIndustry, bonus] of Object.entries(targetIndustries)) {\n if (industryLower.includes(targetIndustry)) {\n score += bonus;\n scoreDetails.push(`Industry focus (${targetIndustry}): +${bonus}`);\n break;\n }\n }\n }\n }\n \n // 7. TITLE QUALITY BONUS\n if (title.length > 50 && title.length < 120) {\n score += 1;\n scoreDetails.push('Good title length: +1');\n }\n \n // 8. CONTENT DEPTH BONUS \n if (description && description.length > 100) {\n score += 1;\n scoreDetails.push('Substantial description: +1');\n }\n \n // Cap maximum score\n score = Math.min(score, 15);\n \n return { \n score, \n details: scoreDetails,\n hoursAgo: Math.round(hoursAgo),\n keywordMatches,\n source_type: article.source_type\n };\n}\n\n// Process and score all articles\nconst scoredArticles = allArticles\n .map(article => ({\n ...article,\n ...scoreArticle(article)\n }))\n .filter(article => article.score > 0) // Only keep scored articles\n .sort((a, b) => b.score - a.score); // Sort by score descending\n\n// Remove near-duplicates (similar titles)\nconst uniqueArticles = [];\nfor (const article of scoredArticles) {\n const isDuplicate = uniqueArticles.some(existing => {\n const similarity = article.title && existing.title && \n article.title.substring(0, 60).toLowerCase() === \n existing.title.substring(0, 60).toLowerCase();\n return similarity;\n });\n \n if (!isDuplicate && uniqueArticles.length < 12) { // Limit to top 12\n uniqueArticles.push(article);\n }\n}\n\n// Analytics for the AI\nconst analytics = {\n total_processed: allArticles.length,\n total_scored: scoredArticles.length,\n total_unique: uniqueArticles.length,\n avg_score: uniqueArticles.length > 0 ? \n (uniqueArticles.reduce((sum, a) => sum + a.score, 0) / uniqueArticles.length).toFixed(2) : 0,\n source_breakdown: {\n newsapi: uniqueArticles.filter(a => a.source_type === 'newsapi').length,\n marketaux: uniqueArticles.filter(a => a.source_type === 'marketaux').length\n },\n top_score: uniqueArticles[0]?.score || 0,\n recency_distribution: {\n breaking: uniqueArticles.filter(a => a.hoursAgo <= 2).length,\n recent: uniqueArticles.filter(a => a.hoursAgo <= 12).length,\n older: uniqueArticles.filter(a => a.hoursAgo > 12).length\n }\n};\n\n// Return enhanced articles with analytics\nreturn uniqueArticles.map(article => ({ \n json: {\n ...article,\n _analytics: analytics,\n _timestamp: new Date().toISOString()\n }\n}));"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-832,
-16
],
"id": "610e2eb0-2922-436e-8616-1d9f177ffa34",
"name": "Filter & Score News1"
},
{
"parameters": {
"url": "https://api.reddit.com/r/investing+SecurityAnalysis+stocks+ValueInvesting+StockMarket+options+pennystocks/hot.json?limit=50",
"sendHeaders": true,
"specifyHeaders": "json",
"jsonHeaders": "{\"User-Agent\": \"Investment-Intelligence-Bot/2.0\"}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1152,
272
],
"id": "df506b97-012e-48db-b865-3ed9bae3a14b",
"name": "Reddit",
"retryOnFail": true
},
{
"parameters": {
"jsCode": "const redditData = $input.first().json;\nconst posts = redditData?.data?.children || [];\n\nreturn posts.slice(0, 20).map(post => ({\n json: {\n title: post.data.title,\n score: post.data.score,\n comments: post.data.num_comments,\n subreddit: post.data.subreddit\n }\n}));"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-912,
272
],
"id": "fd016d8e-b900-43a9-8fba-1508787beab9",
"name": "Code"
},
{
"parameters": {
"resource": "databasePage",
"databaseId": {
"__rl": true,
"mode": "id",
"value": "260f1fd5-64ee-8129-80e4-fd5545cdfc04",
"__regex": "^([0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12})"
},
"title": "={{$json.tweet_drafts[0]?.title || \"AI Analysis Failed - \" + $now.toFormat('yyyy-MM-dd')}}",
"propertiesUi": {
"propertyValues": [
{
"key": "Date|date",
"date": "={{$now.toISODate()}}"
},
{
"key": "Total Stories|number",
"numberValue": "={{$json.total_stories}}"
},
{
"key": "Highest Score|number",
"numberValue": "={{$json.highest_engagement_score}}"
},
{
"key": "Autoposted|checkbox",
"checkboxValue": "={{$json.auto_post_eligible}}"
},
{
"key": "Compliance review|checkbox",
"checkboxValue": "={{$json.compliance_review_needed}}"
},
{
"key": "Content|rich_text",
"textContent": "={{JSON.stringify($json.tweet_drafts, null, 2).slice(0, 1990)}}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.notion",
"typeVersion": 2.2,
"position": [
192,
96
],
"id": "bedd469b-2f3d-4654-9ae1-1c35dc420ac6",
"name": "Create a database page",
"credentials": {
"notionApi": {
"id": "zIiFCMgPPBho7wt6",
"name": "Notion account"
}
}
}
],
"pinData": {},
"connections": {
"Daily Market Intelligence": {
"main": [
[
{
"node": "Fetch Market News",
"type": "main",
"index": 0
},
{
"node": "Alpha Vantage Data",
"type": "main",
"index": 0
},
{
"node": "Marketaux",
"type": "main",
"index": 0
},
{
"node": "Enhanced Reddit Analysis",
"type": "main",
"index": 0
},
{
"node": "Reddit",
"type": "main",
"index": 0
}
]
]
},
"Fetch Market News": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Process Reddit Sentiment": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Format Content Output": {
"main": [
[
{
"node": "Send Daily Brief",
"type": "main",
"index": 0
},
{
"node": "Auto-Post Gate",
"type": "main",
"index": 0
},
{
"node": "Performance Analytics",
"type": "main",
"index": 0
},
{
"node": "Create a database page",
"type": "main",
"index": 0
}
]
]
},
"Auto-Post Gate": {
"main": [
[
{
"node": "X/Twitter Post",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "Format Content Output",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Enhanced Reddit Analysis": {
"main": [
[]
]
},
"Alpha Vantage Data": {
"main": [
[]
]
},
"Marketaux": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Filter & Score News1",
"type": "main",
"index": 0
}
]
]
},
"Filter & Score News1": {
"main": [
[
{
"node": "Process Reddit Sentiment",
"type": "main",
"index": 0
}
]
]
},
"Reddit": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Process Reddit Sentiment",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "538377ae-508a-4a14-8444-8da788b4732a",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "e6034b9dba558a3d02229728850f33292d5270e5ac2a2157168bb9b6d9e85a80"
},
"id": "v1k9uMeeVpVsKocq",
"tags": []
}