Skip to content

Self-improving AI Employees for everyone

feat(schema): Wave 8 - slim twitterNodes + telegramNodes (-449 LOC)

trohitge18f501333af
diff --git a/client/src/nodeDefinitions/telegramNodes.ts b/client/src/nodeDefinitions/telegramNodes.ts
index 227759bb..8834479b 100644
--- a/client/src/nodeDefinitions/telegramNodes.ts
+++ b/client/src/nodeDefinitions/telegramNodes.ts
@@ -52,182 +52,15 @@ export const telegramNodes: Record<string, INodeTypeDescription> = {
description: 'Connect to AI Agent tool handle'
}
],
+ // Wave 8: schema lives on backend (TelegramSendParams).
properties: [
- // ===== RECIPIENT =====
- {
- displayName: 'Send To',
- name: 'recipient_type',
- type: 'options',
- options: [
- { name: 'Self (Bot Owner)', value: 'self' },
- { name: 'User / Chat ID', value: 'user' },
- { name: 'Group', value: 'group' }
- ],
- default: 'self',
- description: 'Send to bot owner, specific user, or group'
- },
- {
- displayName: 'Chat ID',
- name: 'chat_id',
- type: 'string',
- default: '',
- placeholder: '123456789 or @username',
- description: 'Telegram chat ID (numeric) or @username',
- displayOptions: {
- show: { recipient_type: ['user', 'group'] }
- }
- },
-
- // ===== MESSAGE TYPE =====
- {
- displayName: 'Message Type',
- name: 'message_type',
- type: 'options',
- options: [
- { name: 'Text', value: 'text' },
- { name: 'Photo', value: 'photo' },
- { name: 'Document', value: 'document' },
- { name: 'Location', value: 'location' },
- { name: 'Contact', value: 'contact' }
- ],
- default: 'text',
- description: 'Type of message to send'
- },
-
- // ===== TEXT MESSAGE =====
- {
- displayName: 'Message Text',
- name: 'text',
- type: 'string',
- default: '',
- required: true,
- typeOptions: { rows: 4 },
- description: 'Text message content',
- placeholder: 'Enter your message...',
- displayOptions: {
- show: { message_type: ['text'] }
- }
- },
-
- // ===== MEDIA MESSAGES (photo, document) =====
- {
- displayName: 'Media URL',
- name: 'media_url',
- type: 'string',
- default: '',
- required: true,
- placeholder: 'https://example.com/image.jpg',
- description: 'URL of the media file or file_id from previous message',
- displayOptions: {
- show: { message_type: ['photo', 'document'] }
- }
- },
- {
- displayName: 'Caption',
- name: 'caption',
- type: 'string',
- default: '',
- typeOptions: { rows: 2 },
- description: 'Optional caption for media',
- displayOptions: {
- show: { message_type: ['photo', 'document'] }
- }
- },
-
- // ===== LOCATION MESSAGE =====
- {
- displayName: 'Latitude',
- name: 'latitude',
- type: 'number',
- default: 0,
- required: true,
- description: 'Location latitude (-90 to 90)',
- displayOptions: {
- show: { message_type: ['location'] }
- }
- },
- {
- displayName: 'Longitude',
- name: 'longitude',
- type: 'number',
- default: 0,
- required: true,
- description: 'Location longitude (-180 to 180)',
- displayOptions: {
- show: { message_type: ['location'] }
- }
- },
-
- // ===== CONTACT MESSAGE =====
- {
- displayName: 'Phone Number',
- name: 'phone_number',
- type: 'string',
- default: '',
- required: true,
- placeholder: '+1234567890',
- description: 'Contact phone number (with country code)',
- displayOptions: {
- show: { message_type: ['contact'] }
- }
- },
- {
- displayName: 'First Name',
- name: 'first_name',
- type: 'string',
- default: '',
- required: true,
- placeholder: 'John',
- description: 'Contact first name',
- displayOptions: {
- show: { message_type: ['contact'] }
- }
- },
- {
- displayName: 'Last Name',
- name: 'last_name',
- type: 'string',
- default: '',
- placeholder: 'Doe',
- description: 'Contact last name (optional)',
- displayOptions: {
- show: { message_type: ['contact'] }
- }
- },
-
- // ===== OPTIONS =====
- {
- displayName: 'Parse Mode',
- name: 'parse_mode',
- type: 'options',
- options: [
- { name: 'Auto (Recommended)', value: 'Auto' },
- { name: 'None', value: '' },
- { name: 'HTML', value: 'HTML' },
- { name: 'Markdown', value: 'Markdown' },
- { name: 'MarkdownV2', value: 'MarkdownV2' }
- ],
- default: 'Auto',
- description: 'Auto converts LLM markdown to Telegram HTML. Use None for raw text.',
- displayOptions: {
- show: { message_type: ['text', 'photo', 'document'] }
- }
- },
- {
- displayName: 'Silent',
- name: 'silent',
- type: 'boolean',
- default: false,
- description: 'Send message without notification sound'
- },
- {
- displayName: 'Reply To Message ID',
- name: 'reply_to_message_id',
- type: 'number',
- default: 0,
- description: 'If set, sends the message as a reply to this message ID'
- }
- ]
+ { displayName: 'Chat ID', name: 'chatId', type: 'string' as any, default: '', placeholder: '123456789 or @username' },
+ { displayName: 'Message Text', name: 'text', type: 'string' as any, default: '', placeholder: 'Enter your message...' },
+ { displayName: 'Media URL', name: 'mediaUrl', type: 'string' as any, default: '', placeholder: 'https://example.com/image.jpg' },
+ { displayName: 'Phone Number', name: 'phone', type: 'string' as any, default: '', placeholder: '+1234567890' },
+ { displayName: 'First Name', name: 'firstName', type: 'string' as any, default: '', placeholder: 'John' },
+ { displayName: 'Last Name', name: 'lastName', type: 'string' as any, default: '', placeholder: 'Doe' },
+ ],
},
// Telegram Receive Message - triggers workflow on incoming messages
@@ -247,100 +80,13 @@ export const telegramNodes: Record<string, INodeTypeDescription> = {
type: 'main' as NodeConnectionType,
description: 'Received message data (message_id, chat_id, chat_type, from_id, from_username, text, content_type, date)'
}],
+ // Wave 8: schema lives on backend (TelegramReceiveParams).
properties: [
- // ===== CONTENT TYPE FILTER =====
- {
- displayName: 'Content Type',
- name: 'contentTypeFilter',
- type: 'options',
- options: [
- { name: 'All Types', value: 'all' },
- { name: 'Text Only', value: 'text' },
- { name: 'Photo Only', value: 'photo' },
- { name: 'Video Only', value: 'video' },
- { name: 'Audio Only', value: 'audio' },
- { name: 'Voice Only', value: 'voice' },
- { name: 'Document Only', value: 'document' },
- { name: 'Sticker Only', value: 'sticker' },
- { name: 'Location Only', value: 'location' },
- { name: 'Contact Only', value: 'contact' },
- { name: 'Poll Only', value: 'poll' }
- ],
- default: 'all',
- description: 'Filter by message content type'
- },
-
- // ===== SENDER FILTER (WhatsApp-style dropdown) =====
- {
- displayName: 'Sender Filter',
- name: 'senderFilter',
- type: 'options',
- options: [
- { name: 'All Messages', value: 'all' },
- { name: 'From Self (Bot Owner)', value: 'self' },
- { name: 'Private Chats Only', value: 'private' },
- { name: 'Groups Only', value: 'group' },
- { name: 'Supergroups Only', value: 'supergroup' },
- { name: 'Channels Only', value: 'channel' },
- { name: 'From Specific Chat', value: 'specific_chat' },
- { name: 'From Specific User', value: 'specific_user' },
- { name: 'Contains Keywords', value: 'keywords' }
- ],
- default: 'all',
- description: 'Filter which messages trigger the workflow'
- },
-
- // ===== CONDITIONAL FIELDS =====
- {
- displayName: 'Chat ID',
- name: 'chat_id',
- type: 'string',
- default: '',
- required: true,
- placeholder: '123456789',
- description: 'Only trigger for messages from this specific chat ID',
- displayOptions: {
- show: { senderFilter: ['specific_chat'] }
- }
- },
- {
- displayName: 'User ID',
- name: 'from_user',
- type: 'string',
- default: '',
- required: true,
- placeholder: '987654321',
- description: 'Only trigger for messages from this specific user ID',
- displayOptions: {
- show: { senderFilter: ['specific_user'] }
- }
- },
- {
- displayName: 'Keywords',
- name: 'keywords',
- type: 'string',
- default: '',
- required: true,
- placeholder: 'help, support, info',
- description: 'Comma-separated keywords to trigger on (case-insensitive)',
- displayOptions: {
- show: { senderFilter: ['keywords'] }
- }
- },
-
- // ===== OPTIONS =====
- {
- displayName: 'Ignore Bot Messages',
- name: 'ignoreBots',
- type: 'boolean',
- default: true,
- description: 'Do not trigger on messages from other bots',
- displayOptions: {
- show: { senderFilter: ['all', 'private', 'group', 'supergroup', 'channel', 'specific_chat', 'specific_user', 'keywords'] }
- }
- }
- ]
- }
+ { displayName: 'Chat ID', name: 'chatId', type: 'string' as any, default: '', placeholder: '123456789' },
+ { displayName: 'User ID', name: 'fromUser', type: 'string' as any, default: '', placeholder: '987654321' },
+ { displayName: 'Keywords', name: 'keywords', type: 'string' as any, default: '', placeholder: 'help, support, info' },
+ ],
+ },
};
// ============================================================================
diff --git a/client/src/nodeDefinitions/twitterNodes.ts b/client/src/nodeDefinitions/twitterNodes.ts
index a3d9e3c4..51eb0039 100644
--- a/client/src/nodeDefinitions/twitterNodes.ts
+++ b/client/src/nodeDefinitions/twitterNodes.ts
@@ -52,111 +52,13 @@ export const twitterNodes: Record<string, INodeTypeDescription> = {
description: 'Connect to AI Agent tool handle'
}
],
+ // Wave 8: schema lives on backend (TwitterSendParams).
properties: [
- // ===== ACTION =====
- {
- displayName: 'Action',
- name: 'action',
- type: 'options',
- options: [
- { name: 'Post Tweet', value: 'tweet' },
- { name: 'Reply to Tweet', value: 'reply' },
- { name: 'Retweet', value: 'retweet' },
- { name: 'Quote Tweet', value: 'quote' },
- { name: 'Like Tweet', value: 'like' },
- { name: 'Unlike Tweet', value: 'unlike' },
- { name: 'Delete Tweet', value: 'delete' }
- ],
- default: 'tweet',
- description: 'Action to perform on Twitter'
- },
-
- // ===== TWEET TEXT (for tweet, reply, quote) =====
- {
- displayName: 'Tweet Text',
- name: 'text',
- type: 'string',
- default: '',
- required: true,
- typeOptions: { rows: 4 },
- description: 'Tweet content (max 280 characters)',
- placeholder: "What's happening?",
- displayOptions: {
- show: { action: ['tweet', 'reply', 'quote'] }
- }
- },
-
- // ===== TWEET ID (for reply, retweet, quote, like, unlike, delete) =====
- {
- displayName: 'Tweet ID',
- name: 'tweet_id',
- type: 'string',
- default: '',
- required: true,
- placeholder: '1234567890123456789',
- description: 'ID of the tweet to interact with',
- displayOptions: {
- show: { action: ['reply', 'retweet', 'quote', 'like', 'unlike', 'delete'] }
- }
- },
-
- // ===== MEDIA (for tweet, reply, quote) =====
- {
- displayName: 'Include Media',
- name: 'include_media',
- type: 'boolean',
- default: false,
- description: 'Attach images or videos to the tweet',
- displayOptions: {
- show: { action: ['tweet', 'reply', 'quote'] }
- }
- },
- {
- displayName: 'Media URLs',
- name: 'media_urls',
- type: 'string',
- default: '',
- placeholder: 'https://example.com/image1.jpg, https://example.com/image2.jpg',
- description: 'Comma-separated URLs of media to attach (max 4 images or 1 video)',
- displayOptions: {
- show: { action: ['tweet', 'reply', 'quote'], include_media: [true] }
- }
- },
-
- // ===== POLL (for tweet) =====
- {
- displayName: 'Include Poll',
- name: 'include_poll',
- type: 'boolean',
- default: false,
- description: 'Create a poll with this tweet',
- displayOptions: {
- show: { action: ['tweet'] }
- }
- },
- {
- displayName: 'Poll Options',
- name: 'poll_options',
- type: 'string',
- default: '',
- placeholder: 'Option 1, Option 2, Option 3',
- description: 'Comma-separated poll options (2-4 options, max 25 chars each)',
- displayOptions: {
- show: { action: ['tweet'], include_poll: [true] }
- }
- },
- {
- displayName: 'Poll Duration (minutes)',
- name: 'poll_duration',
- type: 'number',
- default: 1440,
- typeOptions: { minValue: 5, maxValue: 10080 },
- description: 'Poll duration in minutes (5 min - 7 days)',
- displayOptions: {
- show: { action: ['tweet'], include_poll: [true] }
- }
- }
- ]
+ { displayName: 'Tweet Text', name: 'text', type: 'string' as any, default: '', placeholder: "What's happening?" },
+ { displayName: 'Tweet ID', name: 'tweetId', type: 'string' as any, default: '', placeholder: '1234567890123456789' },
+ { displayName: 'Media URLs', name: 'mediaUrls', type: 'string' as any, default: '', placeholder: 'https://example.com/image1.jpg, https://example.com/image2.jpg' },
+ { displayName: 'Poll Options', name: 'pollOptions', type: 'string' as any, default: '', placeholder: 'Option 1, Option 2, Option 3' },
+ ],
},
// Twitter Receive - Trigger on mentions, searches, timeline updates
@@ -176,72 +78,11 @@ export const twitterNodes: Record<string, INodeTypeDescription> = {
type: 'main' as NodeConnectionType,
description: 'Received tweet data (tweet_id, text, author_id, author_username, created_at, metrics)'
}],
+ // Wave 8: schema lives on backend (TwitterReceiveParams).
properties: [
- // ===== TRIGGER TYPE =====
- {
- displayName: 'Trigger On',
- name: 'trigger_type',
- type: 'options',
- options: [
- { name: 'Mentions', value: 'mentions' },
- { name: 'Search Results', value: 'search' },
- { name: 'User Timeline', value: 'timeline' }
- ],
- default: 'mentions',
- description: 'What events should trigger this workflow'
- },
-
- // ===== SEARCH QUERY (for search trigger) =====
- {
- displayName: 'Search Query',
- name: 'search_query',
- type: 'string',
- default: '',
- required: true,
- placeholder: 'from:elonmusk OR #AI',
- description: 'Twitter search query (supports operators like from:, to:, #, -)',
- displayOptions: {
- show: { trigger_type: ['search'] }
- }
- },
-
- // ===== USER ID (for timeline trigger) =====
- {
- displayName: 'User ID',
- name: 'user_id',
- type: 'string',
- default: '',
- placeholder: '12345678',
- description: 'Twitter user ID to monitor (leave empty for authenticated user)',
- displayOptions: {
- show: { trigger_type: ['timeline'] }
- }
- },
-
- // ===== OPTIONS =====
- {
- displayName: 'Filter Retweets',
- name: 'filter_retweets',
- type: 'boolean',
- default: true,
- description: 'Exclude retweets from results'
- },
- {
- displayName: 'Filter Replies',
- name: 'filter_replies',
- type: 'boolean',
- default: false,
- description: 'Exclude replies from results'
- },
- {
- displayName: 'Poll Interval (seconds)',
- name: 'poll_interval',
- type: 'number',
- default: 60,
- typeOptions: { minValue: 15, maxValue: 3600 },
- description: 'How often to check for new tweets (15s - 1 hour)'
- }
- ]
+ { displayName: 'Search Query', name: 'searchQuery', type: 'string' as any, default: '', placeholder: 'from:elonmusk OR #AI' },
+ { displayName: 'User ID', name: 'userId', type: 'string' as any, default: '', placeholder: '12345678' },
+ ],
},
// Twitter Search - Search recent tweets
@@ -274,73 +115,12 @@ export const twitterNodes: Record<string, INodeTypeDescription> = {
description: 'Connect to AI Agent tool handle'
}
],
+ // Wave 8: schema lives on backend (TwitterSearchParams).
properties: [
- // ===== SEARCH QUERY =====
- {
- displayName: 'Search Query',
- name: 'query',
- type: 'string',
- default: '',
- required: true,
- placeholder: '#AI lang:en -is:retweet',
- description: 'Twitter search query with operators'
- },
-
- // ===== RESULT OPTIONS =====
- {
- displayName: 'Max Results',
- name: 'max_results',
- type: 'number',
- default: 10,
- typeOptions: { minValue: 10, maxValue: 100 },
- description: 'Maximum number of tweets to return (10-100)'
- },
- {
- displayName: 'Sort Order',
- name: 'sort_order',
- type: 'options',
- options: [
- { name: 'Recent', value: 'recency' },
- { name: 'Relevance', value: 'relevancy' }
- ],
- default: 'recency',
- description: 'Sort order for results'
- },
-
- // ===== TIME FILTERS =====
- {
- displayName: 'Start Time',
- name: 'start_time',
- type: 'string',
- default: '',
- placeholder: '2024-01-01T00:00:00Z',
- description: 'Start time for search (ISO 8601 format, optional)'
- },
- {
- displayName: 'End Time',
- name: 'end_time',
- type: 'string',
- default: '',
- placeholder: '2024-01-31T23:59:59Z',
- description: 'End time for search (ISO 8601 format, optional)'
- },
-
- // ===== INCLUDE OPTIONS =====
- {
- displayName: 'Include Metrics',
- name: 'include_metrics',
- type: 'boolean',
- default: true,
- description: 'Include tweet engagement metrics (likes, retweets, replies)'
- },
- {
- displayName: 'Include Author Info',
- name: 'include_author',
- type: 'boolean',
- default: true,
- description: 'Include author details (username, name, profile)'
- }
- ]
+ { displayName: 'Search Query', name: 'query', type: 'string' as any, default: '', placeholder: '#AI lang:en -is:retweet' },
+ { displayName: 'Start Time', name: 'startTime', type: 'string' as any, default: '', placeholder: '2024-01-01T00:00:00Z' },
+ { displayName: 'End Time', name: 'endTime', type: 'string' as any, default: '', placeholder: '2024-01-31T23:59:59Z' },
+ ],
},
// Twitter User - User lookup and profile operations (dual-purpose: workflow + AI tool)
@@ -373,65 +153,12 @@ export const twitterNodes: Record<string, INodeTypeDescription> = {
description: 'Connect to AI Agent input-tools handle'
}
],
+ // Wave 8: schema lives on backend (TwitterUserParams).
properties: [
- // ===== OPERATION =====
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- options: [
- { name: 'Get My Profile', value: 'me' },
- { name: 'Lookup by Username', value: 'by_username' },
- { name: 'Lookup by ID', value: 'by_id' },
- { name: 'Get Followers', value: 'followers' },
- { name: 'Get Following', value: 'following' }
- ],
- default: 'me',
- description: 'User operation to perform'
- },
-
- // ===== USERNAME (for by_username) =====
- {
- displayName: 'Username',
- name: 'username',
- type: 'string',
- default: '',
- required: true,
- placeholder: 'elonmusk',
- description: 'Twitter username (without @)',
- displayOptions: {
- show: { operation: ['by_username'] }
- }
- },
-
- // ===== USER ID (for by_id, followers, following) =====
- {
- displayName: 'User ID',
- name: 'user_id',
- type: 'string',
- default: '',
- required: true,
- placeholder: '44196397',
- description: 'Twitter user ID',
- displayOptions: {
- show: { operation: ['by_id', 'followers', 'following'] }
- }
- },
-
- // ===== PAGINATION (for followers, following) =====
- {
- displayName: 'Max Results',
- name: 'max_results',
- type: 'number',
- default: 100,
- typeOptions: { minValue: 1, maxValue: 1000 },
- description: 'Maximum number of users to return',
- displayOptions: {
- show: { operation: ['followers', 'following'] }
- }
- }
- ]
- }
+ { displayName: 'Username', name: 'username', type: 'string' as any, default: '', placeholder: 'elonmusk' },
+ { displayName: 'User ID', name: 'userId', type: 'string' as any, default: '', placeholder: '44196397' },
+ ],
+ },
};
// ============================================================================
diff --git a/server/models/nodes.py b/server/models/nodes.py
index a2a6c97a..76a5b906 100644
--- a/server/models/nodes.py
+++ b/server/models/nodes.py
@@ -609,12 +609,80 @@ class MasterSkillParams(BaseNodeParams):
class TelegramReceiveParams(BaseNodeParams):
"""Parameters for Telegram receive trigger node."""
type: Literal["telegramReceive"]
- sender_filter: str = Field(default="all", alias="senderFilter")
+ content_type_filter: Literal["all", "text", "photo", "video", "audio", "voice", "document", "sticker", "location", "contact", "poll"] = Field(
+ default="all",
+ alias="contentTypeFilter",
+ json_schema_extra={"options": [
+ {"name": "All Types", "value": "all"},
+ {"name": "Text Only", "value": "text"},
+ {"name": "Photo Only", "value": "photo"},
+ {"name": "Video Only", "value": "video"},
+ {"name": "Audio Only", "value": "audio"},
+ {"name": "Voice Only", "value": "voice"},
+ {"name": "Document Only", "value": "document"},
+ {"name": "Sticker Only", "value": "sticker"},
+ {"name": "Location Only", "value": "location"},
+ {"name": "Contact Only", "value": "contact"},
+ {"name": "Poll Only", "value": "poll"},
+ ]},
+ )
+ sender_filter: Literal["all", "self", "private", "group", "supergroup", "channel", "specific_chat", "specific_user", "keywords"] = Field(
+ default="all",
+ alias="senderFilter",
+ json_schema_extra={"options": [
+ {"name": "All Messages", "value": "all"},
+ {"name": "From Self (Bot Owner)", "value": "self"},
+ {"name": "Private Chats Only", "value": "private"},
+ {"name": "Groups Only", "value": "group"},
+ {"name": "Supergroups Only", "value": "supergroup"},
+ {"name": "Channels Only", "value": "channel"},
+ {"name": "From Specific Chat", "value": "specific_chat"},
+ {"name": "From Specific User", "value": "specific_user"},
+ {"name": "Contains Keywords", "value": "keywords"},
+ ]},
+ )
+ chat_id: str = Field(
+ default="",
+ alias="chatId",
+ json_schema_extra={"displayOptions": {"show": {"sender_filter": ["specific_chat"]}}},
+ )
+ from_user: str = Field(
+ default="",
+ alias="fromUser",
+ json_schema_extra={"displayOptions": {"show": {"sender_filter": ["specific_user"]}}},
+ )
+ keywords: str = Field(
+ default="",
+ json_schema_extra={"displayOptions": {"show": {"sender_filter": ["keywords"]}}},
+ )
+ ignore_bots: bool = Field(default=True, alias="ignoreBots")
class TwitterReceiveParams(BaseNodeParams):
- """Parameters for Twitter receive trigger node."""
+ """Parameters for Twitter receive trigger node (polling-based)."""
type: Literal["twitterReceive"]
+ trigger_type: Literal["mentions", "search", "timeline"] = Field(
+ default="mentions",
+ alias="triggerType",
+ json_schema_extra={"options": [
+ {"name": "Mentions", "value": "mentions"},
+ {"name": "Search Results", "value": "search"},
+ {"name": "User Timeline", "value": "timeline"},
+ ]},
+ )
+ search_query: str = Field(
+ default="",
+ alias="searchQuery",
+ json_schema_extra={"displayOptions": {"show": {"trigger_type": ["search"]}}},
+ )
+ user_id: str = Field(
+ default="",
+ alias="userId",
+ json_schema_extra={"displayOptions": {"show": {"trigger_type": ["timeline"]}}},
+ )
+ filter_retweets: bool = Field(default=True, alias="filterRetweets")
+ filter_replies: bool = Field(default=False, alias="filterReplies")
+ poll_interval: int = Field(default=60, alias="pollInterval", ge=15, le=3600)
class TelegramSendParams(BaseNodeParams):