Messaging Services

Scripts can send supervised provider messages with services.telegram.send(), services.discord.send(), and services.whatsapp.send().

Pass the destination, message content, symbolic credential value, and a stable operation name. Return only the provider message identity and bounded fields needed later.

WhatsApp proactive messages use approved templates rather than arbitrary free-form text. Slack is currently a trigger and notification provider; services.slack.send() is not a public v1 capability.

Use <notify> for approval and lifecycle notifications. Use messaging services when the message itself is ordinary business work inside a step.

Reply to an incoming message

JavaScript
const sent = await services.telegram.send({
  botToken: secrets.TELEGRAM_BOT_TOKEN,
  conversationId: context.payload.conversationId,
  text: `You said: ${context.payload.text}`,
  replyToMessageId: context.payload.messageId
}, { name: "reply-to-telegram-message" });

return {
  provider: sent.provider,
  messageId: sent.messageId
};

Discord uses the same provider-independent conversation and reply identities with its own bot token. WhatsApp outbound initiation uses an approved template name, language, and parameters rather than arbitrary proactive text.

Messaging or notification

Use a messaging service when sending a message is part of normal business flow and its result may feed later steps. Use <notify> inside approval or lifecycle hooks when WOML is delivering decision UI or observational runtime information.

Always use a stable operation name and avoid returning full provider responses. Keep only bounded message identity required for later operations or audit.

Slack does not currently expose a public services.slack.send() method. Use Slack triggers and notifications, or a reviewed local module for project-specific ordinary Slack messaging.