Skip to content

Self-improving AI Employees for everyone

feat: markdown formatter for LLM output, Twitter OAuth fix, bump to v0.0.43

trohitgf8c2e1a5306a
diff --git a/CLAUDE.md b/CLAUDE.md
index dc08175a..64abc847 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -67,6 +67,7 @@ server/services/
├── model_registry.py # ModelRegistryService - model constraints from OpenRouter + llm_defaults
├── nodejs_client.py # HTTP client for Node.js code executor
├── pricing.py # LLM and API cost calculation (loads config/pricing.json)
+├── markdown_formatter.py # GFM markdown to platform-specific formatting (Telegram HTML, WhatsApp, plain)
├── telegram_service.py # TelegramService with python-telegram-bot long-polling
├── tracked_http.py # HTTPX event hooks for automatic API cost tracking
├── proxy/ # Residential proxy provider management
@@ -903,7 +904,7 @@ Android device connection is configured via the Credentials Modal (Android panel
- **mediaControl**: Media playback control - volume control, playback control, play media files
### WhatsApp Nodes (3 nodes)
-- **whatsappSend**: **Dual-purpose node** - Send WhatsApp messages (text, image, video, audio, document, sticker, location, contact) to contacts, groups, or newsletter channels. Works as workflow node OR AI Agent tool. Group: `['whatsapp', 'tool']`. Recipient types: Self (connected phone), Phone Number, Group, Channel (newsletter). Channel messages only support text, image, video, audio, document (NOT sticker, location, contact). Full parameter schema for message type, media URL, location coordinates, contact vCard, channel JID.
+- **whatsappSend**: **Dual-purpose node** - Send WhatsApp messages (text, image, video, audio, document, sticker, location, contact) to contacts, groups, or newsletter channels. Works as workflow node OR AI Agent tool. Group: `['whatsapp', 'tool']`. Recipient types: Self (connected phone), Phone Number, Group, Channel (newsletter). Channel messages only support text, image, video, audio, document (NOT sticker, location, contact). **Format Markdown** toggle (default: true): converts GFM markdown to WhatsApp-native formatting via `markdown_formatter.to_whatsapp()`. Full parameter schema for message type, media URL, location coordinates, contact vCard, channel JID.
- **whatsappDb**: **Dual-purpose node** - Comprehensive WhatsApp database query node with 18 operations. Works as workflow node OR AI Agent tool. Group: `['whatsapp', 'tool']`. Operations:
- `chat_history`: Retrieve messages from individual or group chats with filtering, pagination, and optional media download
- `search_groups`: Search groups by name
@@ -932,11 +933,11 @@ Unified social messaging nodes for multi-platform communication. Supports WhatsA
- **socialSend**: **Dual-purpose node** - Send messages to any supported platform. Works as workflow node OR AI Agent tool. Supports text, image, video, audio, document, sticker, location, contact, poll, buttons, list message types.
### Twitter/X Nodes (4 nodes)
-Twitter/X integration using the official XDK Python SDK with OAuth 2.0 PKCE authentication.
+Twitter/X integration using the official XDK Python SDK with OAuth 2.0 PKCE authentication. All sync XDK calls wrapped in `asyncio.to_thread()` to avoid blocking the event loop. Lazy token refresh on 401/403 errors instead of validating on every call.
- **twitterSend**: **Dual-purpose node** - Post tweets, reply, retweet, like/unlike, and delete tweets. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Actions: `tweet`, `reply`, `retweet`, `like`, `unlike`, `delete`. Parameters: action, text (280 char max), tweet_id, reply_to_id.
-- **twitterSearch**: **Dual-purpose node** - Search recent tweets using query operators. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Supports X API v2 query syntax: keywords, hashtags (#), mentions (@), from:user, to:user, -exclude, OR, lang:, has:links, has:media, is:retweet, -is:retweet.
-- **twitterUser**: **Dual-purpose node** - Look up user profiles and social connections. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Operations: `me` (get authenticated user), `by_username`, `by_id`, `followers`, `following`.
+- **twitterSearch**: **Dual-purpose node** - Search recent tweets with rich data via X API v2 expansions. Returns enriched tweets with `display_text` (expanded URLs), `author` profile, `public_metrics` (likes/retweets/replies/quotes/bookmarks/impressions), `media` attachments, `referenced_tweets` (quoted/replied), `note_tweet` for long-form content. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. `max_results` clamped to 10-100 (X API v2 minimum is 10). Supports query operators: keywords, hashtags (#), mentions (@), from:user, to:user, -exclude, OR, lang:, has:links, has:media, has:images, has:videos, is:retweet, -is:retweet, is:reply, is:quote, url:.
+- **twitterUser**: **Dual-purpose node** - Look up user profiles and social connections with description and created_at. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Operations: `me` (get authenticated user), `by_username`, `by_id`, `followers` (max_results 1-1000), `following` (max_results 1-1000).
- **twitterReceive**: Event-driven trigger that waits for incoming Twitter events (mentions, DMs, timeline updates). Group: `['social', 'trigger']`. Polling-based since X API free tier lacks webhooks.
#### Twitter OAuth 2.0 Authentication
@@ -959,33 +960,25 @@ Authentication is handled via OAuth 2.0 PKCE flow in the Credentials Modal:
| `client/src/components/CredentialsModal.tsx` | Twitter panel with OAuth button |
| `server/skills/social_agent/twitter-*-skill/` | 3 Twitter skills for AI agents |
+**Handler Architecture:**
+- All sync XDK calls wrapped in `asyncio.to_thread()` (XDK uses sync `requests` internally)
+- No `get_me()` validation on every call -- lazy token refresh on 401/403 via `_refresh_and_get_client()`
+- Search uses full X API v2 expansions and returns enriched data with expanded URLs, author profiles, media, metrics, referenced tweets
+- `max_results` clamped: search 10-100, followers/following 1-1000
+
**XDK SDK API Patterns:**
```python
from xdk import Client
-
-# Create client with OAuth 2.0 user token
client = Client(access_token=access_token)
-# Post tweet
client.posts.create(body={"text": "Hello world!"})
-
-# Reply to tweet
client.posts.create(body={"text": "Reply", "reply": {"in_reply_to_tweet_id": "123"}})
-
-# Retweet
client.users.repost_post(user_id, body={"tweet_id": "123"})
-
-# Like/Unlike
client.users.like_post(user_id, body={"tweet_id": "123"})
client.users.unlike_post(user_id, tweet_id="123")
-
-# Delete
client.posts.delete(tweet_id)
-
-# Search
-client.posts.search_recent(query="...", max_results=100, tweet_fields=["author_id", "created_at"])
-
-# User lookup
+client.posts.search_recent(query="...", max_results=100,
+ tweet_fields=[...], expansions=[...], media_fields=[...], user_fields=[...])
client.users.get_me(user_fields=["created_at", "description"])
client.users.get_by_usernames(usernames=["user1"], user_fields=["description"])
client.users.get_followers(user_id, max_results=100, user_fields=["created_at"])
@@ -1001,7 +994,7 @@ TWITTER_CLIENT_SECRET=your_client_secret
### Telegram Nodes (2 nodes)
Telegram bot integration using `python-telegram-bot` SDK with long-polling for incoming messages.
-- **telegramSend**: **Dual-purpose node** - Send text, photo, document, location, or contact messages via Telegram bot. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Recipient types: Self (bot owner), User/Chat ID, Group. Parameters: recipient_type, chat_id, message_type, text, media_url, caption, parse_mode, silent, reply_to_message_id. MarkdownV2/Markdown text auto-escaped via `_escape_text()`; falls back to plain text on `BadRequest`. "Self" restores `owner_chat_id` from credentials DB if not in memory.
+- **telegramSend**: **Dual-purpose node** - Send text, photo, document, location, or contact messages via Telegram bot. Works as workflow node OR AI Agent tool. Group: `['social', 'tool']`. Recipient types: Self (bot owner), User/Chat ID, Group. Parameters: recipient_type, chat_id, message_type, text, media_url, caption, parse_mode (Auto/HTML/Markdown/MarkdownV2/None), silent, reply_to_message_id. **Auto parse_mode** (default, recommended): converts GFM markdown to Telegram HTML via `markdown_formatter.to_telegram_html()`. MarkdownV2/Markdown text auto-escaped via `_escape_text()`; falls back to plain text on `BadRequest`. "Self" restores `owner_chat_id` from credentials DB if not in memory.
- **telegramReceive**: Event-driven trigger that waits for incoming Telegram messages. Group: `['social', 'trigger']`. Uses `senderFilter` dropdown: All Messages, From Self (Bot Owner) (zero-config), Private/Group/Supergroup/Channel Only, Specific Chat, Specific User, Keywords. Content type filter and ignore bots option. "From Self" uses lazy `_get_owner_chat_id()` lookup at match time. Auto-reconnects on server restart via `StatusBroadcaster._refresh_telegram_status()`.
**Key Files:**
@@ -1020,6 +1013,23 @@ Telegram bot integration using `python-telegram-bot` SDK with long-polling for i
TELEGRAM_OWNER_CHAT_ID=your_chat_id
```
+### Markdown Formatter Service
+Platform-specific markdown formatting using `markdown-it-py` (Python port of `markdown-it`, 18K+ GitHub stars). Converts GFM markdown (as produced by LLMs) to platform-native formats.
+
+**Key File:** `server/services/markdown_formatter.py`
+
+**Public Functions:**
+| Function | Target | Description |
+|----------|--------|-------------|
+| `to_telegram_html(text)` | Telegram | Renders GFM to HTML, converts unsupported tags (`<h1>`-`<h6>` -> `<b>`, `<ul>/<li>` -> bullets, strips `<p>`) |
+| `to_whatsapp(text)` | WhatsApp | Walks markdown-it token stream, maps to WhatsApp syntax (`*bold*`, `_italic_`, `~strike~`, `` ```code``` ``, `> quote`) |
+| `to_plain(text)` | Any | Renders to HTML, strips all tags |
+
+**Usage:**
+- Telegram Send node: Auto parse_mode (default) calls `to_telegram_html()` via `TelegramService._format_auto()`
+- WhatsApp Send node: `format_markdown` toggle (default: true) calls `to_whatsapp()` in handler
+- No new dependencies -- `markdown-it-py` v4.0.0 already installed as transitive dependency
+
### Google Workspace Nodes (7 nodes)
Consolidated Google Workspace integration with 6 unified operation-based nodes + 1 polling trigger. Each service node uses an `operation` parameter to select the action (e.g., gmail with operation: send/search/read). All services share a single OAuth connection with combined scopes.
@@ -1419,6 +1429,7 @@ See **[Scripts Reference](./docs-internal/SCRIPTS.md)** for full documentation.
✅ **AI Thinking/Reasoning**: Extended thinking for Claude, Gemini 2.5/3, OpenAI GPT-5/o-series, Groq Qwen3 with output available in Input Data & Variables for downstream nodes
✅ **Onboarding Service**: 5-step welcome wizard with Ant Design UI, database persistence, skip/resume/replay support
✅ **Proxy System**: Residential proxy provider management with template-based URL formatting, auto-selection by health score, transparent proxy injection on httpRequest/httpScraper nodes via `useProxy: true`
+✅ **Markdown Formatter**: GFM markdown to platform-native formatting (Telegram HTML, WhatsApp syntax, plain text) using markdown-it-py
## Key Features
diff --git a/client/src/nodeDefinitions/telegramNodes.ts b/client/src/nodeDefinitions/telegramNodes.ts
index 98a37b12..227759bb 100644
--- a/client/src/nodeDefinitions/telegramNodes.ts
+++ b/client/src/nodeDefinitions/telegramNodes.ts
@@ -201,13 +201,14 @@ export const telegramNodes: Record<string, INodeTypeDescription> = {
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: '',
- description: 'Text formatting mode',
+ default: 'Auto',
+ description: 'Auto converts LLM markdown to Telegram HTML. Use None for raw text.',
displayOptions: {
show: { message_type: ['text', 'photo', 'document'] }
}
diff --git a/client/src/nodeDefinitions/whatsappNodes.ts b/client/src/nodeDefinitions/whatsappNodes.ts
index 0de2a78e..89c8cca4 100644
--- a/client/src/nodeDefinitions/whatsappNodes.ts
+++ b/client/src/nodeDefinitions/whatsappNodes.ts
@@ -191,6 +191,18 @@ export const whatsappNodes: Record<string, INodeTypeDescription> = {
}
},
+ // ===== FORMAT OPTIONS =====
+ {
+ displayName: 'Format Markdown',
+ name: 'format_markdown',
+ type: 'boolean',
+ default: true,
+ description: 'Convert LLM markdown (bold, italic, code, lists) to WhatsApp-native formatting',
+ displayOptions: {
+ show: { message_type: ['text'] }
+ }
+ },
+
// ===== MEDIA MESSAGES (image, video, audio, document, sticker) =====
{
displayName: 'Media Source',
diff --git a/package-lock.json b/package-lock.json
index 83a188d5..41d154f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "machinaos",
- "version": "0.0.41",
+ "version": "0.0.42",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "machinaos",
- "version": "0.0.41",
+ "version": "0.0.42",
"hasInstallScript": true,
"license": "MIT",
"workspaces": [
diff --git a/package.json b/package.json
index 7ef09811..267cfbd0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "machinaos",
- "version": "0.0.42",
+ "version": "0.0.43",
"description": "Open source workflow automation platform with AI agents, React Flow, and n8n-inspired architecture",
"type": "module",
"keywords": [
diff --git a/server/config/model_registry.json b/server/config/model_registry.json
index c5180c93..34cb4785 100644
--- a/server/config/model_registry.json
+++ b/server/config/model_registry.json
@@ -1,5 +1,5 @@
{
- "_generated": "2026-03-04T13:29:06.065648+00:00",
+ "_generated": "2026-03-05T15:00:31.457281+00:00",
"_source": "openrouter",
"_model_count": 343,
"models": {
@@ -3226,10 +3226,10 @@
"name": "Z.ai: GLM 4.6",
"provider": "z-ai",
"local_id": "glm-4.6",
- "context_length": 202752,
- "max_output_tokens": 131072,
- "input_price_per_mtok": 0.35,
- "output_price_per_mtok": 1.71,
+ "context_length": 204800,
+ "max_output_tokens": 204800,
+ "input_price_per_mtok": 0.39,
+ "output_price_per_mtok": 1.9,
"supports_thinking": false,
"thinking_type": "none",
"temperature_range": [
@@ -4564,8 +4564,8 @@
"local_id": "gpt-oss-120b",
"context_length": 131072,
"max_output_tokens": 0,
- "input_price_per_mtok": 0.02,
- "output_price_per_mtok": 0.1,
+ "input_price_per_mtok": 0.039,
+ "output_price_per_mtok": 0.19,
"supports_thinking": true,
"thinking_type": "effort",
"temperature_range": [
@@ -4826,10 +4826,10 @@
"name": "Z.ai: GLM 4.5",
"provider": "z-ai",
"local_id": "glm-4.5",
- "context_length": 131000,
- "max_output_tokens": 131000,
- "input_price_per_mtok": 0.55,
- "output_price_per_mtok": 2.0,
+ "context_length": 131072,
+ "max_output_tokens": 98304,
+ "input_price_per_mtok": 0.6,
+ "output_price_per_mtok": 2.2,
"supports_thinking": false,
"thinking_type": "none",
"temperature_range": [
@@ -5160,7 +5160,6 @@
"tool_choice",
"tools",
"top_k",
- "top_logprobs",
"top_p"
]
},
@@ -5540,7 +5539,7 @@
"provider": "inception",
"local_id": "mercury",
"context_length": 128000,
- "max_output_tokens": 16384,
+ "max_output_tokens": 32000,
"input_price_per_mtok": 0.25,
"output_price_per_mtok": 0.75,
"supports_thinking": false,
@@ -5551,17 +5550,13 @@
],
"is_reasoning_model": false,
"supported_parameters": [
- "frequency_penalty",
"max_tokens",
- "presence_penalty",
"response_format",
"stop",
"structured_outputs",
"temperature",
"tool_choice",
- "tools",
- "top_k",
- "top_p"
+ "tools"
]
},
"mistralai/mistral-small-3.2-24b-instruct": {
@@ -6142,7 +6137,7 @@
"provider": "inception",
"local_id": "mercury-coder",
"context_length": 128000,
- "max_output_tokens": 16384,
+ "max_output_tokens": 32000,
"input_price_per_mtok": 0.25,
"output_price_per_mtok": 0.75,
"supports_thinking": false,
@@ -6153,17 +6148,13 @@
],
"is_reasoning_model": false,
"supported_parameters": [
- "frequency_penalty",
"max_tokens",
- "presence_penalty",
"response_format",
"stop",
"structured_outputs",
"temperature",
"tool_choice",
- "tools",
- "top_k",
- "top_p"
+ "tools"
]
},
"qwen/qwen3-4b:free": {
diff --git a/server/routers/websocket.py b/server/routers/websocket.py
index fb458c8e..ebb99e09 100644
--- a/server/routers/websocket.py
+++ b/server/routers/websocket.py
@@ -1103,22 +1103,26 @@ async def handle_twitter_oauth_status(data: Dict[str, Any], websocket: WebSocket
Check Twitter OAuth connection status.
Returns connection status and user info if connected.
+ Uses OAuth token system (matches REST endpoint in routers/twitter.py).
"""
from services.twitter_oauth import TwitterOAuth
auth_service = container.auth_service()
- # Check for stored access token
- access_token = await auth_service.get_api_key("twitter_access_token")
+ # Get tokens from OAuth system (NOT api_key system)
+ tokens = await auth_service.get_oauth_tokens("twitter", customer_id="owner")
- if not access_token:
+ if not tokens or not tokens.get("access_token"):
return {
"connected": False,
"username": None,
"user_id": None,
}
- # Get client credentials for API calls
+ access_token = tokens["access_token"]
+ refresh_token = tokens.get("refresh_token", "")
+
+ # Get client credentials for API calls (these are correctly stored as API keys)
client_id = await auth_service.get_api_key("twitter_client_id") or ""
client_secret = await auth_service.get_api_key("twitter_client_secret")
@@ -1134,28 +1138,21 @@ async def handle_twitter_oauth_status(data: Dict[str, Any], websocket: WebSocket
# Verify token by getting user info
user_info = await oauth.get_user_info(access_token)
- if not user_info.get("success"):
- # Try to refresh token
- refresh_token = await auth_service.get_api_key("twitter_refresh_token")
- if refresh_token:
- refresh_result = await oauth.refresh_access_token(refresh_token)
- if refresh_result.get("success"):
- # Store new tokens
- await auth_service.store_api_key(
- provider="twitter_access_token",
- api_key=refresh_result["access_token"],
- models=[],
- session_id="default"
- )
- if refresh_result.get("refresh_token"):
- await auth_service.store_api_key(
- provider="twitter_refresh_token",
- api_key=refresh_result["refresh_token"],
- models=[],
- session_id="default"
- )
- # Retry user info
- user_info = await oauth.get_user_info(refresh_result["access_token"])
+ if not user_info.get("success") and refresh_token:
+ refresh_result = await oauth.refresh_access_token(refresh_token)
+ if refresh_result.get("success"):
+ # Store refreshed tokens in OAuth system
+ await auth_service.store_oauth_tokens(
+ provider="twitter",
+ access_token=refresh_result["access_token"],
+ refresh_token=refresh_result.get("refresh_token") or refresh_token,
+ email=tokens.get("email", ""),
+ name=tokens.get("name", ""),
+ scopes=tokens.get("scopes", ""),
+ customer_id="owner",
+ )
+ # Retry user info
+ user_info = await oauth.get_user_info(refresh_result["access_token"])
if not user_info.get("success"):
return {
@@ -1179,14 +1176,18 @@ async def handle_twitter_oauth_status(data: Dict[str, Any], websocket: WebSocket
async def handle_twitter_logout(data: Dict[str, Any], websocket: WebSocket) -> Dict[str, Any]:
"""
Disconnect Twitter by revoking tokens and clearing stored credentials.
+ Uses OAuth token system (matches REST endpoint in routers/twitter.py).
"""
from services.twitter_oauth import TwitterOAuth
auth_service = container.auth_service()
- # Get stored tokens
- access_token = await auth_service.get_api_key("twitter_access_token")
- refresh_token = await auth_service.get_api_key("twitter_refresh_token")
+ # Get tokens from OAuth system
+ tokens = await auth_service.get_oauth_tokens("twitter", customer_id="owner")
+ access_token = tokens.get("access_token") if tokens else None
+ refresh_token = tokens.get("refresh_token") if tokens else None
+
+ # Get client credentials (correctly stored as API keys)
client_id = await auth_service.get_api_key("twitter_client_id") or ""
client_secret = await auth_service.get_api_key("twitter_client_secret")
@@ -1206,10 +1207,15 @@ async def handle_twitter_logout(data: Dict[str, Any], websocket: WebSocket) -> D
if refresh_token:
await oauth.revoke_token(refresh_token, "refresh_token")
- # Clear stored credentials
- await auth_service.remove_api_key("twitter_access_token")
- await auth_service.remove_api_key("twitter_refresh_token")
- await auth_service.remove_api_key("twitter_user_info")
+ # Clear from OAuth system
+ await auth_service.remove_oauth_tokens("twitter", customer_id="owner")
+
+ # Clean up any stale API key entries (from old broken code)
+ for key in ["twitter_access_token", "twitter_refresh_token", "twitter_user_info"]:
+ try:
+ await auth_service.remove_api_key(key)
+ except Exception:
+ pass
return {"success": True, "message": "Twitter disconnected"}
diff --git a/server/services/handlers/twitter.py b/server/services/handlers/twitter.py
index 2fe57709..962bdd0d 100644
--- a/server/services/handlers/twitter.py
+++ b/server/services/handlers/twitter.py
@@ -1,7 +1,8 @@
"""Twitter/X node handlers using official XDK SDK."""
+import asyncio
import time
-from typing import Dict, Any
+from typing import Dict, Any, List
from xdk import Client
from core.logging import get_logger
@@ -51,25 +52,173 @@ async def _track_twitter_usage(
return cost_data
+def _is_auth_error(e: Exception) -> bool:
+ """Check if exception indicates an expired/invalid token."""
+ s = str(e)
+ return '401' in s or '403' in s or 'Unauthorized' in s or 'Forbidden' in s
+
+
async def _get_twitter_client() -> Client:
- """Get authenticated Twitter client from stored OAuth 2.0 credentials."""
- # Import inside function to avoid circular import
+ """Get authenticated Twitter client from stored OAuth 2.0 credentials.
+
+ No validation call -- saves rate limits. If the token is expired,
+ the actual API call will fail and the handler retries via _refresh_and_get_client().
+ """
from core.container import container
auth_service = container.auth_service()
- access_token = await auth_service.get_api_key("twitter_access_token")
- if not access_token:
+
+ tokens = await auth_service.get_oauth_tokens("twitter", customer_id="owner")
+ if not tokens or not tokens.get("access_token"):
raise ValueError("Twitter not connected. Please authenticate via Credentials.")
- # Use access_token for OAuth 2.0 user token (not bearer_token which is app-only)
- return Client(access_token=access_token)
+
+ return Client(access_token=tokens["access_token"])
+
+
+async def _refresh_and_get_client() -> Client:
+ """Refresh expired token and return new client."""
+ from core.container import container
+ auth_service = container.auth_service()
+
+ tokens = await auth_service.get_oauth_tokens("twitter", customer_id="owner")
+ refresh_token = tokens.get("refresh_token", "") if tokens else ""
+
+ if not refresh_token:
+ raise ValueError("Twitter token expired. Please re-authenticate via Credentials.")
+
+ from services.twitter_oauth import TwitterOAuth
+
+ client_id = await auth_service.get_api_key("twitter_client_id") or ""
+ client_secret = await auth_service.get_api_key("twitter_client_secret")
+
+ oauth = TwitterOAuth(client_id=client_id, client_secret=client_secret, redirect_uri="")
+ result = await oauth.refresh_access_token(refresh_token)
+
+ if not result.get("success"):
+ raise ValueError("Twitter token expired and refresh failed. Please re-authenticate.")
+
+ new_access = result["access_token"]
+ new_refresh = result.get("refresh_token", refresh_token)
+
+ await auth_service.store_oauth_tokens(
+ provider="twitter",
+ access_token=new_access,
+ refresh_token=new_refresh,
+ email=tokens.get("email", ""),
+ name=tokens.get("name", ""),
+ scopes=tokens.get("scopes", ""),
+ customer_id="owner",
+ )
+
+ logger.info("Twitter token refreshed successfully")
+ return Client(access_token=new_access)
async def _get_my_user_id(client: Client) -> str:
"""Get the authenticated user's ID."""
- response = client.users.get_me()
+ response = await asyncio.to_thread(client.users.get_me)
# response.data is a dict with 'id', 'username', 'name' keys
return response.data["id"]
+# ---------------------------------------------------------------------------
+# Sync helper functions for asyncio.to_thread (XDK uses requests internally)
+# ---------------------------------------------------------------------------
+
+def _sync_create_post(client: Client, payload: dict):
+ return client.posts.create(body=payload)
+
+
+def _sync_repost(client: Client, user_id: str, payload: dict):
+ return client.users.repost_post(user_id, body=payload)
+
+
+def _sync_like(client: Client, user_id: str, payload: dict):
+ return client.users.like_post(user_id, body=payload)
+
+
+def _sync_unlike(client: Client, user_id: str, tweet_id: str):
+ return client.users.unlike_post(user_id, tweet_id=tweet_id)
+
+
+def _sync_delete_post(client: Client, tweet_id: str):
+ return client.posts.delete(tweet_id)
+
+
+def _sync_search_recent(client: Client, query: str, max_results: int) -> dict:
+ """Run search_recent synchronously, return first page data + includes.
+
+ Returns dict with 'tweets' (raw tweet data) and 'includes' (expanded
+ media/user/referenced_tweets objects) so callers can enrich output.
+ """
+ for page in client.posts.search_recent(
+ query=query,
+ max_results=max_results,
+ tweet_fields=[
+ "author_id", "created_at", "entities", "public_metrics",
+ "possibly_sensitive", "lang", "source",
+ "conversation_id", "in_reply_to_user_id", "referenced_tweets",
+ "note_tweet",
+ ],
+ expansions=[
+ "author_id",
+ "attachments.media_keys",
+ "referenced_tweets.id",
+ "referenced_tweets.id.author_id",
+ ],
+ media_fields=["url", "preview_image_url", "type", "alt_text", "variants"],
+ user_fields=["username", "name", "profile_image_url"],
+ ):
+ page_data = getattr(page, 'data', []) or []
+ includes_raw = getattr(page, 'includes', None)
+ includes_dict = {}
+ if includes_raw:
+ if hasattr(includes_raw, 'model_dump'):
+ try:
+ includes_dict = includes_raw.model_dump()
+ except Exception:
+ includes_dict = {}
+ elif isinstance(includes_raw, dict):
+ includes_dict = includes_raw
+ return {"tweets": page_data, "includes": includes_dict}
+ return {"tweets": [], "includes": {}}
+
+
+def _sync_get_me(client: Client, user_fields: list = None):
+ return client.users.get_me(user_fields=user_fields)
+
+
+def _sync_get_by_usernames(client: Client, usernames: list, user_fields: list = None):
+ return client.users.get_by_usernames(usernames=usernames, user_fields=user_fields)
+
+
+def _sync_get_by_ids(client: Client, ids: list, user_fields: list = None):
+ return client.users.get_by_ids(ids=ids, user_fields=user_fields)
+
+
+def _sync_get_followers(client: Client, user_id: str, max_results: int) -> list:
+ """Get first page of followers synchronously."""
+ users = []
+ for page in client.users.get_followers(
+ user_id, max_results=max_results, user_fields=["created_at"]
+ ):
+ page_data = getattr(page, 'data', []) or []
+ users.extend(page_data)
+ break
+ return users
+
+
+def _sync_get_following(client: Client, user_id: str, max_results: int) -> list:
+ """Get first page of following synchronously."""
+ users = []
+ for page in client.users.get_following(
+ user_id, max_results=max_results, user_fields=["created_at"]
+ ):
+ page_data = getattr(page, 'data', []) or []
+ users.extend(page_data)
+ break
+ return users
+
+
async def handle_twitter_send(
node_id: str,
node_type: str,
@@ -87,86 +236,89 @@ async def handle_twitter_send(
workflow_id = context.get('workflow_id')
session_id = context.get('session_id', 'default')
- match action:
- case 'tweet':
- text = parameters.get('text', '')
- if not text:
- raise ValueError("Tweet text is required")
- # XDK API: client.posts.create(body={"text": "..."})
- payload = {"text": text[:280]}
- result = client.posts.create(body=payload)
- # Track: content_create $0.010
- await _track_twitter_usage(node_id, 'tweet', 1, workflow_id, session_id)
- return _success(_format_response(result), "tweet_sent", start_time)
-
- case 'reply':
- text = parameters.get('text', '')
- reply_to = parameters.get('reply_to_id')
- if not text or not reply_to:
- raise ValueError("Text and reply_to_id are required")
- # XDK API: reply uses nested reply object
- payload = {
- "text": text[:280],
- "reply": {"in_reply_to_tweet_id": reply_to}
- }
- result = client.posts.create(body=payload)
- # Track: content_create $0.010
- await _track_twitter_usage(node_id, 'reply', 1, workflow_id, session_id)
- return _success(_format_response(result), "reply_sent", start_time)
-
- case 'retweet':
- tweet_id = parameters.get('tweet_id')
- if not tweet_id:
- raise ValueError("tweet_id is required")
- user_id = await _get_my_user_id(client)
- # XDK API: client.users.repost_post(user_id, body={"tweet_id": "..."})
- payload = {"tweet_id": tweet_id}
- result = client.users.repost_post(user_id, body=payload)
- # Track: user_interaction_create $0.015
- await _track_twitter_usage(node_id, 'retweet', 1, workflow_id, session_id)
- return _success(_format_response(result), "retweeted", start_time)
-
- case 'like':
- tweet_id = parameters.get('tweet_id')
- if not tweet_id:
- raise ValueError("tweet_id is required")
- user_id = await _get_my_user_id(client)
- # XDK API: client.users.like_post(user_id, body={"tweet_id": "..."})
- payload = {"tweet_id": tweet_id}
- result = client.users.like_post(user_id, body=payload)
- # Track: user_interaction_create $0.015
- await _track_twitter_usage(node_id, 'like', 1, workflow_id, session_id)
- return _success(_format_response(result), "liked", start_time)
-
- case 'unlike':
- tweet_id = parameters.get('tweet_id')
- if not tweet_id:
- raise ValueError("tweet_id is required")
- user_id = await _get_my_user_id(client)
- # XDK API: client.users.unlike_post(user_id, tweet_id=post_id)
- result = client.users.unlike_post(user_id, tweet_id=tweet_id)
- # Track: interaction_delete $0.010
- await _track_twitter_usage(node_id, 'unlike', 1, workflow_id, session_id)
- return _success(_format_response(result), "unliked", start_time)
-
- case 'delete':
- tweet_id = parameters.get('tweet_id')
- if not tweet_id:
- raise ValueError("tweet_id is required")
- # XDK API: client.posts.delete(post_id)
- result = client.posts.delete(tweet_id)
- # Track: content_manage $0.005
- await _track_twitter_usage(node_id, 'delete', 1, workflow_id, session_id)
- return _success(_format_response(result), "deleted", start_time)
-
- case _:
- raise ValueError(f"Unknown action: {action}")
+ try:
+ return await _do_twitter_send(client, action, parameters, node_id, workflow_id, session_id, start_time)
+ except Exception as e:
+ if _is_auth_error(e):
+ logger.info(f"Twitter auth error, refreshing token: {e}")
+ client = await _refresh_and_get_client()
+ return await _do_twitter_send(client, action, parameters, node_id, workflow_id, session_id, start_time)
+ raise
except Exception as e:
logger.error(f"Twitter send error: {e}")
return {"success": False, "error": str(e), "execution_time": time.time() - start_time}
+async def _do_twitter_send(
+ client: Client, action: str, parameters: Dict[str, Any],
+ node_id: str, workflow_id: str, session_id: str, start_time: float
+) -> Dict[str, Any]:
+ """Execute a Twitter send action with the given client."""
+ match action:
+ case 'tweet':
+ text = parameters.get('text', '')
+ if not text:
+ raise ValueError("Tweet text is required")
+ payload = {"text": text[:280]}
+ result = await asyncio.to_thread(_sync_create_post, client, payload)
+ await _track_twitter_usage(node_id, 'tweet', 1, workflow_id, session_id)
+ return _success(_format_response(result), "tweet_sent", start_time)
+
+ case 'reply':
+ text = parameters.get('text', '')
+ reply_to = parameters.get('reply_to_id')
+ if not text or not reply_to:
+ raise ValueError("Text and reply_to_id are required")
+ payload = {
+ "text": text[:280],
+ "reply": {"in_reply_to_tweet_id": reply_to}
+ }
+ result = await asyncio.to_thread(_sync_create_post, client, payload)
+ await _track_twitter_usage(node_id, 'reply', 1, workflow_id, session_id)
+ return _success(_format_response(result), "reply_sent", start_time)
+
+ case 'retweet':
+ tweet_id = parameters.get('tweet_id')
+ if not tweet_id:
+ raise ValueError("tweet_id is required")
+ user_id = await _get_my_user_id(client)
+ payload = {"tweet_id": tweet_id}
+ result = await asyncio.to_thread(_sync_repost, client, user_id, payload)
+ await _track_twitter_usage(node_id, 'retweet', 1, workflow_id, session_id)
+ return _success(_format_response(result), "retweeted", start_time)
+
+ case 'like':
+ tweet_id = parameters.get('tweet_id')
+ if not tweet_id:
+ raise ValueError("tweet_id is required")
+ user_id = await _get_my_user_id(client)
+ payload = {"tweet_id": tweet_id}
+ result = await asyncio.to_thread(_sync_like, client, user_id, payload)
+ await _track_twitter_usage(node_id, 'like', 1, workflow_id, session_id)
+ return _success(_format_response(result), "liked", start_time)
+
+ case 'unlike':
+ tweet_id = parameters.get('tweet_id')
+ if not tweet_id:
+ raise ValueError("tweet_id is required")
+ user_id = await _get_my_user_id(client)
+ result = await asyncio.to_thread(_sync_unlike, client, user_id, tweet_id)
+ await _track_twitter_usage(node_id, 'unlike', 1, workflow_id, session_id)
+ return _success(_format_response(result), "unliked", start_time)
+
+ case 'delete':
+ tweet_id = parameters.get('tweet_id')
+ if not tweet_id:
+ raise ValueError("tweet_id is required")
+ result = await asyncio.to_thread(_sync_delete_post, client, tweet_id)
+ await _track_twitter_usage(node_id, 'delete', 1, workflow_id, session_id)
+ return _success(_format_response(result), "deleted", start_time)
+
+ case _:
+ raise ValueError(f"Unknown action: {action}")
+
+
async def handle_twitter_search(
node_id: str,
node_type: str,
@@ -179,7 +331,8 @@ async def handle_twitter_search(
try:
client = await _get_twitter_client()
query = parameters.get('query', '')
- max_results = min(parameters.get('max_results', 10), 100)
+ # X API v2 requires max_results between 10 and 100 for search/recent
+ max_results = max(10, min(parameters.get('max_results', 10), 100))
if not query:
raise ValueError("Search query is required")
@@ -188,16 +341,45 @@ async def handle_twitter_search(
workflow_id = context.get('workflow_id')
session_id = context.get('session_id', 'default')
- tweets = []
- # XDK API: client.posts.search_recent(query=..., max_results=..., tweet_fields=[...])
- for page in client.posts.search_recent(
- query=query,
- max_results=max_results,
- tweet_fields=["author_id", "created_at"]
- ):
- page_data = getattr(page, 'data', []) or []
- tweets.extend([_format_tweet(t) for t in page_data])
- break # Only first page
+ try:
+ search_result = await asyncio.to_thread(_sync_search_recent, client, query, max_results)
+ except Exception as e:
+ if _is_auth_error(e):
+ logger.info(f"Twitter auth error on search, refreshing token: {e}")
+ client = await _refresh_and_get_client()
+ search_result = await asyncio.to_thread(_sync_search_recent, client, query, max_results)
+ else:
+ raise
+
+ raw_tweets = search_result["tweets"]
+ includes = search_result["includes"]
+
+ # Build lookup dicts from includes for enriching tweet data
+ users_by_id = {}
+ for u in (includes.get("users") or []):
+ uid = u.get("id") if isinstance(u, dict) else getattr(u, "id", None)
+ if uid:
+ users_by_id[str(uid)] = u if isinstance(u, dict) else {
+ k: v for k, v in u.__dict__.items() if not k.startswith('_')
+ }
+
+ media_by_key = {}
+ for m in (includes.get("media") or []):
+ mk = m.get("media_key") if isinstance(m, dict) else getattr(m, "media_key", None)
+ if mk:
+ media_by_key[mk] = m if isinstance(m, dict) else {
+ k: v for k, v in m.__dict__.items() if not k.startswith('_')
+ }
+
+ tweets_by_id = {}
+ for t in (includes.get("tweets") or []):
+ tid = t.get("id") if isinstance(t, dict) else getattr(t, "id", None)
+ if tid:
+ tweets_by_id[str(tid)] = t if isinstance(t, dict) else {
+ k: v for k, v in t.__dict__.items() if not k.startswith('_')
+ }
+
+ tweets = [_format_tweet(t, users_by_id, media_by_key, tweets_by_id) for t in raw_tweets]
# Track: posts_read $0.005 per tweet fetched
if tweets:
@@ -231,94 +413,85 @@ async def handle_twitter_user(
workflow_id = context.get('workflow_id')
session_id = context.get('session_id', 'default')
- match operation:
- case 'me':
- # XDK API: client.users.get_me(user_fields=[...])
- result = client.users.get_me(user_fields=["created_at", "description"])
- # Track: user_read $0.010
- await _track_twitter_usage(node_id, 'me', 1, workflow_id, session_id)
- return _success(_format_user_data(result.data), "user", start_time)
-
- case 'by_username':
- username = parameters.get('username')
- if not username:
- raise ValueError("Username is required")
- # XDK API: client.users.get_by_usernames(usernames=[...], user_fields=[...])
- result = client.users.get_by_usernames(
- usernames=[username],
- user_fields=["description", "created_at"]
- )
- users = getattr(result, 'data', []) or []
- if not users:
- raise ValueError(f"User @{username} not found")
- # Track: user_read $0.010
- await _track_twitter_usage(node_id, 'by_username', 1, workflow_id, session_id)
- return _success(_format_user_data(users[0]), "user", start_time)
-
- case 'by_id':
- user_id = parameters.get('user_id')
- if not user_id:
- raise ValueError("User ID is required")
- # XDK API: client.users.get_by_ids works similar
- result = client.users.get_by_ids(
- ids=[user_id],
- user_fields=["description", "created_at"]
- )
- users = getattr(result, 'data', []) or []
- if not users:
- raise ValueError(f"User ID {user_id} not found")
- # Track: user_read $0.010
- await _track_twitter_usage(node_id, 'by_id', 1, workflow_id, session_id)
- return _success(_format_user_data(users[0]), "user", start_time)
-
- case 'followers':
- user_id = parameters.get('user_id')
- if not user_id:
- user_id = await _get_my_user_id(client)
- max_results = min(parameters.get('max_results', 100), 1000)
- users = []
- # XDK API: client.users.get_followers(user_id, max_results=..., user_fields=[...])
- for page in client.users.get_followers(
- user_id,
- max_results=max_results,
- user_fields=["created_at"]
- ):
- page_data = getattr(page, 'data', []) or []
- users.extend([_format_user_data(u) for u in page_data])
- break # Only first page
- # Track: followers_read $0.010 per user
- if users:
- await _track_twitter_usage(node_id, 'followers', len(users), workflow_id, session_id)
- return _success({"users": users, "count": len(users)}, "followers", start_time)
-
- case 'following':
- user_id = parameters.get('user_id')
- if not user_id:
- user_id = await _get_my_user_id(client)
- max_results = min(parameters.get('max_results', 100), 1000)
- users = []
- # XDK API: client.users.get_following(user_id, max_results=..., user_fields=[...])
- for page in client.users.get_following(
- user_id,
- max_results=max_results,
- user_fields=["created_at"]
- ):
- page_data = getattr(page, 'data', []) or []
- users.extend([_format_user_data(u) for u in page_data])
- break # Only first page
- # Track: following_read $0.010 per user
- if users:
- await _track_twitter_usage(node_id, 'following', len(users), workflow_id, session_id)
- return _success({"users": users, "count": len(users)}, "following", start_time)
-
- case _:
- raise ValueError(f"Unknown operation: {operation}")
+ try:
+ return await _do_twitter_user(client, operation, parameters, node_id, workflow_id, session_id, start_time)
+ except Exception as e:
+ if _is_auth_error(e):
+ logger.info(f"Twitter auth error on user op, refreshing token: {e}")
+ client = await _refresh_and_get_client()
+ return await _do_twitter_user(client, operation, parameters, node_id, workflow_id, session_id, start_time)
+ raise
except Exception as e:
logger.error(f"Twitter user error: {e}")
return {"success": False, "error": str(e), "execution_time": time.time() - start_time}
+async def _do_twitter_user(
+ client: Client, operation: str, parameters: Dict[str, Any],
+ node_id: str, workflow_id: str, session_id: str, start_time: float
+) -> Dict[str, Any]:
+ """Execute a Twitter user operation with the given client."""
+ match operation:
+ case 'me':
+ result = await asyncio.to_thread(_sync_get_me, client, ["created_at", "description"])
+ await _track_twitter_usage(node_id, 'me', 1, workflow_id, session_id)
+ return _success(_format_user_data(result.data), "user", start_time)
+
+ case 'by_username':
+ username = parameters.get('username')
+ if not username:
+ raise ValueError("Username is required")
+ result = await asyncio.to_thread(
+ _sync_get_by_usernames, client, [username], ["description", "created_at"]
+ )
+ users = getattr(result, 'data', []) or []
+ if not users:
+ raise ValueError(f"User @{username} not found")
+ await _track_twitter_usage(node_id, 'by_username', 1, workflow_id, session_id)
+ return _success(_format_user_data(users[0]), "user", start_time)
+
+ case 'by_id':
+ user_id = parameters.get('user_id')
+ if not user_id:
+ raise ValueError("User ID is required")
+ result = await asyncio.to_thread(
+ _sync_get_by_ids, client, [user_id], ["description", "created_at"]
+ )
+ users = getattr(result, 'data', []) or []
+ if not users:
+ raise ValueError(f"User ID {user_id} not found")
+ await _track_twitter_usage(node_id, 'by_id', 1, workflow_id, session_id)
+ return _success(_format_user_data(users[0]), "user", start_time)
+
+ case 'followers':
+ user_id = parameters.get('user_id')
+ if not user_id:
+ user_id = await _get_my_user_id(client)
+ # X API requires max_results >= 1 for followers
+ max_results = max(1, min(parameters.get('max_results', 100), 1000))
+ raw_users = await asyncio.to_thread(_sync_get_followers, client, user_id, max_results)
+ users = [_format_user_data(u) for u in raw_users]
+ if users:
+ await _track_twitter_usage(node_id, 'followers', len(users), workflow_id, session_id)
+ return _success({"users": users, "count": len(users)}, "followers", start_time)
+
+ case 'following':
+ user_id = parameters.get('user_id')
+ if not user_id:
+ user_id = await _get_my_user_id(client)
+ # X API requires max_results >= 1 for following
+ max_results = max(1, min(parameters.get('max_results', 100), 1000))
+ raw_users = await asyncio.to_thread(_sync_get_following, client, user_id, max_results)
+ users = [_format_user_data(u) for u in raw_users]
+ if users:
+ await _track_twitter_usage(node_id, 'following', len(users), workflow_id, session_id)
+ return _success({"users": users, "count": len(users)}, "following", start_time)
+
+ case _:
+ raise ValueError(f"Unknown operation: {operation}")
+
+
def _success(data: Any, action: str, start_time: float) -> Dict[str, Any]:
"""Build success response."""
return {
@@ -339,22 +512,122 @@ def _format_response(response) -> Dict[str, Any]:
return {"response": str(response)}
-def _format_tweet(tweet) -> Dict[str, Any]:
- """Format tweet object/dict to dict."""
- if isinstance(tweet, dict):
- return {
- "id": tweet.get("id"),
- "text": tweet.get("text"),
- "author_id": tweet.get("author_id"),
- "created_at": str(tweet.get("created_at", "")),
- }
- return {
- "id": getattr(tweet, 'id', None),
- "text": getattr(tweet, 'text', None),
- "author_id": getattr(tweet, 'author_id', None),
- "created_at": str(getattr(tweet, 'created_at', '')),
+def _format_tweet(tweet, users_by_id: Dict = None, media_by_key: Dict = None,
+ tweets_by_id: Dict = None) -> Dict[str, Any]:
+ """Format tweet object/dict to dict with enriched data from includes.
+
+ Args:
+ tweet: Raw tweet data (dict or object)
+ users_by_id: {user_id: user_dict} from includes.users
+ media_by_key: {media_key: media_dict} from includes.media
+ tweets_by_id: {tweet_id: tweet_dict} from includes.tweets (referenced)
+ """
+ users_by_id = users_by_id or {}
+ media_by_key = media_by_key or {}
+ tweets_by_id = tweets_by_id or {}
+
+ def _get(obj, key, default=None):
+ return obj.get(key, default) if isinstance(obj, dict) else getattr(obj, key, default)
+
+ tweet_id = _get(tweet, 'id')
+ author_id = _get(tweet, 'author_id')
+ text = _get(tweet, 'text', '')
+
+ # Extract expanded URLs from entities to replace t.co links
+ entities = _get(tweet, 'entities') or {}
+ if isinstance(entities, dict):
+ urls_list = entities.get('urls', [])
+ elif hasattr(entities, 'urls'):
+ urls_list = entities.urls or []
+ else:
+ urls_list = []
+
+ expanded_urls = []
+ display_text = text
+ for u in urls_list:
+ if isinstance(u, dict):
+ short = u.get('url', '')
+ expanded = u.get('expanded_url', '')
+ display = u.get('display_url', '')
+ else:
+ short = getattr(u, 'url', '')
+ expanded = getattr(u, 'expanded_url', '')
+ display = getattr(u, 'display_url', '')
+ if short and expanded:
+ expanded_urls.append({"url": short, "expanded_url": expanded, "display_url": display})
+ display_text = display_text.replace(short, expanded)
+
+ # Note tweet (long-form tweets > 280 chars)
+ note_tweet = _get(tweet, 'note_tweet')
+ if note_tweet:
+ note_text = note_tweet.get('text', '') if isinstance(note_tweet, dict) else getattr(note_tweet, 'text', '')
+ if note_text:
+ text = note_text
+ display_text = note_text
+
+ # Author info from includes
+ author_info = users_by_id.get(str(author_id)) if author_id else None
+
+ # Media from includes via attachments.media_keys
+ attachments = _get(tweet, 'attachments') or {}
+ if isinstance(attachments, dict):
+ media_keys = attachments.get('media_keys', [])
+ elif hasattr(attachments, 'media_keys'):
+ media_keys = attachments.media_keys or []
+ else:
+ media_keys = []
+ media_list = [media_by_key[k] for k in media_keys if k in media_by_key]
+
+ # Referenced tweets (quoted, replied_to)
+ ref_tweets_raw = _get(tweet, 'referenced_tweets') or []
+ referenced = []
+ for ref in ref_tweets_raw:
+ if isinstance(ref, dict):
+ ref_type = ref.get('type', '')
+ ref_id = ref.get('id', '')
+ else:
+ ref_type = getattr(ref, 'type', '')
+ ref_id = getattr(ref, 'id', '')
+ ref_data = tweets_by_id.get(str(ref_id))
+ referenced.append({
+ "type": ref_type,
+ "id": ref_id,
+ "text": ref_data.get("text", "") if ref_data else None,
+ "author_id": ref_data.get("author_id") if ref_data else None,
+ })
+
+ # Public metrics
+ metrics = _get(tweet, 'public_metrics') or {}
+ if not isinstance(metrics, dict) and hasattr(metrics, 'model_dump'):
+ metrics = metrics.model_dump()
+ elif not isinstance(metrics, dict):
+ metrics = {}
+
+ result = {
+ "id": tweet_id,
+ "text": text,
+ "display_text": display_text,
+ "author_id": author_id,
+ "created_at": str(_get(tweet, 'created_at', '')),
+ "lang": _get(tweet, 'lang'),
+ "source": _get(tweet, 'source'),
+ "conversation_id": _get(tweet, 'conversation_id'),
+ "in_reply_to_user_id": _get(tweet, 'in_reply_to_user_id'),
+ "possibly_sensitive": _get(tweet, 'possibly_sensitive', False),
+ "public_metrics": metrics,
}
+ if author_info:
+ result["author"] = author_info
+ if expanded_urls:
+ result["urls"] = expanded_urls
+ if media_list:
+ result["media"] = media_list
+ if referenced:
+ result["referenced_tweets"] = referenced
+
+ return result
+
def _format_user_data(user) -> Dict[str, Any]:
"""Format user object/dict to dict."""
diff --git a/server/services/handlers/whatsapp.py b/server/services/handlers/whatsapp.py
index 16b79e60..00413081 100644
--- a/server/services/handlers/whatsapp.py
+++ b/server/services/handlers/whatsapp.py
@@ -172,6 +172,11 @@ async def handle_whatsapp_send(
if message_type == 'text' and not parameters.get('message'):
raise ValueError("Message content is required for text messages")
+ # Convert GFM markdown to WhatsApp-native formatting if enabled
+ if message_type == 'text' and parameters.get('format_markdown', False):
+ from services.markdown_formatter import to_whatsapp
+ parameters['message'] = to_whatsapp(parameters['message'])
+
# Call WhatsApp Go RPC service via handler - pass full params
data = await whatsapp_send_handler(parameters)
diff --git a/server/services/markdown_formatter.py b/server/services/markdown_formatter.py
new file mode 100644
index 00000000..17bd6b17
--- /dev/null
+++ b/server/services/markdown_formatter.py
@@ -0,0 +1,170 @@
+"""Platform-specific markdown formatting using markdown-it-py.
+
+Converts GFM-style markdown (as produced by LLMs) to platform-native formats:
+- Telegram HTML: render to HTML, convert unsupported tags
+- WhatsApp: walk token stream, map to WhatsApp-native syntax
+- Plain text: strip all formatting
+"""
+
+import re
+from markdown_it import MarkdownIt
+
+
+_md = MarkdownIt("commonmark", {"breaks": True}).enable("strikethrough")
+
+# Tags Telegram supports natively in HTML parse mode
+_TELEGRAM_SUPPORTED = {"b", "strong", "i", "em", "s", "strike", "del", "code", "pre", "a", "blockquote", "u", "tg-spoiler", "tg-emoji"}
+
+
+def to_telegram_html(text: str) -> str:
+ """Convert GFM markdown to Telegram-compatible HTML.
+
+ Telegram HTML supports: <b>, <i>, <s>, <code>, <pre>, <a>, <blockquote>, <u>.
+ Unsupported tags are converted: <h1>-<h6> -> <b>, <ul>/<ol>/<li> -> bullet text, <p> -> stripped.
+ """
+ if not text or not text.strip():
+ return text
+
+ html = _md.render(text).strip()
+
+ # Convert headings to bold
+ html = re.sub(r"<h[1-6][^>]*>(.*?)</h[1-6]>", r"<b>\1</b>", html, flags=re.DOTALL)
+
+ # Convert list items to bullet lines
+ html = re.sub(r"<li>(.*?)</li>", r" - \1", html, flags=re.DOTALL)
+ html = re.sub(r"</?[ou]l>", "", html)
+
+ # Strip <p> tags, replace closing </p> with double newline
+ html = re.sub(r"<p>", "", html)
+ html = re.sub(r"</p>", "\n", html)
+
+ # Strip <hr> tags
+ html = re.sub(r"<hr\s*/?>", "", html)
+
+ # Clean up blockquote inner whitespace
+ html = re.sub(r"<blockquote>\s*\n*", "<blockquote>", html)
+ html = re.sub(r"\s*\n*</blockquote>", "</blockquote>", html)
+
+ # Map <strong> -> <b>, <em> -> <i>, <del>/<strike> -> <s> for consistency
+ html = html.replace("<strong>", "<b>").replace("</strong>", "</b>")
+ html = html.replace("<em>", "<i>").replace("</em>", "</i>")
+ html = html.replace("<del>", "<s>").replace("</del>", "</s>")
+ html = html.replace("<strike>", "<s>").replace("</strike>", "</s>")
+
+ # Collapse multiple newlines
+ html = re.sub(r"\n{3,}", "\n\n", html)
+ return html.strip()
+
+
+def to_whatsapp(text: str) -> str:
+ """Convert GFM markdown to WhatsApp-native formatting.
+
+ WhatsApp supports: *bold*, _italic_, ~strikethrough~, ```code```, > quote (single line).
+ """
+ if not text or not text.strip():
+ return text
+
+ tokens = _md.parse(text)
+ result = []
+ _walk_tokens(tokens, result)
+ output = "".join(result)
+ # Collapse excessive newlines
+ output = re.sub(r"\n{3,}", "\n\n", output)
+ return output.strip()
+
+
+def _walk_tokens(tokens: list, result: list, depth: int = 0) -> None:
+ """Walk markdown-it token stream and emit WhatsApp-formatted text."""
+ in_list = False
+ in_blockquote = False
+ i = 0
+ while i < len(tokens):
+ token = tokens[i]
+ ttype = token.type
+
+ if ttype == "inline" and token.children:
+ _walk_tokens(token.children, result, depth)
+ elif ttype == "text":
+ result.append(token.content)
+ elif ttype == "code_inline":
+ result.append(f"`{token.content}`")
+ elif ttype == "softbreak":
+ result.append("\n")
+ elif ttype == "hardbreak":
+ result.append("\n")
+ elif ttype == "fence":
+ result.append(f"```{token.content}```")
+ elif ttype == "code_block":
+ result.append(f"```{token.content}```")
+ elif ttype in ("strong_open", "bold_open"):
+ result.append("*")
+ elif ttype in ("strong_close", "bold_close"):
+ result.append("*")
+ elif ttype in ("em_open", "emphasis_open"):
+ result.append("_")
+ elif ttype in ("em_close", "emphasis_close"):
+ result.append("_")
+ elif ttype in ("s_open",):
+ result.append("~")
+ elif ttype in ("s_close",):
+ result.append("~")
+ elif ttype == "paragraph_open":
+ # Suppress paragraph newline inside list items and blockquotes
+ if not in_list and not in_blockquote and i > 0:
+ result.append("\n")
+ elif ttype == "paragraph_close":
+ if not in_list and not in_blockquote:
+ result.append("\n")
+ elif ttype == "heading_open":
+ if i > 0:
+ result.append("\n")
+ result.append("*")
+ elif ttype == "heading_close":
+ result.append("*\n")
+ elif ttype in ("bullet_list_open", "ordered_list_open"):
+ in_list = True
+ elif ttype in ("bullet_list_close", "ordered_list_close"):
+ in_list = False
+ elif ttype == "list_item_open":
+ result.append(" - " if depth == 0 else " - ")
+ elif ttype == "list_item_close":
+ if not result or not result[-1].endswith("\n"):
+ result.append("\n")
+ elif ttype == "blockquote_open":
+ in_blockquote = True
+ result.append("> ")
+ elif ttype == "blockquote_close":
+ in_blockquote = False
+ result.append("\n")
+ elif ttype == "hr":
+ result.append("\n---\n")
+ elif ttype == "link_open":
+ pass # WhatsApp auto-links URLs
+ elif ttype == "link_close":
+ href = None
+ for j in range(i - 1, -1, -1):
+ if tokens[j].type == "link_open":
+ href = tokens[j].attrGet("href")
+ break
+ if href:
+ result.append(f" ({href})")
+ elif ttype == "image":
+ alt = token.content or token.attrGet("alt") or "image"
+ src = token.attrGet("src") or ""
+ result.append(f"[{alt}]({src})")
+ elif ttype == "html_block" or ttype == "html_inline":
+ result.append(token.content)
+
+ i += 1
+
+
+def to_plain(text: str) -> str:
+ """Strip all markdown formatting, return plain text."""
+ if not text or not text.strip():
+ return text
+
+ html = _md.render(text)
+ # Strip all HTML tags
+ plain = re.sub(r"<[^>]+>", "", html)
+ plain = re.sub(r"\n{3,}", "\n\n", plain)
+ return plain.strip()
diff --git a/server/services/status_broadcaster.py b/server/services/status_broadcaster.py
index fb5918b3..9de86b2d 100644
--- a/server/services/status_broadcaster.py
+++ b/server/services/status_broadcaster.py
@@ -258,14 +258,15 @@ class StatusBroadcaster:
"""Fetch Twitter status from stored OAuth tokens in database.
Called on client connect to check if user is authenticated with Twitter.
+ Uses OAuth token system (matches REST endpoint and node handlers).
"""
try:
from core.container import container
auth_service = container.auth_service()
- # Check for stored access token
- access_token = await auth_service.get_api_key("twitter_access_token")
- if not access_token:
+ # Get tokens from OAuth system (NOT api_key system)
+ tokens = await auth_service.get_oauth_tokens("twitter", customer_id="owner")
+ if not tokens or not tokens.get("access_token"):
self._status["twitter"] = {
"connected": False,
"username": None,
@@ -275,32 +276,19 @@ class StatusBroadcaster:
}
return
- # Get stored user info
- user_info_str = await auth_service.get_api_key("twitter_user_info")
- if user_info_str:
- # Format: "user_id:username:name"
- parts = user_info_str.split(":", 2)
- user_id = parts[0] if len(parts) > 0 else None
- username = parts[1] if len(parts) > 1 else None
- name = parts[2] if len(parts) > 2 else None
+ # User info is stored in the OAuth token record
+ email = tokens.get("email", "") # Stored as "@username"
+ name = tokens.get("name", "")
+ username = email.lstrip("@") if email.startswith("@") else email
- self._status["twitter"] = {
- "connected": True,
- "username": username,
- "user_id": user_id,
- "name": name,
- "profile_image_url": None # Could fetch fresh if needed
- }
- logger.debug(f"[StatusBroadcaster] Twitter status: connected as @{username}")
- else:
- # Has token but no user info - still connected
- self._status["twitter"] = {
- "connected": True,
- "username": None,
- "user_id": None,
- "name": None,
- "profile_image_url": None
- }
+ self._status["twitter"] = {
+ "connected": True,
+ "username": username or None,
+ "user_id": None,
+ "name": name or None,
+ "profile_image_url": None
+ }
+ logger.debug(f"[StatusBroadcaster] Twitter status: connected as @{username}")
except Exception as e:
logger.debug(f"[StatusBroadcaster] Could not refresh Twitter status: {e}")
diff --git a/server/services/telegram_service.py b/server/services/telegram_service.py
index 1da76ae0..bf00b01f 100644
--- a/server/services/telegram_service.py
+++ b/server/services/telegram_service.py
@@ -348,6 +348,17 @@ class TelegramService:
return escape_markdown(text, version=1)
return text
+ @staticmethod
+ def _format_auto(text: str) -> tuple[str, str]:
+ """Convert GFM markdown to Telegram HTML using markdown-it-py.
+
+ Returns (formatted_text, parse_mode) tuple.
+ """
+ if not text:
+ return text, "HTML"
+ from services.markdown_formatter import to_telegram_html
+ return to_telegram_html(text), "HTML"
+
async def send_message(
self,
chat_id: str | int,
@@ -361,7 +372,7 @@ class TelegramService:
Args:
chat_id: Chat ID or @username
text: Message text
- parse_mode: 'HTML', 'Markdown', or 'MarkdownV2'
+ parse_mode: 'HTML', 'Markdown', 'MarkdownV2', or 'Auto'
disable_notification: Send silently
reply_to_message_id: Reply to this message
@@ -371,8 +382,11 @@ class TelegramService:
if not self._bot:
raise ValueError("Telegram bot not connected")
- effective_pm = parse_mode if parse_mode else None
- safe_text = self._escape_text(text, effective_pm)
+ if parse_mode == "Auto":
+ safe_text, effective_pm = self._format_auto(text)
+ else:
+ effective_pm = parse_mode if parse_mode else None
+ safe_text = self._escape_text(text, effective_pm)
try:
msg = await self._bot.send_message(
@@ -427,8 +441,11 @@ class TelegramService:
if not self._bot:
raise ValueError("Telegram bot not connected")
- effective_pm = parse_mode if parse_mode else None
- safe_caption = self._escape_text(caption, effective_pm) if caption else caption
+ if parse_mode == "Auto" and caption:
+ safe_caption, effective_pm = self._format_auto(caption)
+ else:
+ effective_pm = parse_mode if parse_mode else None
+ safe_caption = self._escape_text(caption, effective_pm) if caption else caption
try:
msg = await self._bot.send_photo(
@@ -484,8 +501,11 @@ class TelegramService:
if not self._bot:
raise ValueError("Telegram bot not connected")
- effective_pm = parse_mode if parse_mode else None
- safe_caption = self._escape_text(caption, effective_pm) if caption else caption
+ if parse_mode == "Auto" and caption:
+ safe_caption, effective_pm = self._format_auto(caption)
+ else:
+ effective_pm = parse_mode if parse_mode else None
+ safe_caption = self._escape_text(caption, effective_pm) if caption else caption
try:
msg = await self._bot.send_document(
diff --git a/server/skills/social_agent/twitter-search-skill/SKILL.md b/server/skills/social_agent/twitter-search-skill/SKILL.md
index 03513dee..0209d1d5 100644
--- a/server/skills/social_agent/twitter-search-skill/SKILL.md
+++ b/server/skills/social_agent/twitter-search-skill/SKILL.md
@@ -1,10 +1,10 @@
---
name: twitter-search-skill
-description: Search for recent tweets on Twitter/X using keywords, hashtags, mentions, and advanced query operators.
+description: Search for recent tweets on Twitter/X using keywords, hashtags, mentions, and advanced query operators. Returns rich tweet data with expanded URLs, author info, media, metrics, and referenced tweets.
allowed-tools: twitter_search
metadata:
author: machina
- version: "1.0"
+ version: "2.0"
category: social
icon: "🔍"
color: "#000000"
@@ -12,7 +12,7 @@ metadata:
# Twitter Search Tool
-Search for recent tweets on Twitter/X.
+Search for recent tweets on Twitter/X with rich data including full text, expanded URLs, author profiles, media attachments, engagement metrics, and referenced tweets.
## How It Works
@@ -20,7 +20,7 @@ This skill provides instructions for the **Twitter Search** tool node. Connect t
## twitter_search Tool
-Search for tweets matching a query.
+Search for tweets matching a query. Returns enriched tweet data via X API v2 expansions.
### Schema Fields
@@ -31,7 +31,7 @@ Search for tweets matching a query.
### Query Operators
-The X API supports advanced search operators:
+The X API v2 supports advanced search operators:
| Operator | Example | Description |
|----------|---------|-------------|
@@ -46,8 +46,15 @@ The X API supports advanced search operators:
| lang | `lang:en` | Language filter |
| has:links | `AI has:links` | Tweets with URLs |
| has:media | `sunset has:media` | Tweets with media |
+| has:images | `cat has:images` | Tweets with images |
+| has:videos | `news has:videos` | Tweets with videos |
| is:retweet | `bitcoin is:retweet` | Only retweets |
| -is:retweet | `news -is:retweet` | Exclude retweets |
+| is:reply | `@user is:reply` | Only replies |
+| -is:reply | `topic -is:reply` | Exclude replies |
+| is:quote | `breaking is:quote` | Only quote tweets |
+| url: | `url:"github.com"` | Tweets linking to domain |
+| context: | `context:131.1007360414114435072` | Tweets in topic context |
### Examples
@@ -62,15 +69,15 @@ The X API supports advanced search operators:
**Search with hashtag:**
```json
{
- "query": "#MachineLearning",
+ "query": "#MachineLearning -is:retweet lang:en",
"max_results": 50
}
```
-**Search tweets from a user:**
+**Search tweets from a user (original tweets only):**
```json
{
- "query": "from:OpenAI",
+ "query": "from:OpenAI -is:retweet",
"max_results": 10
}
```
@@ -78,21 +85,23 @@ The X API supports advanced search operators:
**Complex query:**
```json
{
- "query": "AI (startup OR company) -is:retweet lang:en",
+ "query": "AI (startup OR company) -is:retweet lang:en has:links",
"max_results": 100
}
```
-**Search with media:**
+**Search for media posts:**
```json
{
- "query": "sunset has:media",
+ "query": "sunset has:media -is:retweet",
"max_results": 25
}
```
### Response Format
+Each tweet includes rich data. The `display_text` field has t.co links replaced with full expanded URLs. Long-form tweets (>280 chars) use `note_tweet` content.
+
```json
{
"success": true,
@@ -100,9 +109,52 @@ The X API supports advanced search operators:
"tweets": [
{
"id": "1234567890123456789",
- "text": "Exciting developments in AI...",
+ "text": "Check out https://t.co/abc123",
+ "display_text": "Check out https://www.example.com/full-article-url",
"author_id": "987654321",
- "created_at": "2025-02-19T10:30:00Z"
+ "created_at": "2025-02-19T10:30:00+00:00",
+ "lang": "en",
+ "source": "Twitter Web App",
+ "conversation_id": "1234567890123456789",
+ "in_reply_to_user_id": null,
+ "possibly_sensitive": false,
+ "public_metrics": {
+ "retweet_count": 42,
+ "reply_count": 12,
+ "like_count": 256,
+ "quote_count": 5,
+ "bookmark_count": 18,
+ "impression_count": 15000
+ },
+ "author": {
+ "id": "987654321",
+ "username": "techuser",
+ "name": "Tech User",
+ "profile_image_url": "https://pbs.twimg.com/..."
+ },
+ "urls": [
+ {
+ "url": "https://t.co/abc123",
+ "expanded_url": "https://www.example.com/full-article-url",
+ "display_url": "example.com/full-article-..."
+ }
+ ],
+ "media": [
+ {
+ "media_key": "3_123456789",
+ "type": "photo",
+ "url": "https://pbs.twimg.com/media/...",
+ "alt_text": "Description of the image"
+ }
+ ],
+ "referenced_tweets": [
+ {
+ "type": "quoted",
+ "id": "1111111111111111111",
+ "text": "Original tweet text that was quoted",
+ "author_id": "222222222"
+ }
+ ]
}
],
"count": 20,
@@ -112,6 +164,30 @@ The X API supports advanced search operators:
}
```
+### Key Response Fields
+
+| Field | Description |
+|-------|-------------|
+| `text` | Raw tweet text (may contain t.co shortened links) |
+| `display_text` | Text with t.co links expanded to full URLs -- **use this for display** |
+| `author` | Author profile (username, name, profile image) from includes expansion |
+| `public_metrics` | Engagement: retweet_count, reply_count, like_count, quote_count, bookmark_count, impression_count |
+| `media` | Attached media objects (photo, video, animated_gif) with URLs and alt text |
+| `urls` | Expanded URL mappings (short t.co -> full URL) |
+| `referenced_tweets` | Quoted or replied-to tweets with their text content |
+| `lang` | Detected language code (e.g., "en", "es", "ja") |
+| `source` | Client used to post (e.g., "Twitter Web App", "Twitter for iPhone") |
+| `conversation_id` | ID of the conversation thread |
+| `in_reply_to_user_id` | If a reply, the user ID being replied to |
+
+### Important Notes
+
+- **Always use `display_text`** instead of `text` when showing tweet content to users -- it contains expanded URLs
+- **Long tweets**: Tweets over 280 characters use note_tweet; the full text is in the `text` field
+- **Media URLs**: `media[].url` gives the direct image/video URL
+- **Referenced tweets**: `referenced_tweets[].text` contains the full text of quoted/replied tweets
+- **Metrics**: `public_metrics` shows real-time engagement counts
+
### Error Response
```json
@@ -125,19 +201,22 @@ The X API supports advanced search operators:
## Guidelines
1. **Query length**: Keep queries concise for better results
-2. **Max results**: Limited to 100 per request (API constraint)
-3. **Recent tweets only**: X API v2 free tier searches recent tweets (last 7 days)
+2. **Max results**: Minimum 10, maximum 100 per request (X API v2 constraint)
+3. **Recent tweets only**: X API v2 free/basic tier searches recent tweets (last 7 days)
4. **Rate limits**: Be mindful of API rate limits when searching repeatedly
5. **Combine operators**: Use multiple operators for precise filtering
+6. **Exclude retweets**: Add `-is:retweet` to get original content only
+7. **Language filter**: Add `lang:en` to filter by language
## Common Use Cases
-- Monitor brand mentions
-- Track trending topics
-- Find tweets about specific subjects
-- Research competitor activity
-- Gather content for curation
-- Find influencers discussing topics
+- Monitor brand mentions with engagement metrics
+- Track trending topics and measure reach
+- Find tweets about specific subjects with media
+- Research competitor activity and engagement
+- Gather content for curation with full context
+- Find influencers by analyzing follower/engagement metrics
+- Analyze conversation threads via conversation_id
## Setup Requirements
diff --git a/server/skills/social_agent/twitter-send-skill/SKILL.md b/server/skills/social_agent/twitter-send-skill/SKILL.md
index e64c90cd..5902a991 100644
--- a/server/skills/social_agent/twitter-send-skill/SKILL.md
+++ b/server/skills/social_agent/twitter-send-skill/SKILL.md
@@ -1,10 +1,10 @@
---
name: twitter-send-skill
-description: Post tweets, reply to tweets, retweet, like/unlike, and delete tweets on Twitter/X.
+description: Post tweets, reply to tweets, retweet, like/unlike, and delete tweets on Twitter/X. Supports threading, 280-char tweets, and automatic token refresh.
allowed-tools: twitter_send
metadata:
author: machina
- version: "1.0"
+ version: "2.0"
category: social
icon: "📤"
color: "#000000"
@@ -12,12 +12,14 @@ metadata:
# Twitter Send Tool
-Post and interact with tweets on Twitter/X.
+Post and interact with tweets on Twitter/X via X API v2.
## How It Works
This skill provides instructions for the **Twitter Send** tool node. Connect the **Twitter Send** node to an AI Agent's `input-tools` handle to enable posting and interactions.
+All actions use OAuth 2.0 user context with automatic token refresh on expiry (tokens last 2 hours).
+
## twitter_send Tool
Send tweets, replies, retweets, likes, and deletions.
@@ -33,14 +35,14 @@ Send tweets, replies, retweets, likes, and deletions.
### Actions
-| Action | Required Fields | Description |
-|--------|-----------------|-------------|
-| `tweet` | text | Post a new tweet |
-| `reply` | text, reply_to_id | Reply to an existing tweet |
-| `retweet` | tweet_id | Retweet an existing tweet |
-| `like` | tweet_id | Like a tweet |
-| `unlike` | tweet_id | Remove like from a tweet |
-| `delete` | tweet_id | Delete your own tweet |
+| Action | Required Fields | Description | Rate Limit Notes |
+|--------|-----------------|-------------|------------------|
+| `tweet` | text | Post a new tweet | 200 tweets/15min (app), 300/3hr (user) |
+| `reply` | text, reply_to_id | Reply to an existing tweet | Same as tweet limits |
+| `retweet` | tweet_id | Retweet an existing tweet | 5 retweets/15min (free tier) |
+| `like` | tweet_id | Like a tweet | 200 likes/24hr (free tier) |
+| `unlike` | tweet_id | Remove like from a tweet | 50 unlikes/15min |
+| `delete` | tweet_id | Delete your own tweet | 50 deletes/15min |
### Examples
@@ -61,6 +63,23 @@ Send tweets, replies, retweets, likes, and deletions.
}
```
+**Create a thread (chain of replies):**
+First post:
+```json
+{
+ "action": "tweet",
+ "text": "Thread: Here are 3 tips for better code (1/3)"
+}
+```
+Then reply to the returned tweet ID for each subsequent post:
+```json
+{
+ "action": "reply",
+ "text": "Tip 1: Write tests first (2/3)",
+ "reply_to_id": "<id_from_first_tweet>"
+}
+```
+
**Retweet:**
```json
{
@@ -95,20 +114,51 @@ Send tweets, replies, retweets, likes, and deletions.
### Response Format
+**Tweet/Reply:**
```json
{
"success": true,
"result": {
- "data": {
- "id": "1234567890123456789",
- "text": "Hello Twitter!"
- },
- "action": "tweet_sent"
+ "id": "1234567890123456789",
+ "text": "Hello Twitter!"
},
"execution_time": 0.45
}
```
+**Retweet:**
+```json
+{
+ "success": true,
+ "result": {
+ "retweeted": true
+ },
+ "execution_time": 0.3
+}
+```
+
+**Like:**
+```json
+{
+ "success": true,
+ "result": {
+ "liked": true
+ },
+ "execution_time": 0.25
+}
+```
+
+**Delete:**
+```json
+{
+ "success": true,
+ "result": {
+ "deleted": true
+ },
+ "execution_time": 0.3
+}
+```
+
### Error Response
```json
@@ -121,22 +171,26 @@ Send tweets, replies, retweets, likes, and deletions.
## Guidelines
-1. **Character limit**: Tweets are limited to 280 characters
-2. **Tweet IDs**: Use the numeric ID string (e.g., `1234567890123456789`)
-3. **Rate limits**: X API has rate limits - avoid rapid posting
-4. **Content policy**: Follow X's content policies and terms of service
-5. **Threading**: Use reply action with reply_to_id to create threads
+1. **Character limit**: Tweets are limited to 280 characters. The API will reject longer text.
+2. **Tweet IDs**: Use the numeric ID string (e.g., `1234567890123456789`). Get these from search results or user timelines.
+3. **Rate limits**: X API has strict rate limits (see table above). Space out rapid actions.
+4. **Content policy**: Follow X's content policies and terms of service.
+5. **Threading**: Use reply action with `reply_to_id` set to the previous tweet's ID to create threads.
+6. **Token refresh**: If a 401/403 error occurs, the system automatically refreshes the OAuth token and retries.
+7. **Retweet vs Quote**: This tool only supports native retweets. For quote tweets, use `tweet` action and include the tweet URL in the text.
## Common Use Cases
- Post automated updates and announcements
- Reply to mentions or specific tweets
-- Like tweets matching certain criteria
-- Create tweet threads by chaining replies
+- Like tweets matching certain criteria (found via twitter_search)
+- Create tweet threads by chaining replies using returned IDs
- Engage with followers programmatically
+- Delete tweets that match certain conditions
## Setup Requirements
1. Connect the **Twitter Send** node to an AI Agent's `input-tools` handle
2. Ensure Twitter is connected (authenticated via OAuth in Credentials Modal)
3. Your X Developer account must have appropriate API access level
+4. Required OAuth scopes: `tweet.read`, `tweet.write`, `like.read`, `like.write`, `users.read`, `offline.access`
diff --git a/server/skills/social_agent/twitter-user-skill/SKILL.md b/server/skills/social_agent/twitter-user-skill/SKILL.md
index e708a0d5..7c4f2945 100644
--- a/server/skills/social_agent/twitter-user-skill/SKILL.md
+++ b/server/skills/social_agent/twitter-user-skill/SKILL.md
@@ -1,10 +1,10 @@
---
name: twitter-user-skill
-description: Look up Twitter/X user profiles, get authenticated user info, and retrieve followers/following lists.
+description: Look up Twitter/X user profiles with descriptions, get authenticated user info, and retrieve followers/following lists with profile details.
allowed-tools: twitter_user
metadata:
author: machina
- version: "1.0"
+ version: "2.0"
category: social
icon: "👤"
color: "#000000"
@@ -12,12 +12,14 @@ metadata:
# Twitter User Tool
-Look up user profiles and social connections on Twitter/X.
+Look up user profiles and social connections on Twitter/X via X API v2.
## How It Works
This skill provides instructions for the **Twitter User** tool node. Connect the **Twitter User** node to an AI Agent's `input-tools` handle to enable user lookups.
+All operations use OAuth 2.0 user context with automatic token refresh on expiry.
+
## twitter_user Tool
Retrieve user information and social connections.
@@ -29,17 +31,17 @@ Retrieve user information and social connections.
| operation | string | Yes | Operation type: `me`, `by_username`, `by_id`, `followers`, `following` |
| username | string | If by_username | Twitter username (without @) |
| user_id | string | If by_id/followers/following | Twitter user ID |
-| max_results | integer | No | For followers/following (default: 100, max: 1000) |
+| max_results | integer | No | For followers/following (1-1000, default: 100) |
### Operations
-| Operation | Required Fields | Description |
-|-----------|-----------------|-------------|
-| `me` | none | Get authenticated user's profile |
-| `by_username` | username | Look up user by username |
-| `by_id` | user_id | Look up user by ID |
-| `followers` | user_id (optional) | Get user's followers (defaults to authenticated user) |
-| `following` | user_id (optional) | Get accounts user follows (defaults to authenticated user) |
+| Operation | Required Fields | Description | Rate Limit (free tier) |
+|-----------|-----------------|-------------|------------------------|
+| `me` | none | Get authenticated user's profile | 25 req/24hr |
+| `by_username` | username | Look up user by username | 100 req/24hr |
+| `by_id` | user_id | Look up user by ID | 100 req/24hr |
+| `followers` | user_id (optional) | Get user's followers (defaults to authenticated user) | 15 req/15min |
+| `following` | user_id (optional) | Get accounts user follows (defaults to authenticated user) | 15 req/15min |
### Examples
@@ -93,45 +95,59 @@ Retrieve user information and social connections.
### Response Format - Single User
+All user lookups return profile data including description and account creation date:
+
```json
{
"success": true,
"result": {
- "user": {
- "id": "44196397",
- "username": "elonmusk",
- "name": "Elon Musk",
- "profile_image_url": "https://pbs.twimg.com/...",
- "verified": true
- }
+ "id": "44196397",
+ "username": "elonmusk",
+ "name": "Elon Musk",
+ "profile_image_url": "https://pbs.twimg.com/profile_images/.../photo.jpg",
+ "verified": true,
+ "description": "Mars & Cars, Chips & Dips",
+ "created_at": "2009-06-02 20:12:29+00:00"
},
"execution_time": 0.35
}
```
-### Response Format - User List
+### Response Format - User List (Followers/Following)
```json
{
"success": true,
"result": {
- "followers": {
- "users": [
- {
- "id": "123456789",
- "username": "user1",
- "name": "User One",
- "profile_image_url": "https://...",
- "verified": false
- }
- ],
- "count": 100
- }
+ "users": [
+ {
+ "id": "123456789",
+ "username": "user1",
+ "name": "User One",
+ "profile_image_url": "https://pbs.twimg.com/...",
+ "verified": false,
+ "description": "Software developer and open source enthusiast",
+ "created_at": "2020-03-15 08:30:00+00:00"
+ }
+ ],
+ "count": 100
},
"execution_time": 1.2
}
```
+### Key Response Fields
+
+| Field | Description |
+|-------|-------------|
+| `id` | Unique numeric user ID (use for followers/following lookups) |
+| `username` | Handle without @ (use for by_username lookups) |
+| `name` | Display name |
+| `profile_image_url` | URL to profile picture |
+| `verified` | Whether the account is verified |
+| `description` | User's bio text |
+| `created_at` | Account creation timestamp |
+
### Error Response
```json
@@ -145,21 +161,26 @@ Retrieve user information and social connections.
## Guidelines
1. **Usernames**: Provide without the @ symbol (e.g., `elonmusk` not `@elonmusk`)
-2. **User IDs**: Use the numeric ID string
-3. **Rate limits**: Follower/following endpoints have lower rate limits
-4. **Max results**: Limited to 1000 per request for followers/following
-5. **Pagination**: For large accounts, results are paginated (first page returned)
+2. **User IDs**: Use the numeric ID string. Get these from search results (`author_id`) or user lookups
+3. **Rate limits**: `me` endpoint is heavily rate-limited (25/24hr on free tier) -- avoid calling repeatedly
+4. **Max results**: Minimum 1, maximum 1000 per request for followers/following
+5. **Pagination**: Only the first page is returned. For large accounts, max_results controls page size
+6. **Defaults to self**: If `user_id` is omitted for followers/following, it defaults to the authenticated user
+7. **Token refresh**: If a 401/403 error occurs, the system automatically refreshes the OAuth token and retries
## Common Use Cases
-- Get your own profile information
+- Get your own profile information and bio
- Look up profiles of users you interact with
- Check if users are verified
-- Analyze follower/following relationships
-- Build lists of relevant accounts
+- Analyze follower/following relationships and growth
+- Build lists of relevant accounts in a niche
+- Get user IDs from usernames for use in search queries (e.g., `from:username`)
+- Compare follower counts between accounts
## Setup Requirements
1. Connect the **Twitter User** node to an AI Agent's `input-tools` handle
2. Ensure Twitter is connected (authenticated via OAuth in Credentials Modal)
3. Your X Developer account must have appropriate API access level
+4. Required OAuth scopes: `users.read`, `follows.read`, `offline.access`
diff --git a/workflows/AI Employee.json b/workflows/AI Employee[Experimental].json
similarity index 98%
rename from workflows/AI Employee.json
rename to workflows/AI Employee[Experimental].json
index 182e82c2..c820547f 100644
--- a/workflows/AI Employee.json
+++ b/workflows/AI Employee[Experimental].json
@@ -1,5 +1,5 @@
{
- "id": "workflow-1772437472641-wdn3sj4us",
+ "id": "example_workflow-1772437472641-wdn3sj4us",
"name": "AI Employee[Experimental]",
"nodes": [
{
@@ -45,7 +45,7 @@
"type": "taskTrigger",
"position": {
"x": -960,
- "y": 740
+ "y": 860
},
"data": {
"label": "Task Completed"
@@ -55,7 +55,7 @@
"selected": false,
"positionAbsolute": {
"x": -960,
- "y": 740
+ "y": 860
},
"dragging": false
},
@@ -63,8 +63,8 @@
"id": "chatTrigger-1772283321856",
"type": "chatTrigger",
"position": {
- "x": -940,
- "y": 640
+ "x": -960,
+ "y": 740
},
"data": {
"label": "Chat Trigger"
@@ -73,17 +73,17 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": -940,
- "y": 640
+ "x": -960,
+ "y": 740
},
- "dragging": true
+ "dragging": false
},
{
"id": "console-1772283322828",
"type": "console",
"position": {
- "x": 180,
- "y": 660
+ "x": 120,
+ "y": 760
},
"data": {
"label": "Console"
@@ -92,10 +92,10 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 180,
- "y": 660
+ "x": 120,
+ "y": 760
},
- "dragging": true
+ "dragging": false
},
{
"id": "teamMonitor-1772283324318",
@@ -443,7 +443,7 @@
"id": "simpleMemory-1772286654076",
"type": "simpleMemory",
"position": {
- "x": -940,
+ "x": -900,
"y": 1420
},
"data": {
@@ -453,7 +453,7 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": -940,
+ "x": -900,
"y": 1420
},
"dragging": false
@@ -481,7 +481,7 @@
"id": "simpleMemory-1772286667244",
"type": "simpleMemory",
"position": {
- "x": 100,
+ "x": 120,
"y": 1420
},
"data": {
@@ -491,17 +491,17 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 100,
+ "x": 120,
"y": 1420
},
- "dragging": false
+ "dragging": true
},
{
"id": "simpleMemory-1772286673234",
"type": "simpleMemory",
"position": {
"x": 600,
- "y": 1440
+ "y": 1400
},
"data": {
"label": "Simple Memory 4"
@@ -511,9 +511,9 @@
"selected": false,
"positionAbsolute": {
"x": 600,
- "y": 1440
+ "y": 1400
},
- "dragging": false
+ "dragging": true
},
{
"id": "simpleMemory-1772437660092",
@@ -552,6 +552,44 @@
"y": 1080
},
"dragging": false
+ },
+ {
+ "id": "telegramSend-1772718415802",
+ "type": "telegramSend",
+ "position": {
+ "x": 100,
+ "y": 640
+ },
+ "data": {
+ "label": "Telegram Send"
+ },
+ "width": 80,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": 100,
+ "y": 640
+ },
+ "dragging": false
+ },
+ {
+ "id": "telegramReceive-1772718416883",
+ "type": "telegramReceive",
+ "position": {
+ "x": -980,
+ "y": 620
+ },
+ "data": {
+ "label": "Telegram Receive"
+ },
+ "width": 94,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": -980,
+ "y": 620
+ },
+ "dragging": false
}
],
"edges": [
@@ -932,11 +970,39 @@
"targetHandle": "input-skill",
"id": "reactflow__edge-masterSkill-1772437683119output-main-orchestrator_agent-1772283239381input-skill",
"selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "telegramReceive-1772718416883",
+ "sourceHandle": "output-main",
+ "target": "ai_employee-1772283240733",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-telegramReceive-1772718416883output-main-ai_employee-1772283240733input-main",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "ai_employee-1772283240733",
+ "sourceHandle": "output-main",
+ "target": "telegramSend-1772718415802",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-ai_employee-1772283240733output-main-telegramSend-1772718415802input-main",
+ "selected": false
}
],
- "createdAt": "2026-03-02T07:44:32.641Z",
- "lastModified": "2026-03-02T07:49:24.197Z",
- "version": "0.0.40",
+ "createdAt": "2026-03-05T04:32:30.655Z",
+ "lastModified": "2026-03-05T16:07:13.122Z",
+ "version": "0.0.42",
"nodeParameters": {
"orchestrator_agent-1772283239381": {
"provider": "openai",
@@ -949,7 +1015,7 @@
"ai_employee-1772283240733": {
"provider": "openai",
"model": "gpt-5.2",
- "prompt": "{{chattrigger.message}}",
+ "prompt": "{{chattrigger.message}} {{telegramreceive.text}}",
"systemMessage": "You are a helpful assistant",
"teamMode": "parallel",
"maxConcurrent": 5,
@@ -969,7 +1035,7 @@
},
"console-1772283322828": {
"label": "Console",
- "logMode": "all",
+ "logMode": "field",
"fieldPath": "{{aiemployee.data}}",
"expression": "",
"format": "json"
@@ -1303,6 +1369,32 @@
},
"masterSkill-1772437683119": {
"label": "Master Skill 5"
+ },
+ "telegramSend-1772718415802": {
+ "recipient_type": "self",
+ "chat_id": "",
+ "message_type": "text",
+ "text": "{{aiemployee.response}}",
+ "media_url": "",
+ "caption": "",
+ "latitude": 0,
+ "longitude": 0,
+ "phone_number": "",
+ "first_name": "",
+ "last_name": "",
+ "parse_mode": "",
+ "silent": false,
+ "reply_to_message_id": 0,
+ "label": "Telegram Send"
+ },
+ "telegramReceive-1772718416883": {
+ "contentTypeFilter": "text",
+ "senderFilter": "self",
+ "chat_id": "",
+ "from_user": "",
+ "keywords": "",
+ "ignoreBots": true,
+ "label": "Telegram Receive"
}
}
}
\ No newline at end of file
diff --git a/workflows/Zeenie Agent.json b/workflows/Zeenie Agent.json
index 393a4548..34eedf70 100644
--- a/workflows/Zeenie Agent.json
+++ b/workflows/Zeenie Agent.json
@@ -1,5 +1,5 @@
{
- "id": "example_example_example_workflow-1770568399727-b5zkjpuda",
+ "id": "example_example_example_example_workflow-1770568399727-b5zkjpuda",
"name": "Zeenie Agent",
"nodes": [
{
@@ -25,7 +25,7 @@
"id": "chatTrigger-1770207686160",
"type": "chatTrigger",
"position": {
- "x": -260,
+ "x": -200,
"y": 400
},
"data": {
@@ -35,7 +35,7 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": -260,
+ "x": -200,
"y": 400
},
"dragging": false
@@ -44,8 +44,8 @@
"id": "console-1770207687094",
"type": "console",
"position": {
- "x": 800,
- "y": 340
+ "x": 820,
+ "y": 320
},
"data": {
"label": "Console"
@@ -54,181 +54,257 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 800,
- "y": 340
+ "x": 820,
+ "y": 320
},
"dragging": false
},
{
- "id": "whatsappReceive-1770207696316",
- "type": "whatsappReceive",
+ "id": "duckduckgoSearch-1770207714722",
+ "type": "duckduckgoSearch",
"position": {
- "x": -280,
- "y": 260
+ "x": 460,
+ "y": 540
},
"data": {
- "label": "WhatsApp Receive"
+ "label": "DuckDuckGo"
},
- "width": 101,
+ "width": 71,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": -280,
- "y": 260
+ "x": 460,
+ "y": 540
},
"dragging": false
},
{
- "id": "whatsappDb-1770207697703",
- "type": "whatsappDb",
+ "id": "httpRequest-1770207725414",
+ "type": "httpRequest",
"position": {
- "x": 1020,
+ "x": 560,
"y": 540
},
"data": {
- "label": "WhatsApp DB"
+ "label": "HTTP Request"
},
"width": 76,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 1020,
+ "x": 560,
"y": 540
},
"dragging": false
},
{
- "id": "duckduckgoSearch-1770207714722",
- "type": "duckduckgoSearch",
+ "id": "pythonExecutor-1770207749221",
+ "type": "pythonExecutor",
"position": {
- "x": 500,
+ "x": 660,
"y": 540
},
"data": {
- "label": "DuckDuckGo"
+ "label": "Python Executor"
},
- "width": 71,
+ "width": 89,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 500,
+ "x": 660,
"y": 540
},
"dragging": false
},
{
- "id": "httpRequest-1770207725414",
- "type": "httpRequest",
+ "id": "masterSkill-1770207855144",
+ "type": "masterSkill",
"position": {
- "x": 620,
+ "x": 260,
"y": 540
},
"data": {
- "label": "HTTP Request"
+ "label": "Master Skill"
},
- "width": 76,
+ "width": 63,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 620,
+ "x": 260,
"y": 540
},
"dragging": false
},
{
- "id": "pythonExecutor-1770207749221",
- "type": "pythonExecutor",
+ "id": "simpleMemory-1770207943830",
+ "type": "simpleMemory",
"position": {
- "x": 880,
+ "x": 120,
"y": 540
},
"data": {
- "label": "Python Executor"
+ "label": "Simple Memory"
},
- "width": 89,
+ "width": 87,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 880,
+ "x": 120,
"y": 540
},
- "dragging": false
+ "dragging": true
+ },
+ {
+ "id": "telegramSend-1772705307135",
+ "type": "telegramSend",
+ "position": {
+ "x": 800,
+ "y": 200
+ },
+ "data": {
+ "label": "Telegram Send"
+ },
+ "width": 80,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": 800,
+ "y": 200
+ },
+ "dragging": true
+ },
+ {
+ "id": "telegramReceive-1772705308277",
+ "type": "telegramReceive",
+ "position": {
+ "x": -220,
+ "y": 280
+ },
+ "data": {
+ "label": "Telegram Receive"
+ },
+ "width": 94,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": -220,
+ "y": 280
+ },
+ "dragging": true
},
{
- "id": "javascriptExecutor-1770207751142",
- "type": "javascriptExecutor",
+ "id": "gmaps_locations-1772705500946",
+ "type": "gmaps_locations",
"position": {
- "x": 740,
+ "x": 1200,
"y": 540
},
"data": {
- "label": "JavaScript Executor"
+ "label": "GMaps Locations"
},
- "width": 105,
+ "width": 93,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 740,
+ "x": 1200,
"y": 540
},
"dragging": false
},
{
- "id": "masterSkill-1770207855144",
- "type": "masterSkill",
+ "id": "gmaps_nearby_places-1772705502591",
+ "type": "gmaps_nearby_places",
"position": {
- "x": 200,
+ "x": 1060,
"y": 540
},
"data": {
- "label": "Master Skill"
+ "label": "GMaps Nearby Places"
},
- "width": 63,
+ "width": 118,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 200,
+ "x": 1060,
+ "y": 540
+ },
+ "dragging": true
+ },
+ {
+ "id": "twitterSearch-1772705512370",
+ "type": "twitterSearch",
+ "position": {
+ "x": 880,
+ "y": 540
+ },
+ "data": {
+ "label": "Twitter Search"
+ },
+ "width": 77,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": 880,
"y": 540
},
"dragging": false
},
{
- "id": "simpleMemory-1770207943830",
- "type": "simpleMemory",
+ "id": "twitterUser-1772705513349",
+ "type": "twitterUser",
"position": {
- "x": 60,
+ "x": 980,
"y": 540
},
"data": {
- "label": "Simple Memory"
+ "label": "Twitter User"
},
- "width": 87,
+ "width": 65,
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 60,
+ "x": 980,
"y": 540
},
"dragging": false
},
{
- "id": "whatsappSend-1771936846253",
- "type": "whatsappSend",
+ "id": "gmail-1772705536587",
+ "type": "gmail",
+ "position": {
+ "x": 1320,
+ "y": 540
+ },
+ "data": {
+ "label": "Gmail"
+ },
+ "width": 60,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": 1320,
+ "y": 540
+ },
+ "dragging": true
+ },
+ {
+ "id": "sheets-1772705541286",
+ "type": "sheets",
"position": {
"x": 780,
- "y": 200
+ "y": 540
},
"data": {
- "label": "WhatsApp Send"
+ "label": "Sheets"
},
- "width": 87,
+ "width": 60,
"height": 82,
"selected": false,
"positionAbsolute": {
"x": 780,
- "y": 200
+ "y": 540
},
- "dragging": true
+ "dragging": false
}
],
"edges": [
@@ -253,11 +329,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "whatsappReceive-1770207696316",
+ "source": "masterSkill-1770207855144",
"sourceHandle": "output-main",
"target": "chatAgent-1770207244010",
- "targetHandle": "input-main",
- "id": "reactflow__edge-whatsappReceive-1770207696316output-main-chatAgent-1770207244010input-main",
+ "targetHandle": "input-skill",
+ "id": "reactflow__edge-masterSkill-1770207855144output-main-chatAgent-1770207244010input-skill",
"selected": false
},
{
@@ -267,11 +343,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "masterSkill-1770207855144",
- "sourceHandle": "output-main",
+ "source": "simpleMemory-1770207943830",
+ "sourceHandle": "output-memory",
"target": "chatAgent-1770207244010",
- "targetHandle": "input-skill",
- "id": "reactflow__edge-masterSkill-1770207855144output-main-chatAgent-1770207244010input-skill",
+ "targetHandle": "input-memory",
+ "id": "reactflow__edge-simpleMemory-1770207943830output-memory-chatAgent-1770207244010input-memory",
"selected": false
},
{
@@ -281,11 +357,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "simpleMemory-1770207943830",
- "sourceHandle": "output-memory",
+ "source": "httpRequest-1770207725414",
+ "sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
- "targetHandle": "input-memory",
- "id": "reactflow__edge-simpleMemory-1770207943830output-memory-chatAgent-1770207244010input-memory",
+ "targetHandle": "input-tools",
+ "id": "reactflow__edge-httpRequest-1770207725414output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -295,11 +371,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "httpRequest-1770207725414",
+ "source": "duckduckgoSearch-1770207714722",
"sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
"targetHandle": "input-tools",
- "id": "reactflow__edge-httpRequest-1770207725414output-tool-chatAgent-1770207244010input-tools",
+ "id": "reactflow__edge-duckduckgoSearch-1770207714722output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -309,11 +385,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "javascriptExecutor-1770207751142",
+ "source": "pythonExecutor-1770207749221",
"sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
"targetHandle": "input-tools",
- "id": "reactflow__edge-javascriptExecutor-1770207751142output-tool-chatAgent-1770207244010input-tools",
+ "id": "reactflow__edge-pythonExecutor-1770207749221output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -323,11 +399,53 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "duckduckgoSearch-1770207714722",
+ "source": "chatAgent-1770207244010",
+ "sourceHandle": "output-main",
+ "target": "console-1770207687094",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-chatAgent-1770207244010output-main-console-1770207687094input-main",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "telegramReceive-1772705308277",
+ "sourceHandle": "output-main",
+ "target": "chatAgent-1770207244010",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-telegramReceive-1772705308277output-main-chatAgent-1770207244010input-main",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "chatAgent-1770207244010",
+ "sourceHandle": "output-main",
+ "target": "telegramSend-1772705307135",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-chatAgent-1770207244010output-main-telegramSend-1772705307135input-main",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "gmail-1772705536587",
"sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
"targetHandle": "input-tools",
- "id": "reactflow__edge-duckduckgoSearch-1770207714722output-tool-chatAgent-1770207244010input-tools",
+ "id": "reactflow__edge-gmail-1772705536587output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -337,11 +455,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "pythonExecutor-1770207749221",
+ "source": "sheets-1772705541286",
"sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
"targetHandle": "input-tools",
- "id": "reactflow__edge-pythonExecutor-1770207749221output-tool-chatAgent-1770207244010input-tools",
+ "id": "reactflow__edge-sheets-1772705541286output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -351,11 +469,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "whatsappDb-1770207697703",
+ "source": "twitterSearch-1772705512370",
"sourceHandle": "output-tool",
"target": "chatAgent-1770207244010",
"targetHandle": "input-tools",
- "id": "reactflow__edge-whatsappDb-1770207697703output-tool-chatAgent-1770207244010input-tools",
+ "id": "reactflow__edge-twitterSearch-1772705512370output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -365,11 +483,11 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "chatAgent-1770207244010",
- "sourceHandle": "output-main",
- "target": "console-1770207687094",
- "targetHandle": "input-main",
- "id": "reactflow__edge-chatAgent-1770207244010output-main-console-1770207687094input-main",
+ "source": "twitterUser-1772705513349",
+ "sourceHandle": "output-tool",
+ "target": "chatAgent-1770207244010",
+ "targetHandle": "input-tools",
+ "id": "reactflow__edge-twitterUser-1772705513349output-tool-chatAgent-1770207244010input-tools",
"selected": false
},
{
@@ -379,22 +497,36 @@
"stroke": "#8be9fd",
"strokeWidth": 3
},
- "source": "chatAgent-1770207244010",
- "sourceHandle": "output-main",
- "target": "whatsappSend-1771936846253",
- "targetHandle": "input-main",
- "id": "reactflow__edge-chatAgent-1770207244010output-main-whatsappSend-1771936846253input-main",
+ "source": "gmaps_nearby_places-1772705502591",
+ "sourceHandle": "output-tool",
+ "target": "chatAgent-1770207244010",
+ "targetHandle": "input-tools",
+ "id": "reactflow__edge-gmaps_nearby_places-1772705502591output-tool-chatAgent-1770207244010input-tools",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "gmaps_locations-1772705500946",
+ "sourceHandle": "output-tool",
+ "target": "chatAgent-1770207244010",
+ "targetHandle": "input-tools",
+ "id": "reactflow__edge-gmaps_locations-1772705500946output-tool-chatAgent-1770207244010input-tools",
"selected": false
}
],
- "createdAt": "2026-02-26T22:56:32.651Z",
- "lastModified": "2026-02-27T05:14:59.285Z",
- "version": "0.0.37",
+ "createdAt": "2026-03-05T04:32:30.897Z",
+ "lastModified": "2026-03-05T05:31:55.000Z",
+ "version": "0.0.42",
"nodeParameters": {
"chatAgent-1770207244010": {
"provider": "openai",
"model": "gpt-5.2",
- "prompt": "{{chattrigger.message}} {{whatsappreceive.text}}",
+ "prompt": "{{chattrigger.message}} {{telegramreceive.text}}",
"systemMessage": "You are a helpful assistant."
},
"console-1770207687094": {
@@ -405,7 +537,7 @@
"format": "json"
},
"masterSkill-1770207855144": {
- "skillFolder": "web_agent",
+ "skillFolder": "social_agent",
"skillsConfig": {
"memory-skill": {
"enabled": true,
@@ -443,7 +575,7 @@
"isCustomized": false
},
"whatsapp-db-skill": {
- "enabled": true,
+ "enabled": false,
"instructions": "# WhatsApp Database Tool\n\nQuery WhatsApp database for contacts, groups, and message history.\n\n## How It Works\n\nThis skill provides instructions for the **WhatsApp DB** tool node. Connect the **WhatsApp DB** node to Zeenie's `input-tools` handle to enable database queries.\n\n## whatsapp_db Tool\n\nQuery contacts, groups, and chat history.\n\n### Schema Fields\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Operation type (see below) |\n| chat_type | string | For chat_history | `\"individual\"` or `\"group\"` |\n| phone | string | Varies | Phone number (for chat_history individual, get_contact_info) |\n| group_id | string | Varies | Group JID (for chat_history group, get_group_info) |\n| query | string | No | Search query (for search_groups, list_contacts) |\n| limit | int | No | Max results (varies by operation) |\n| offset | int | No | Pagination offset (for chat_history) |\n| message_filter | string | No | `\"all\"` or `\"text_only\"` (for chat_history) |\n| group_filter | string | No | `\"all\"` or `\"contact\"` (for group chat_history) |\n| sender_phone | string | No | Filter by sender (when group_filter=\"contact\") |\n| phones | string | For check_contacts | Comma-separated phone numbers |\n| participant_limit | int | No | Max participants (for get_group_info, 1-100) |\n\n### Operations\n\n| Operation | Description | Required Fields |\n|-----------|-------------|-----------------|\n| `list_contacts` | List contacts with saved names | query (optional), limit |\n| `get_contact_info` | Get full contact details | phone |\n| `search_groups` | Search groups by name | query, limit |\n| `get_group_info` | Get group details with participants | group_id |\n| `chat_history` | Retrieve message history | chat_type, phone/group_id |\n| `check_contacts` | Check WhatsApp registration | phones |\n\n### Limits\n\n| Operation | Default | Max |\n|-----------|---------|-----|\n| chat_history | 50 | 500 |\n| search_groups | 20 | 50 |\n| list_contacts | 50 | 100 |\n| get_group_info participants | 50 | 100 |\n\n**Important:** Always use small limits and specific queries to avoid context overflow.\n\n## Operation Examples\n\n### list_contacts\n\nFind contacts by name.\n\n```json\n{\n \"operation\": \"list_contacts\",\n \"query\": \"mom\",\n \"limit\": 10\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"list_contacts\",\n \"contacts\": [\n {\"phone\": \"919876543210\", \"name\": \"Mom\", \"jid\": \"[email protected]\"}\n ],\n \"total\": 1\n}\n```\n\n### get_contact_info\n\nGet full contact details for sending/replying.\n\n```json\n{\n \"operation\": \"get_contact_info\",\n \"phone\": \"919876543210\"\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"get_contact_info\",\n \"phone\": \"919876543210\",\n \"name\": \"Mom\",\n \"jid\": \"[email protected]\",\n \"profile_picture\": \"https://...\"\n}\n```\n\n### search_groups\n\nSearch groups by name.\n\n```json\n{\n \"operation\": \"search_groups\",\n \"query\": \"family\",\n \"limit\": 10\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"search_groups\",\n \"groups\": [\n {\"group_id\": \"[email protected]\", \"name\": \"Family Group\", \"participant_count\": 5}\n ],\n \"total\": 1\n}\n```\n\n### get_group_info\n\nGet group details with participant list.\n\n```json\n{\n \"operation\": \"get_group_info\",\n \"group_id\": \"[email protected]\",\n \"participant_limit\": 20\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"get_group_info\",\n \"name\": \"Family Group\",\n \"jid\": \"[email protected]\",\n \"participants\": [\n {\"phone\": \"919876543210\", \"name\": \"Mom\", \"is_admin\": true},\n {\"phone\": \"919876543211\", \"name\": \"Dad\", \"is_admin\": false}\n ],\n \"total_participants\": 5\n}\n```\n\n### chat_history (Individual)\n\nGet messages from an individual chat.\n\n```json\n{\n \"operation\": \"chat_history\",\n \"chat_type\": \"individual\",\n \"phone\": \"919876543210\",\n \"limit\": 20\n}\n```\n\n### chat_history (Group)\n\nGet messages from a group chat.\n\n```json\n{\n \"operation\": \"chat_history\",\n \"chat_type\": \"group\",\n \"group_id\": \"[email protected]\",\n \"message_filter\": \"text_only\",\n \"limit\": 50\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"chat_history\",\n \"messages\": [\n {\n \"index\": 1,\n \"message_id\": \"ABC123\",\n \"sender\": \"[email protected]\",\n \"sender_name\": \"Mom\",\n \"text\": \"Hello!\",\n \"timestamp\": \"2025-01-30T12:00:00\",\n \"is_from_me\": false\n }\n ],\n \"total\": 50,\n \"has_more\": true\n}\n```\n\n### check_contacts\n\nCheck if phone numbers have WhatsApp.\n\n```json\n{\n \"operation\": \"check_contacts\",\n \"phones\": \"1234567890,0987654321\"\n}\n```\n\n**Response:**\n```json\n{\n \"success\": true,\n \"operation\": \"check_contacts\",\n \"results\": [\n {\"phone\": \"1234567890\", \"registered\": true, \"jid\": \"[email protected]\"},\n {\"phone\": \"0987654321\", \"registered\": false}\n ]\n}\n```\n\n## Common Workflows\n\n### Find and message someone by name\n\n1. Use `list_contacts` with query to find the person\n2. Get their phone number from the result\n3. Use `whatsapp_send` tool with the phone number\n\n### Get recent messages from a contact\n\n1. Use `chat_history` with chat_type=\"individual\"\n2. Set appropriate limit for desired history depth\n\n### Find and message a group\n\n1. Use `search_groups` to find the group by name\n2. Get the group_id from the result\n3. Use `whatsapp_send` tool with recipient_type=\"group\"\n\n### See who's in a group\n\n1. Use `get_group_info` with the group_id\n2. Set participant_limit to control output size\n\n## Guidelines\n\n1. **Phone numbers**: Always use without + prefix, just digits\n2. **Group IDs**: JID format ending in `@g.us`\n3. **Limits**: Use small limits to avoid context overflow\n4. **Queries**: Be specific to narrow results\n5. **Pagination**: Use offset to page through chat_history\n\n## Error Responses\n\n```json\n{\n \"error\": \"Phone number is required for chat_type='individual'\"\n}\n```\n\n```json\n{\n \"error\": \"group_id is required for get_group_info\"\n}\n```\n\n## Setup Requirements\n\n1. Connect the **WhatsApp DB** node to Zeenie's `input-tools` handle\n2. Ensure WhatsApp is connected (green status indicator in Credentials)\n",
"isCustomized": false
},
@@ -491,32 +623,121 @@
"enabled": true,
"instructions": "# Brave Search Skill\n\nSearch the web using the Brave Search API. Brave Search is a privacy-focused, independent search engine that does not track users or profile them.\n\n## How It Works\n\nThis skill provides instructions and context. To execute searches, connect the **Brave Search** node to the agent's `input-tools` handle.\n\n## brave_search Tool\n\nSearch the web and get relevant results from Brave's independent index.\n\n### Schema Fields\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| query | string | Yes | Search query to look up on the web |\n\n### Node Parameters\n\nAdditional options configured on the node:\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| maxResults | 10 | Number of results to return (max 100) |\n| country | (empty) | Country code for regional results (e.g., US, GB, DE) |\n| searchLang | (empty) | Language code for search results (e.g., en, es, fr) |\n| safeSearch | moderate | Safe search filtering: off, moderate, strict |\n\n### Response Format\n\n```json\n{\n \"query\": \"artificial intelligence news\",\n \"results\": [\n {\n \"title\": \"AI Breakthrough in Medical Research\",\n \"snippet\": \"Researchers have developed a new AI model that can predict...\",\n \"url\": \"https://example.com/ai-medical-research\"\n }\n ],\n \"result_count\": 10,\n \"provider\": \"brave_search\"\n}\n```\n\n### Examples\n\n**General search:**\n```json\n{\n \"query\": \"latest news about artificial intelligence\"\n}\n```\n\n**Technical search:**\n```json\n{\n \"query\": \"Python asyncio best practices 2026\"\n}\n```\n\n**Local search:**\n```json\n{\n \"query\": \"best restaurants in San Francisco\"\n}\n```\n\n## When to Use Brave Search\n\n- **Privacy-focused results** - No user tracking or profiling\n- **Independent index** - Not reliant on Google or Bing\n- **General web search** - News, facts, documentation, products\n- **Regional results** - Use country/language parameters for localized results\n\n## When NOT to Use Brave Search\n\n- **AI-powered answers** - Use Perplexity instead for synthesized answers with citations\n- **Google-specific results** - Use Serper for Google's index\n- **Simple calculations** - Use the calculator tool\n- **Creative tasks** - Writing, brainstorming, analysis\n\n## Search Query Best Practices\n\n- Use specific, focused queries (under 10 words when possible)\n- Include relevant keywords, dates, and context\n- Break complex questions into simpler searches\n- Avoid filler words like \"please\" or \"can you tell me\"\n\n## API Details\n\n- **API**: GET `https://api.search.brave.com/res/v1/web/search`\n- **Auth**: `X-Subscription-Token` header\n- **Rate Limits**: Depends on plan (Free: 1 query/sec, 2000/month)\n- **Pricing**: ~$0.003 per query\n\n## Setup Requirements\n\n1. Connect this skill to the agent's `input-skill` handle\n2. Connect the **Brave Search** node to the agent's `input-tools` handle\n3. Add your Brave Search API key in Credentials > Search\n",
"isCustomized": false
+ },
+ "proxy-config-skill": {
+ "enabled": true,
+ "instructions": "# Proxy Configuration Skill\n\nYou manage residential proxy providers. Providers are configured with a JSON `url_template` that controls how geo/session parameters are encoded into the proxy URL.\n\n## Setup Workflow\n\nTo add a new proxy provider, make these tool calls in order:\n\n### Step 1: Add the provider\n\nCall `proxy_config` with `operation: \"add_provider\"`. The `url_template` field is a **JSON string**.\n\nMost residential proxy providers use username-based parameter encoding with dash separators. Use this default template unless the provider docs show otherwise:\n\n```\nproxy_config({\n \"operation\": \"add_provider\",\n \"name\": \"smartproxy\",\n \"gateway_host\": \"gate.smartproxy.com\",\n \"gateway_port\": 7777,\n \"url_template\": \"{\\\"param_field\\\":\\\"username\\\",\\\"username_prefix\\\":\\\"{username}\\\",\\\"username_param_separator\\\":\\\"-\\\",\\\"param_separator\\\":\\\"-\\\",\\\"param_keys\\\":{\\\"country\\\":\\\"country-{v}\\\",\\\"city\\\":\\\"city-{v}\\\",\\\"state\\\":\\\"state-{v}\\\",\\\"session_id\\\":\\\"session-{v}\\\",\\\"session_duration\\\":\\\"sessTime-{v}\\\"},\\\"country_case\\\":\\\"lower\\\",\\\"city_separator\\\":\\\"_\\\"}\"\n})\n```\n\n### Step 2: Set credentials\n\n```\nproxy_config({\n \"operation\": \"set_credentials\",\n \"name\": \"smartproxy\",\n \"username\": \"the_username\",\n \"password\": \"the_password\"\n})\n```\n\n### Step 3: Test\n\n```\nproxy_config({\n \"operation\": \"test_provider\",\n \"name\": \"smartproxy\"\n})\n```\n\nIf test returns `\"success\": true`, the provider is ready. If it fails, check credentials and gateway host/port.\n\n## Making Proxied Requests\n\nOnce a provider is configured:\n\n```\nproxy_request({\n \"url\": \"https://example.com/page\",\n \"proxyCountry\": \"US\"\n})\n```\n\nThe system auto-selects the best healthy provider. To force a specific one:\n\n```\nproxy_request({\n \"url\": \"https://example.com/page\",\n \"proxyProvider\": \"smartproxy\",\n \"proxyCountry\": \"US\",\n \"sessionType\": \"sticky\"\n})\n```\n\n## url_template Reference\n\nThe `url_template` JSON controls how the system builds the proxy URL. It determines how username/password strings are constructed with geo and session parameters.\n\n**Fields:**\n- `param_field`: Where params go. `\"username\"` (80% of providers), `\"password\"`, or `\"none\"`.\n- `username_prefix`: Template for username base. `{username}` is replaced with actual username.\n- `username_param_separator`: Separator between username and first param (e.g. `\"-\"`).\n- `param_separator`: Separator between params (e.g. `\"-\"`).\n- `param_keys`: Object mapping param names to format strings. `{v}` is replaced with the value.\n - `country`: e.g. `\"country-{v}\"` produces `country-us`\n - `city`: e.g. `\"city-{v}\"` produces `city-new_york`\n - `state`: e.g. `\"state-{v}\"` produces `state-california`\n - `session_id`: e.g. `\"session-{v}\"` produces `session-abc123`\n - `session_duration`: e.g. `\"sessTime-{v}\"` produces `sessTime-10`\n- `country_case`: `\"lower\"` or `\"upper\"` for country codes.\n- `city_separator`: Replaces spaces in city/state names (e.g. `\"_\"` makes `new_york`).\n\n**Result for username encoding with country US:**\n`http://myuser-country-us:[email protected]:7777`\n\n**Result for password encoding with country US:**\n`http://myuser:[email protected]:7777`\n\n## Common Provider Templates\n\n### DataImpulse (username-based, dash separator)\nGateway: `gw.dataimpulse.com:823`\n```json\n{\"param_field\":\"username\",\"username_prefix\":\"{username}\",\"username_param_separator\":\"__\",\"param_separator\":\"__\",\"param_keys\":{\"country\":\"country-{v}\",\"city\":\"city-{v}\",\"session_id\":\"session-{v}\",\"session_duration\":\"sessionduration-{v}\"},\"country_case\":\"lower\",\"city_separator\":\"_\"}\n```\n\n### Decodo/Smartproxy (username-based, dash separator)\nGateway: `gate.smartproxy.com:7777`\n```json\n{\"param_field\":\"username\",\"username_prefix\":\"{username}\",\"username_param_separator\":\"-\",\"param_separator\":\"-\",\"param_keys\":{\"country\":\"country-{v}\",\"city\":\"city-{v}\",\"state\":\"state-{v}\",\"session_id\":\"session-{v}\",\"session_duration\":\"sessTime-{v}\"},\"country_case\":\"lower\",\"city_separator\":\"_\"}\n```\n\n### Bright Data (username-based, dash separator)\nGateway: `brd.superproxy.io:22225`\n```json\n{\"param_field\":\"username\",\"username_prefix\":\"{username}\",\"username_param_separator\":\"-\",\"param_separator\":\"-\",\"param_keys\":{\"country\":\"country-{v}\",\"city\":\"city-{v}\",\"state\":\"state-{v}\",\"session_id\":\"session-{v}\"},\"country_case\":\"lower\",\"city_separator\":\"_\"}\n```\n\n### IPRoyal (password-based)\nGateway: `geo.iproyal.com:12321`\n```json\n{\"param_field\":\"password\",\"username_prefix\":\"{username}\",\"param_separator\":\"_\",\"param_keys\":{\"country\":\"country-{v}\",\"city\":\"city-{v}\",\"session_id\":\"session-{v}\",\"session_duration\":\"sessionduration-{v}\"},\"country_case\":\"lower\",\"city_separator\":\"_\"}\n```\n\n### Custom/Generic (no encoding)\nFor providers that don't encode params in credentials:\n```json\n{\"param_field\":\"none\"}\n```\n\n## If Provider Uses Unfamiliar Format\n\nUse `python_code` to reverse-engineer the template from the provider's example URL:\n\n```python\nimport json\n\n# Example from provider docs:\n# Username: user123-cc-US-city-NewYork-sess-abc123\n# Password: pass456\n# Host: proxy.example.com:8080\n\ntemplate = {\n \"param_field\": \"username\",\n \"username_prefix\": \"{username}\",\n \"username_param_separator\": \"-\",\n \"param_separator\": \"-\",\n \"param_keys\": {\n \"country\": \"cc-{v}\",\n \"city\": \"city-{v}\",\n \"session_id\": \"sess-{v}\"\n },\n \"country_case\": \"upper\",\n \"city_separator\": \"\"\n}\n\n# Verify it produces the right URL\nusername = \"user123\"\nparams = []\nparams.append(template[\"param_keys\"][\"country\"].replace(\"{v}\", \"US\"))\nparams.append(template[\"param_keys\"][\"city\"].replace(\"{v}\", \"NewYork\"))\nparams.append(template[\"param_keys\"][\"session_id\"].replace(\"{v}\", \"abc123\"))\nparam_str = template[\"param_separator\"].join(params)\nresult = f\"{username}{template['username_param_separator']}{param_str}\"\nprint(f\"Built username: {result}\")\nassert result == \"user123-cc-US-city-NewYork-sess-abc123\", f\"Mismatch: {result}\"\n\noutput = json.dumps(template)\nprint(f\"Template: {output}\")\n```\n\nThen pass the `output` as the `url_template` string to `proxy_config(add_provider)`.\n\n## All proxy_config Operations\n\n| Operation | Required Parameters | Description |\n|-----------|-------------------|-------------|\n| `list_providers` | none | List all configured providers |\n| `add_provider` | `name`, `gateway_host`, `gateway_port`, `url_template` | Add a new provider |\n| `update_provider` | `name` + any fields to change | Update existing provider |\n| `remove_provider` | `name` | Delete a provider |\n| `set_credentials` | `name`, `username`, `password` | Store proxy credentials |\n| `test_provider` | `name` | Test via httpbin.org/ip |\n| `get_stats` | none | Usage statistics |\n| `add_routing_rule` | `domain_pattern` | Route domains to specific providers |\n| `list_routing_rules` | none | List all routing rules |\n| `remove_routing_rule` | `rule_id` | Delete a routing rule |\n\nOptional fields for `add_provider`/`update_provider`: `enabled` (bool), `priority` (int, lower=preferred), `cost_per_gb` (float).\n\n## proxy_request Parameters\n\n| Parameter | Required | Default | Description |\n|-----------|----------|---------|-------------|\n| `url` | yes | | Target URL |\n| `method` | no | GET | HTTP method |\n| `headers` | no | | JSON string of headers |\n| `body` | no | | Request body string |\n| `proxyProvider` | no | auto | Provider name |\n| `proxyCountry` | no | | ISO country code (US, GB, DE) |\n| `sessionType` | no | rotating | `rotating` or `sticky` |\n| `timeout` | no | 30 | Seconds |\n| `maxRetries` | no | 3 | Retry with failover |\n\n## Transparent Proxy on HTTP Nodes\n\nThe `httpRequest` and `httpScraper` nodes have built-in proxy support. Set `useProxy: true` and the proxy service handles everything -- provider selection, geo-targeting, and session type are all managed from the proxy service configuration (provider priorities, routing rules, default country).\n\nWhen the AI Agent uses `http_request` as a tool, it can set `useProxy: true` in the tool arguments. No other proxy fields needed.\n\n**When to use which:**\n- Use **http_request with useProxy: true** for proxied requests (simple, proxy service handles routing)\n- Use **proxy_request** tool only when you need explicit control over retries and failover\n\n## Notes\n\n- Always run `test_provider` after setting up a new provider\n- If the user does not know their credentials, they need to get them from their proxy provider dashboard\n- If test fails: check credentials, gateway host/port, and that the url_template matches the provider's format\n- Use `proxy_status` to check provider health before making requests\n- `sessionType: \"sticky\"` keeps the same IP across requests (good for scraping sessions)\n- `sessionType: \"rotating\"` gets a new IP each request (good for anonymity)\n",
+ "isCustomized": false
+ },
+ "twitter-send-skill": {
+ "enabled": true,
+ "instructions": "# Twitter Send Tool\n\nPost and interact with tweets on Twitter/X.\n\n## How It Works\n\nThis skill provides instructions for the **Twitter Send** tool node. Connect the **Twitter Send** node to an AI Agent's `input-tools` handle to enable posting and interactions.\n\n## twitter_send Tool\n\nSend tweets, replies, retweets, likes, and deletions.\n\n### Schema Fields\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| action | string | Yes | Action type: `tweet`, `reply`, `retweet`, `like`, `unlike`, `delete` |\n| text | string | If tweet/reply | Tweet text content (max 280 characters) |\n| tweet_id | string | If retweet/like/unlike/delete | Target tweet ID |\n| reply_to_id | string | If reply | Tweet ID to reply to |\n\n### Actions\n\n| Action | Required Fields | Description |\n|--------|-----------------|-------------|\n| `tweet` | text | Post a new tweet |\n| `reply` | text, reply_to_id | Reply to an existing tweet |\n| `retweet` | tweet_id | Retweet an existing tweet |\n| `like` | tweet_id | Like a tweet |\n| `unlike` | tweet_id | Remove like from a tweet |\n| `delete` | tweet_id | Delete your own tweet |\n\n### Examples\n\n**Post a tweet:**\n```json\n{\n \"action\": \"tweet\",\n \"text\": \"Hello Twitter! This is my first automated tweet.\"\n}\n```\n\n**Reply to a tweet:**\n```json\n{\n \"action\": \"reply\",\n \"text\": \"Thanks for sharing this!\",\n \"reply_to_id\": \"1234567890123456789\"\n}\n```\n\n**Retweet:**\n```json\n{\n \"action\": \"retweet\",\n \"tweet_id\": \"1234567890123456789\"\n}\n```\n\n**Like a tweet:**\n```json\n{\n \"action\": \"like\",\n \"tweet_id\": \"1234567890123456789\"\n}\n```\n\n**Unlike a tweet:**\n```json\n{\n \"action\": \"unlike\",\n \"tweet_id\": \"1234567890123456789\"\n}\n```\n\n**Delete a tweet:**\n```json\n{\n \"action\": \"delete\",\n \"tweet_id\": \"1234567890123456789\"\n}\n```\n\n### Response Format\n\n```json\n{\n \"success\": true,\n \"result\": {\n \"data\": {\n \"id\": \"1234567890123456789\",\n \"text\": \"Hello Twitter!\"\n },\n \"action\": \"tweet_sent\"\n },\n \"execution_time\": 0.45\n}\n```\n\n### Error Response\n\n```json\n{\n \"success\": false,\n \"error\": \"Tweet text is required\",\n \"execution_time\": 0.01\n}\n```\n\n## Guidelines\n\n1. **Character limit**: Tweets are limited to 280 characters\n2. **Tweet IDs**: Use the numeric ID string (e.g., `1234567890123456789`)\n3. **Rate limits**: X API has rate limits - avoid rapid posting\n4. **Content policy**: Follow X's content policies and terms of service\n5. **Threading**: Use reply action with reply_to_id to create threads\n\n## Common Use Cases\n\n- Post automated updates and announcements\n- Reply to mentions or specific tweets\n- Like tweets matching certain criteria\n- Create tweet threads by chaining replies\n- Engage with followers programmatically\n\n## Setup Requirements\n\n1. Connect the **Twitter Send** node to an AI Agent's `input-tools` handle\n2. Ensure Twitter is connected (authenticated via OAuth in Credentials Modal)\n3. Your X Developer account must have appropriate API access level\n",
+ "isCustomized": false
+ },
+ "gmail-skill": {
+ "enabled": true,
+ "instructions": "# Gmail Skill\n\nSend, search, and read emails using Gmail API.\n\n## Tool: google_gmail\n\nConsolidated Gmail tool with `operation` parameter.\n\n### Operations\n\n| Operation | Description | Required Fields |\n|-----------|-------------|-----------------|\n| `send` | Send an email | to, subject, body |\n| `search` | Search emails by query | query |\n| `read` | Read email by ID | message_id |\n\n### send - Send an email\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"send\"` |\n| to | string | Yes | Recipient email address |\n| subject | string | Yes | Email subject line |\n| body | string | Yes | Email body (plain text or HTML) |\n| cc | string | No | CC recipients (comma-separated) |\n| bcc | string | No | BCC recipients (comma-separated) |\n| body_type | string | No | `\"text\"` or `\"html\"` (default: text) |\n\n**Example - Send plain text email:**\n```json\n{\n \"operation\": \"send\",\n \"to\": \"[email protected]\",\n \"subject\": \"Meeting Tomorrow\",\n \"body\": \"Hi,\\n\\nJust a reminder about our meeting tomorrow at 2pm.\\n\\nBest regards\"\n}\n```\n\n**Example - Send HTML email:**\n```json\n{\n \"operation\": \"send\",\n \"to\": \"[email protected]\",\n \"subject\": \"Weekly Report\",\n \"body\": \"<h1>Weekly Report</h1><p>Here are the highlights...</p>\",\n \"body_type\": \"html\"\n}\n```\n\n### search - Search emails\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"search\"` |\n| query | string | Yes | Gmail search query |\n| max_results | integer | No | Maximum results (default: 10, max: 100) |\n| include_body | boolean | No | Fetch full message body (default: false) |\n\n**Query Syntax Examples:**\n- `from:[email protected]` - Emails from specific sender\n- `to:[email protected]` - Emails to specific recipient\n- `subject:meeting` - Emails with \"meeting\" in subject\n- `has:attachment` - Emails with attachments\n- `is:unread` - Unread emails\n- `after:2024/01/01` - Emails after date\n- `before:2024/12/31` - Emails before date\n- `label:important` - Emails with label\n- `\"exact phrase\"` - Exact phrase match\n- `from:[email protected] is:unread` - Combine multiple filters\n\n**Example:**\n```json\n{\n \"operation\": \"search\",\n \"query\": \"from:[email protected] has:attachment after:2024/01/01\",\n \"max_results\": 20\n}\n```\n\n### read - Read email content\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"read\"` |\n| message_id | string | Yes | Gmail message ID from search results |\n| format | string | No | `\"full\"`, `\"minimal\"`, `\"raw\"`, `\"metadata\"` (default: full) |\n\n**Example:**\n```json\n{\n \"operation\": \"read\",\n \"message_id\": \"abc123\"\n}\n```\n\n## Common Workflows\n\n1. **Check unread emails**: Search with `is:unread`, then read important ones\n2. **Find emails from someone**: Search with `from:[email protected]`\n3. **Reply to email**: Read the email first, then send with same subject prefixed with \"Re:\"\n4. **Forward email**: Read email, send to new recipient with \"Fwd:\" prefix\n\n## Setup Requirements\n\n1. Connect Gmail node to AI Agent's `input-tools` handle\n2. Authenticate with Google Workspace in Credentials Modal\n3. Ensure Gmail API scopes are authorized\n",
+ "isCustomized": false
+ },
+ "sheets-skill": {
+ "enabled": true,
+ "instructions": "# Google Sheets Skill\n\nRead and write data to Google Sheets spreadsheets.\n\n## Tool: google_sheets\n\nConsolidated Google Sheets tool with `operation` parameter.\n\n### Operations\n\n| Operation | Description | Required Fields |\n|-----------|-------------|-----------------|\n| `read` | Read data from a range | spreadsheet_id, range |\n| `write` | Write data to a range | spreadsheet_id, range, values |\n| `append` | Append rows to a table | spreadsheet_id, range, values |\n\n### read - Read spreadsheet data\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"read\"` |\n| spreadsheet_id | string | Yes | Spreadsheet ID from URL |\n| range | string | Yes | A1 notation range (e.g., \"Sheet1!A1:D10\") |\n\n**How to find Spreadsheet ID:**\nFrom URL: `https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit`\n\n**Range Notation (A1):**\n- `Sheet1!A1:D10` - Specific range on Sheet1\n- `Sheet1!A:D` - Entire columns A through D\n- `Sheet1!1:10` - Rows 1 through 10\n- `A1:D10` - Default sheet, specific range\n- `Sheet1` - Entire sheet\n\n**Example:**\n```json\n{\n \"operation\": \"read\",\n \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\",\n \"range\": \"Sheet1!A1:E10\"\n}\n```\n\n### write - Write data to a range\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"write\"` |\n| spreadsheet_id | string | Yes | Spreadsheet ID |\n| range | string | Yes | A1 notation range |\n| values | array | Yes | 2D array of values |\n| value_input_option | string | No | `\"USER_ENTERED\"` or `\"RAW\"` (default: USER_ENTERED) |\n\n**Example - Write data:**\n```json\n{\n \"operation\": \"write\",\n \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\",\n \"range\": \"Sheet1!A1:C3\",\n \"values\": [\n [\"Name\", \"Score\", \"Grade\"],\n [\"Alice\", 95, \"A\"],\n [\"Bob\", 87, \"B\"]\n ]\n}\n```\n\n**Example - Write formula:**\n```json\n{\n \"operation\": \"write\",\n \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\",\n \"range\": \"Sheet1!D2\",\n \"values\": [[\"=SUM(B2:C2)\"]],\n \"value_input_option\": \"USER_ENTERED\"\n}\n```\n\n### append - Append rows to a table\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| operation | string | Yes | Must be `\"append\"` |\n| spreadsheet_id | string | Yes | Spreadsheet ID |\n| range | string | Yes | Table range (e.g., \"Sheet1!A:E\") |\n| values | array | Yes | 2D array of rows to append |\n| value_input_option | string | No | `\"USER_ENTERED\"` or `\"RAW\"` (default: USER_ENTERED) |\n| insert_data_option | string | No | `\"INSERT_ROWS\"` or `\"OVERWRITE\"` (default: INSERT_ROWS) |\n\n**Example:**\n```json\n{\n \"operation\": \"append\",\n \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\",\n \"range\": \"Sheet1!A:E\",\n \"values\": [\n [\"Charlie\", \"[email protected]\", \"Sales\", \"2024-02-01\", \"Active\"],\n [\"Diana\", \"[email protected]\", \"HR\", \"2024-02-15\", \"Active\"]\n ]\n}\n```\n\n## Common Formulas\n\n| Formula | Description |\n|---------|-------------|\n| `=SUM(A1:A10)` | Sum of range |\n| `=AVERAGE(B1:B10)` | Average of range |\n| `=COUNT(A:A)` | Count numbers in column |\n| `=COUNTA(A:A)` | Count non-empty cells |\n| `=VLOOKUP(E1,A:C,2,FALSE)` | Vertical lookup |\n| `=IF(A1>90,\"A\",\"B\")` | Conditional logic |\n| `=TODAY()` | Current date |\n| `=NOW()` | Current date and time |\n\n## Common Workflows\n\n1. **Import data**: Write headers, then append data rows\n2. **Update records**: Read to find row, write to specific cells\n3. **Generate reports**: Read data, process, write summary\n4. **Log entries**: Append new rows with timestamps\n\n## Tips\n\n- Always check spreadsheet exists before writing\n- Use `USER_ENTERED` for formulas to work\n- Range must match data dimensions\n- Append is safer than write for adding data\n\n## Setup Requirements\n\n1. Connect Sheets node to AI Agent's `input-tools` handle\n2. Authenticate with Google Workspace in Credentials Modal\n3. Ensure Sheets API scopes are authorized\n4. Spreadsheet must be accessible to authenticated account\n",
+ "isCustomized": false
}
}
},
- "whatsappSend-1771936846253": {
+ "simpleMemory-1770207943830": {
+ "sessionId": "",
+ "windowSize": 100,
+ "longTermEnabled": false,
+ "retrievalCount": 3
+ },
+ "telegramSend-1772705307135": {
"recipient_type": "self",
- "phone": "",
- "group_id": "",
+ "chat_id": "",
"message_type": "text",
- "message": "{{zeenie.response}}",
- "media_source": "base64",
- "media_data": "",
- "file_path": "",
+ "text": "{{zeenie.response}}",
"media_url": "",
- "mime_type": "",
"caption": "",
- "filename": "",
"latitude": 0,
"longitude": 0,
- "location_name": "",
+ "phone_number": "",
+ "first_name": "",
+ "last_name": "",
+ "parse_mode": "",
+ "silent": false,
+ "reply_to_message_id": 0,
+ "label": "Telegram Send"
+ },
+ "telegramReceive-1772705308277": {
+ "contentTypeFilter": "text",
+ "senderFilter": "self",
+ "chat_id": "",
+ "from_user": "",
+ "keywords": "",
+ "ignoreBots": true,
+ "label": "Telegram Receive"
+ },
+ "gmaps_locations-1772705500946": {
+ "service_type": "geocode",
"address": "",
- "contact_name": "",
- "vcard": "",
- "is_reply": false,
- "reply_message_id": "",
- "reply_sender": "",
- "reply_content": ""
+ "lat": 37.4224,
+ "lng": -122.0842,
+ "label": "GMaps Locations"
+ },
+ "gmaps_nearby_places-1772705502591": {
+ "lat": 40.7484,
+ "lng": -73.9857,
+ "radius": 500,
+ "type": "restaurant",
+ "label": "GMaps Nearby Places"
+ },
+ "twitterSearch-1772705512370": {
+ "query": "",
+ "max_results": 10,
+ "sort_order": "recency",
+ "start_time": "",
+ "end_time": "",
+ "include_metrics": true,
+ "include_author": true,
+ "label": "Twitter Search"
+ },
+ "twitterUser-1772705513349": {
+ "operation": "me",
+ "username": "",
+ "user_id": "",
+ "max_results": 100,
+ "label": "Twitter User"
+ },
+ "gmail-1772705536587": {
+ "operation": "send",
+ "account_mode": "owner",
+ "customer_id": "",
+ "to": "",
+ "cc": "",
+ "bcc": "",
+ "subject": "",
+ "body_type": "text",
+ "body": "",
+ "query": "",
+ "max_results": 10,
+ "include_body": false,
+ "message_id": "",
+ "format": "full",
+ "label": "Gmail"
+ },
+ "sheets-1772705541286": {
+ "operation": "read",
+ "account_mode": "owner",
+ "customer_id": "",
+ "spreadsheet_id": "",
+ "range": "",
+ "value_render_option": "FORMATTED_VALUE",
+ "major_dimension": "ROWS",
+ "values": "",
+ "value_input_option": "USER_ENTERED",
+ "insert_data_option": "INSERT_ROWS",
+ "label": "Sheets"
}
}
}
\ No newline at end of file
diff --git a/workflows/Zeenie Assistant.json b/workflows/Zeenie Assistant.json
index ed63c516..f642aa5a 100644
--- a/workflows/Zeenie Assistant.json
+++ b/workflows/Zeenie Assistant.json
@@ -1,5 +1,5 @@
{
- "id": "example_workflow-1772151325023-i7zkjbt04",
+ "id": "example_example_workflow-1772151325023-i7zkjbt04",
"name": "Zeenie Assistant",
"nodes": [
{
@@ -102,7 +102,7 @@
"type": "chatAgent",
"position": {
"x": 2360,
- "y": -100
+ "y": -120
},
"data": {
"label": "Zeenie"
@@ -112,7 +112,7 @@
"selected": false,
"positionAbsolute": {
"x": 2360,
- "y": -100
+ "y": -120
},
"dragging": false
},
@@ -291,8 +291,8 @@
"id": "console-1770195247780",
"type": "console",
"position": {
- "x": 3300,
- "y": 40
+ "x": 3080,
+ "y": 100
},
"data": {
"label": "Console 1"
@@ -301,8 +301,8 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 3300,
- "y": 40
+ "x": 3080,
+ "y": 100
},
"dragging": false
},
@@ -405,7 +405,7 @@
"id": "taskManager-1770801430177",
"type": "taskManager",
"position": {
- "x": 2720,
+ "x": 2700,
"y": 140
},
"data": {
@@ -415,7 +415,7 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 2720,
+ "x": 2700,
"y": 140
},
"dragging": true
@@ -481,7 +481,7 @@
"id": "simpleMemory-1770973783506",
"type": "simpleMemory",
"position": {
- "x": 2880,
+ "x": 2900,
"y": 540
},
"data": {
@@ -491,16 +491,16 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 2880,
+ "x": 2900,
"y": 540
},
- "dragging": false
+ "dragging": true
},
{
"id": "simpleMemory-1770973798020",
"type": "simpleMemory",
"position": {
- "x": 3320,
+ "x": 3340,
"y": 540
},
"data": {
@@ -510,10 +510,10 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 3320,
+ "x": 3340,
"y": 540
},
- "dragging": true
+ "dragging": false
},
{
"id": "productivity_agent-1771834433838",
@@ -534,44 +534,6 @@
},
"dragging": false
},
- {
- "id": "whatsappSend-1771834542643",
- "type": "whatsappSend",
- "position": {
- "x": 3120,
- "y": -80
- },
- "data": {
- "label": "WhatsApp Send"
- },
- "width": 87,
- "height": 82,
- "selected": false,
- "positionAbsolute": {
- "x": 3120,
- "y": -80
- },
- "dragging": false
- },
- {
- "id": "whatsappReceive-1771834543772",
- "type": "whatsappReceive",
- "position": {
- "x": 1660,
- "y": -60
- },
- "data": {
- "label": "WhatsApp Receive"
- },
- "width": 101,
- "height": 82,
- "selected": false,
- "positionAbsolute": {
- "x": 1660,
- "y": -60
- },
- "dragging": false
- },
{
"id": "twitterSearch-1771834599628",
"type": "twitterSearch",
@@ -747,8 +709,8 @@
"id": "telegramSend-1772074741486",
"type": "telegramSend",
"position": {
- "x": 3440,
- "y": 120
+ "x": 3080,
+ "y": -20
},
"data": {
"label": "Telegram Send"
@@ -757,27 +719,8 @@
"height": 82,
"selected": false,
"positionAbsolute": {
- "x": 3440,
- "y": 120
- },
- "dragging": true
- },
- {
- "id": "telegramReceive-1772074742881",
- "type": "telegramReceive",
- "position": {
- "x": 1800,
- "y": -160
- },
- "data": {
- "label": "Telegram Receive"
- },
- "width": 94,
- "height": 82,
- "selected": false,
- "positionAbsolute": {
- "x": 1800,
- "y": -160
+ "x": 3080,
+ "y": -20
},
"dragging": false
},
@@ -837,6 +780,25 @@
"y": 720
},
"dragging": false
+ },
+ {
+ "id": "telegramReceive-1772725517789",
+ "type": "telegramReceive",
+ "position": {
+ "x": 1620,
+ "y": -80
+ },
+ "data": {
+ "label": "Telegram Receive"
+ },
+ "width": 94,
+ "height": 82,
+ "selected": false,
+ "positionAbsolute": {
+ "x": 1620,
+ "y": -80
+ },
+ "dragging": false
}
],
"edges": [
@@ -1246,20 +1208,6 @@
"id": "reactflow__edge-twitterUser-1771834600973output-tool-social_agent-1770213991252input-tools",
"selected": false
},
- {
- "type": "smoothstep",
- "animated": true,
- "style": {
- "stroke": "#8be9fd",
- "strokeWidth": 3
- },
- "source": "whatsappReceive-1771834543772",
- "sourceHandle": "output-main",
- "target": "chatAgent-1770060581808",
- "targetHandle": "input-main",
- "id": "reactflow__edge-whatsappReceive-1771834543772output-main-chatAgent-1770060581808input-main",
- "selected": false
- },
{
"type": "smoothstep",
"animated": true,
@@ -1274,20 +1222,6 @@
"id": "reactflow__edge-simpleMemory-1771834793747output-memory-productivity_agent-1771834433838input-memory",
"selected": false
},
- {
- "type": "smoothstep",
- "animated": true,
- "style": {
- "stroke": "#8be9fd",
- "strokeWidth": 3
- },
- "source": "chatAgent-1770060581808",
- "sourceHandle": "output-main",
- "target": "whatsappSend-1771834542643",
- "targetHandle": "input-main",
- "id": "reactflow__edge-chatAgent-1770060581808output-main-whatsappSend-1771834542643input-main",
- "selected": false
- },
{
"type": "smoothstep",
"animated": true,
@@ -1372,20 +1306,6 @@
"id": "reactflow__edge-gmail-1772074604463output-tool-productivity_agent-1771834433838input-tools",
"selected": false
},
- {
- "type": "smoothstep",
- "animated": true,
- "style": {
- "stroke": "#8be9fd",
- "strokeWidth": 3
- },
- "source": "telegramReceive-1772074742881",
- "sourceHandle": "output-main",
- "target": "chatAgent-1770060581808",
- "targetHandle": "input-main",
- "id": "reactflow__edge-telegramReceive-1772074742881output-main-chatAgent-1770060581808input-main",
- "selected": false
- },
{
"type": "smoothstep",
"animated": true,
@@ -1427,16 +1347,43 @@
"targetHandle": "input-tools",
"id": "reactflow__edge-typescriptExecutor-1772075756858output-tool-coding_agent-1770070861999input-tools",
"selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "chatAgent-1770060581808",
+ "sourceHandle": "output-main",
+ "target": "telegramSend-1772074741486",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-chatAgent-1770060581808output-main-telegramSend-1772074741486input-main",
+ "selected": false
+ },
+ {
+ "type": "smoothstep",
+ "animated": true,
+ "style": {
+ "stroke": "#8be9fd",
+ "strokeWidth": 3
+ },
+ "source": "telegramReceive-1772725517789",
+ "sourceHandle": "output-main",
+ "target": "chatAgent-1770060581808",
+ "targetHandle": "input-main",
+ "id": "reactflow__edge-telegramReceive-1772725517789output-main-chatAgent-1770060581808input-main"
}
],
- "createdAt": "2026-02-26T22:56:32.660Z",
- "lastModified": "2026-02-27T05:07:52.625Z",
- "version": "0.0.37",
+ "createdAt": "2026-03-05T04:32:30.931Z",
+ "lastModified": "2026-03-05T10:16:02.000Z",
+ "version": "0.0.42",
"nodeParameters": {
"chatAgent-1770060581808": {
"provider": "gemini",
"model": "gemini-3.1-pro-preview",
- "prompt": "{{chattrigger.message}} {{whatsappreceive.text}}",
+ "prompt": "{{chattrigger.message}} {{telegramreceive.text}}",
"systemMessage": "You are a helpful assistant."
},
"coding_agent-1770070861999": {
@@ -1748,41 +1695,6 @@
"prompt": "{{ $json.chatInput }}",
"systemMessage": "You are a helpful assistant"
},
- "whatsappSend-1771834542643": {
- "recipient_type": "self",
- "phone": "",
- "group_id": "",
- "message_type": "text",
- "message": "{{zeenie.response}}",
- "media_source": "base64",
- "media_data": "",
- "file_path": "",
- "media_url": "",
- "mime_type": "",
- "caption": "",
- "filename": "",
- "latitude": 0,
- "longitude": 0,
- "location_name": "",
- "address": "",
- "contact_name": "",
- "vcard": "",
- "is_reply": false,
- "reply_message_id": "",
- "reply_sender": "",
- "reply_content": ""
- },
- "whatsappReceive-1771834543772": {
- "messageTypeFilter": "text",
- "filter": "self",
- "contactPhone": "",
- "group_id": "",
- "senderNumber": "",
- "keywords": "",
- "ignoreOwnMessages": true,
- "forwardedFilter": "all",
- "includeMediaData": false
- },
"gmail-1772074604463": {
"operation": "send",
"account_mode": "owner",
@@ -1906,9 +1818,10 @@
"label": "Contacts"
},
"telegramSend-1772074741486": {
+ "recipient_type": "self",
"chat_id": "",
"message_type": "text",
- "text": "",
+ "text": "{{zeenie.response}}",
"media_url": "",
"caption": "",
"latitude": 0,
@@ -1921,15 +1834,6 @@
"reply_to_message_id": 0,
"label": "Telegram Send"
},
- "telegramReceive-1772074742881": {
- "chatTypeFilter": "all",
- "contentTypeFilter": "all",
- "chat_id": "",
- "from_user": "",
- "keywords": "",
- "ignoreBots": true,
- "label": "Telegram Receive"
- },
"perplexitySearch-1772075707557": {
"toolName": "perplexity_search",
"toolDescription": "Search the web using Perplexity Sonar AI. Returns an AI-generated answer with citations and source URLs.",
@@ -1953,6 +1857,15 @@
"typescriptExecutor-1772075756858": {
"code": "// TypeScript Executor - Transform and process data with type safety\n//\n// Available:\n// input_data - object with connected node outputs\n// console.log() - for debugging\n//\n// Set the \"output\" variable with your result\n\ninterface Result {\n message: string;\n input_received: unknown;\n processed: boolean;\n}\n\n// Example: Get data from connected node\nconst data = input_data?.start || input_data || {};\n\n// Process data with type safety\nconst result: Result = {\n message: \"Hello from TypeScript!\",\n input_received: data,\n processed: true\n};\n\n// Set output (required)\noutput = result;",
"label": "TypeScript Executor"
+ },
+ "telegramReceive-1772725517789": {
+ "contentTypeFilter": "text",
+ "senderFilter": "self",
+ "chat_id": "",
+ "from_user": "",
+ "keywords": "",
+ "ignoreBots": true,
+ "label": "Telegram Receive"
}
}
}
\ No newline at end of file