Skip to main content

Send Message

Sends a message to a Microsoft Teams chat or channel with customizable formatting and importance.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Input

  • Client Id - The client ID from the Connect node. Optional if using direct credentials.
  • Message Text - The content of the message to send (required).

Options

  • Credentials - OAuth2 credentials JSON (optional if using Client ID). Allows direct authentication without Connect node.
  • Team Id - The unique identifier of the team (required for channel messages).
  • Channel Id - The unique identifier of the channel (required for channel messages).
  • Chat Id - The unique identifier of the chat (required for chat messages).
  • Body Type - Format of the message body:
    • Text - Plain text message
    • Html - HTML formatted message
  • Importance - Importance level of the message:
    • Normal - Standard importance (default)
    • High - High importance (shows "!" indicator)
    • Urgent - Urgent importance (shows "!!" indicator)
note

Either provide Chat Id OR both Team Id and Channel Id. You cannot use both at the same time.

Output

  • n/a - No output

Examples

Send Plain Text to Channel

Send simple text message to a channel:

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."
message_text = "Hello team! Meeting starts in 10 minutes."

// Send Message node
// Body Type: Text
// Importance: Normal

Send HTML Formatted Message

Send message with rich formatting:

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."

message_text = `
<h2>Daily Status Report</h2>
<ul>
<li><strong>Completed:</strong> 5 tasks</li>
<li><strong>In Progress:</strong> 3 tasks</li>
<li><strong>Blocked:</strong> 1 task</li>
</ul>
<p><em>Next update: Tomorrow 9 AM</em></p>
`

// Send Message node
// Body Type: Html
// Importance: Normal

Send Urgent Message

Send high-priority alert:

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."

message_text = "ALERT: Production server is down. Incident response team please join the war room."

// Send Message node
// Importance: Urgent
// Body Type: Text

Send to Private Chat

Send message to a chat instead of channel:

chat_id = "19:meeting_abc123..."
message_text = "Hi! Could you review the document I shared?"

// Send Message node
// Team Id: (leave empty)
// Channel Id: (leave empty)
// Chat Id: chat_id
// Body Type: Text
// Importance: Normal

Send Automated Report

Generate and send report message:

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."

// Generate report data
stats = {
completed: 25,
pending: 10,
total: 35
}

percentage = Math.round((stats.completed / stats.total) * 100)

message_text = `
<h3>Weekly Progress Report</h3>
<p><strong>Completed:</strong> ${stats.completed}/${stats.total} (${percentage}%)</p>
<p><strong>Pending:</strong> ${stats.pending}</p>
<p><strong>Status:</strong> ${percentage >= 70 ? '✅ On track' : '⚠️ Needs attention'}</p>
`

// Send Message node
// Body Type: Html
// Importance: Normal

Send Notification with Mentions

Mention users in message (using HTML):

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."

user_id = "8ea12d16-3e32-4cd4-b09d-1234567890ab"
user_name = "John Doe"

message_text = `
<at id="0">${user_name}</at> please review the pull request.
`

// Note: For mentions to work properly, you need to include
// mention objects in the message, which requires using
// the Graph API directly. This example shows HTML formatting.

// Send Message node
// Body Type: Html

Conditional Importance

Set importance based on content:

team_id = "19:abc123def456..."
channel_id = "19:xyz789abc123..."

error_count = 5
message_text = `System errors detected: ${error_count}`

// Determine importance
importance = "normal"
if (error_count > 10) {
importance = "urgent"
} else if (error_count > 5) {
importance = "high"
}

// Send Message node
// Importance: importance (set dynamically)

Broadcast to Multiple Channels

Send same message to multiple channels:

team_id = "19:abc123def456..."
message_text = "Important announcement: Office closed tomorrow"

// Get target channels
target_channels = [
"19:channel1...",
"19:channel2...",
"19:channel3..."
]

for (channel_id of target_channels) {
// Send Message node
// Team Id: team_id
// Channel Id: channel_id
// Message Text: message_text
// Importance: High

await delay(1000) // Rate limiting
}

Tips for Effective Use

  • HTML formatting: Use Body Type Html for rich formatting (bold, lists, links)
  • Importance levels: Use High/Urgent sparingly for actual important messages
  • Either/Or: Provide either Chat Id OR Team+Channel Id, not both
  • Rate limiting: Add delays when sending multiple messages
  • Message length: Keep messages concise and readable
  • Mentions: Use HTML <at> tags for mentions (advanced usage)
  • Testing: Test HTML messages to ensure proper rendering

Common Errors and Solutions

"Message Text cannot be empty"

Cause: No message content provided.

Solution: Provide message text:

message_text = "Your message here"
// Must not be empty or whitespace

"Team Id and Chat Id cannot both be empty"

Cause: Neither chat ID nor team/channel IDs provided.

Solution: Provide either chat ID or both team and channel IDs:

// For channel message
team_id = "19:abc123..."
channel_id = "19:xyz789..."
chat_id = "" // Leave empty

// OR for chat message
chat_id = "19:meeting_abc123..."
team_id = "" // Leave empty
channel_id = "" // Leave empty

"Channel Id and Chat Id cannot both be empty"

Cause: Team ID provided but no channel or chat ID.

Solution: Provide channel ID with team ID:

team_id = "19:abc123..."
channel_id = "19:xyz789..." // Required

"Body Type must be selected"

Cause: Body Type option not set.

Solution: Select either Text or Html from dropdown in node configuration.

"Importance must be selected"

Cause: Importance option not set.

Solution: Select Normal, High, or Urgent from dropdown.

Permission Denied

Cause: User doesn't have permission to post in channel/chat.

Solution:

  • Verify user has permission to post
  • Check channel settings allow posting
  • Ensure user is member of chat

Best Practices

  1. Clear content: Write clear, concise messages
  2. Appropriate formatting: Use HTML for structure, not decoration
  3. Importance: Reserve High/Urgent for truly important messages
  4. Rate limiting: Don't send too many messages too quickly
  5. Error handling: Use Try-Catch for failed sends
  6. Testing: Test HTML formatting before production use
  7. Message length: Keep messages reasonably short
  8. Audience awareness: Consider who will see the message

HTML Formatting Examples

<!-- Bold and italic -->
<strong>Bold text</strong>
<em>Italic text</em>

<!-- Lists -->
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>

<!-- Links -->
<a href="https://example.com">Click here</a>

<!-- Headings -->
<h1>Main Title</h1>
<h2>Subtitle</h2>

<!-- Line breaks -->
<p>Paragraph 1</p>
<p>Paragraph 2</p>

<!-- Code -->
<code>inline code</code>
<pre>code block</pre>