Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

nocoo/microsoft-teams-send-as-workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Microsoft Teams Send As Workflow

Send messages and Adaptive Cards to Microsoft Teams channels via Incoming Webhook.

Features

  • πŸ“¨ Simple text messages - Quick notifications and alerts
  • 🎴 Adaptive Cards - Rich formatted cards with facts, images, and buttons
  • πŸ”§ Raw payloads - Full control over custom message structures
  • ⚠️ Helpful error handling - Clear guidance for setup issues

Prerequisites

You need a Webhook URL from Teams. To create one:

  1. In Teams, go to the target channel
  2. Open Workflows app (search from Apps or click three dots below input)
  3. Find template: "Post to a channel when a webhook request is received"
  4. Name the workflow (e.g., "CLI Notification Bot")
  5. Select target Team and Channel
  6. Copy the generated HTTP POST URL

Quick Start

python3 scripts/send_teams.py <WEBHOOK_URL> --text "Hello Teams!"

Message Types

πŸ“ Simple Text Message

python3 scripts/send_teams.py <WEBHOOK_URL> -t "πŸš€ Deployment completed successfully"

🎴 Adaptive Card

Inline JSON:

python3 scripts/send_teams.py <WEBHOOK_URL> -c '{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "TextBlock",
      "text": "Build Report",
      "weight": "Bolder",
      "size": "Medium"
    }
  ]
}'

From JSON file:

python3 scripts/send_teams.py <WEBHOOK_URL> -c card.json

πŸ”§ Raw Payload

python3 scripts/send_teams.py <WEBHOOK_URL> -r '{"type": "message", "text": "Custom"}'

Script Reference

scripts/send_teams.py

Argument Description
webhook_url Teams Incoming Webhook URL (required positional)
-t, --text TEXT Send simple text message
-c, --card CARD Send Adaptive Card (JSON string or .json file)
-r, --raw RAW Send raw custom payload (JSON string or .json file)
-v, --verbose Enable verbose output

Troubleshooting

⚠️ Workflow Suspended

If you receive errors about a "suspended" workflow:

  1. Open Power Automate (or your org's URL)
  2. Go to My flows / Workflows
  3. Find your workflow β†’ Resume / Activate / Turn on
  4. Retry sending your message

License

MIT License - see LICENSE for details.

About

πŸ“¨ Send messages and Adaptive Cards to Microsoft Teams channels via Webhook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages