Aller au contenu

Messaging Extensions Overview

Greentic supports multiple messaging platforms through messaging extension packs. Each extension is a WASM pack that handles:

  • Ingress - Receiving messages from the platform
  • Egress - Sending messages to the platform
  • Operations - Platform-specific features such as buttons, cards, threads, file handling, and webhook setup

The current catalog includes Slack, Microsoft Teams, Telegram, WhatsApp, WebChat, WebChat GUI, Webex, and Email messaging packs.

External Platform (Slack/Teams/Telegram)
▼ Webhook
┌─────────────────────────────────────────┐
│ Ingress Component │
│ (Parse platform-specific format) │
└─────────────────────────────────────────┘
▼ Normalized Message
┌─────────────────────────────────────────┐
│ Runtime Router │
│ greentic.messaging.ingress.{tenant}... │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Flow Executor │
│ (Process with your flows) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Runtime Router │
│ greentic.messaging.egress.{tenant}... │
└─────────────────────────────────────────┘
▼ Platform-specific format
┌─────────────────────────────────────────┐
│ Egress Component │
│ (Format for platform API) │
└─────────────────────────────────────────┘
▼ API Call
External Platform

All providers normalize messages to a common format:

pub struct NormalizedMessage {
pub id: String,
pub channel_id: String,
pub sender_id: String,
pub sender_name: Option<String>,
pub content: String,
pub timestamp: u64,
pub reply_to: Option<String>,
pub attachments: Vec<Attachment>,
pub metadata: Option<Value>,
}

This allows your flows to work across any messaging platform without modification.

Messaging extensions are normally selected with gtc wizard, which writes the bundle metadata and pack references for you. The built-in catalog uses OCI references such as:

oci://ghcr.io/greenticai/packs/messaging/messaging-slack:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-teams:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-telegram:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-whatsapp:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-webchat:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-webchat-gui:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-webex:latest
oci://ghcr.io/greenticai/packs/messaging/messaging-email:latest

Run gtc setup ./my-bundle interactively, or provide an answers file that matches the wizard schema:

answers.json
{
"messaging-telegram": {
"enabled": true,
"public_base_url": "https://example.ngrok-free.app",
"telegram_bot_token": "123456789:ABCdefGHI..."
},
"messaging-slack": {
"enabled": true,
"public_base_url": "https://example.ngrok-free.app",
"slack_bot_token": "xoxb-xxx-xxx",
"slack_app_id": "A07XXX"
}
}

All providers support basic text messages:

- id: reply
type: reply
config:
message: "Hello! How can I help?"

Most providers support rich content:

- id: send_card
type: adaptive-card
config:
card: "cards/welcome.json"

Interactive elements (provider-dependent):

- id: ask_choice
type: reply
config:
message: "What would you like to do?"
buttons:
- label: "Get Help"
action: "help"
- label: "Contact Support"
action: "support"

File and media support:

- id: send_file
type: reply
config:
message: "Here's your report"
attachments:
- type: file
url: "https://example.com/report.pdf"
name: "report.pdf"

Write flows that work across channels:

flows/on_message.ygtc
name: universal_handler
version: "1.0"
nodes:
- id: greet
type: reply
config:
# Works on any platform
message: "Hello! I'm your assistant."
to: ask_intent
- id: ask_intent
type: reply
config:
message: "How can I help you today?"
# Buttons render differently per platform
buttons:
- label: "Get Started"
action: "start"
- label: "Help"
action: "help"
triggers:
- type: message
pattern: "hello|hi"
target: greet
FeatureSlackTeamsTelegramWhatsAppWebChatWebexEmail
TextYesYesYesYesYesYesYes
Native rich layoutBlock KitAdaptive CardsInline/reply keyboardsInteractive messages/templatesAdaptive CardsAdaptive CardsHTML
Adaptive Card handlingTransformedNativeTransformedTransformedNativeNative subsetTransformed to HTML
ButtonsYesYesYesYesYesYesLinks/forms
FilesYesYesYesYesYesYesAttachments
Threads/repliesThreadsConversations/repliesReply-to/topics onlyNoConversation historyThreads/spacesEmail headers
ReactionsPlatform-dependentPlatform-dependentNoNoNoNoNo

Choose a provider to get started:

  • Telegram - Easiest setup, great for testing
  • Slack - Full-featured workspace integration
  • WebChat - Embed in your website