Sergey Skorobogatov
Templates by Sergey Skorobogatov
Generate stock market insights with technical analysis, AI, and Telegram publishing
π AI Stock Analytics & BCS "Profit" Social Network Publishing Workflow This workflow automatically generates stock market insights for selected tickers (e.g. GAZP, SBER, LKOH) using historical data, technical indicators, and an AI model. The results are then sent to Telegram for quick moderation and publishing. π What this workflow does Runs twice a day on a schedule with a predefined list of tickers. Fetches historical market data from a broker API. Calculates key technical indicators (RSI, EMA/SMA, MACD, Bollinger Bands, ADX). Generates an investment post (title + summary) using an LLM. Stores results in a PostgreSQL database. Sends a draft post to Telegram with inline buttons βPublishβ and βRetryβ. Handles Telegram actions: publishes the post to the final channel or re-runs the generation process. π Key features Multi-ticker support in a single run. Automatic error handling (e.g. missing data or invalid AI JSON output). Human-in-the-loop moderation through Telegram before publishing. PostgreSQL integration for history and analytics storage. Flexible structure: easy to extend with new tickers, indicators, or publishing channels. π οΈ Nodes used Trigger: Schedule (twice daily) + Telegram Trigger (button callbacks). Data: HTTP Request (broker API), Function (technical analysis calculations). AI: OpenAI / OpenRouter with structured JSON output. Storage: PostgreSQL (analytics history). Messaging: Telegram (drafts and publishing). π Who is this for Fintech startups looking to automate market content. Investment bloggers posting daily stock analysis. Analysts experimenting with trading strategies on real market data.
Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter
GiggleGPTBot β Witty Telegram Bot with AI & Postgres π Overview GiggleGPTBot is a witty Telegram bot built with n8n, OpenRouter, and Postgres. It delivers short jokes, motivational one-liners, and playful roasts, responds to mentions, and posts scheduled witty content. The workflow also tracks user activity and provides lightweight statistics and leaderboards. --- β¨ Features π€ AI-powered humor engine β replies with jokes, motivation, random witty lines, or sarcastic roasts. π¬ Command support β /joke, /inspire, /random, /roast, /help, /stats, /top. π― Mention detection β replies when users tag @GiggleGPTBot. β° Scheduled posts β morning jokes, daily motivation, and random wisdom at configured times. π User analytics β counts messages, commands, reactions, and generates leaderboards. ποΈ Postgres persistence β robust schema with tables for messages, responses, stats, and schedules. --- π οΈ How It Works Triggers Telegram Trigger β receives all messages and commands from a chat. Schedule Trigger β runs hourly to check for planned posts. Processing Switch routes commands (/joke, /inspire, /random, /roast, /help, /stats, /top). Chat history fetches the latest context. Mention Analysis determines if the bot was mentioned. Generating an information response builds replies for /help, /stats, /top. AI nodes (AI response to command, AI response to mention, AI post generation) craft witty content via OpenRouter. Persistence Init Database ensures tables exist (usermessages, botresponses, botcommands, messagereactions, scheduledposts, userstats). Logging nodes update stats and store every bot/user interaction. Delivery Replies are sent back via Telegram Send nodes (Send AI response, Send info reply, Reply to Mention, Submit scheduled post). --- βοΈ Setup Instructions Create a Telegram Bot with @BotFather and get your API token. Add credentials in n8n: Telegram API (your bot token) OpenRouter (API key from openrouter.ai) Postgres (use your DB, Supabase works well). Run the Init Database node once to create all required tables. (Optional) Seed schedule with the Adding a schedule node β it inserts: Morning joke at 06:00 Daily motivation at 09:00 Random wisdom at 17:00 (Adjust chat_id to your group/channel ID.) Activate workflow and connect Telegram Webhook or Polling. --- π Database Schema user\_messages β stores user chat messages. bot\_responses β saves bot replies. bot\_commands β logs command usage. message\_reactions β tracks reactions. scheduled\_posts β holds scheduled jokes/wisdom/motivation. user\_stats β aggregates per-user message/command counts and activity. --- π Example Commands /joke β witty one-liner with light irony. /inspire β short motivational phrase. /random β unexpected witty remark. /roast β sarcastic roast (no offensive targeting). /stats β shows your personal stats. /top β displays leaderboard. /help β lists available commands. @GiggleGPTBot + message β bot replies in context. --- π Customization Ideas Add new command categories (/quote, /fact, /news). Expand analytics with reaction counts or streaks. Localize prompts into multiple languages. Adjust CRON schedules for posts. --- β Requirements Telegram Bot token OpenRouter API key Postgres database --- π¦ Import this workflow, configure credentials, run the DB initializer β and your witty AI-powered Telegram companion is ready!