microsoft-teams-send-as-workflow
npx skills add https://github.com/nocoo/microsoft-teams-send-as-workflow --skill microsoft-teams-send-as-workflow
Agent 安装分布
Skill 文档
Microsoft Teams Post
Send messages and Adaptive Cards to Microsoft Teams channels using Incoming Webhook URLs.
Prerequisites
Users need a Webhook URL from Teams. Guide them to create one if missing:
- In Teams, go to the target channel
- Open Workflows app (search from Apps or click three dots below input)
- Find template: “Post to a channel when a webhook request is received”
- Name the workflow (e.g., “CLI Notification Bot”)
- Select target Team and Channel
- Copy the generated HTTP POST URL
Quick Start
The bundled script scripts/send_teams.py handles all message types.
python3 scripts/send_teams.py <WEBHOOK_URL> --text "Hello Teams!"
Message Types
Simple Text Message
For basic notifications and alerts.
python3 scripts/send_teams.py <WEBHOOK_URL> -t "ð Deployment completed successfully"
Adaptive Card
For rich formatted cards with titles, facts, images, and buttons. Pass JSON as string or file.
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"
},
{
"type": "FactSet",
"facts": [
{"title": "Project", "value": "Backend API"},
{"title": "Status", "value": "â
Success"},
{"title": "Duration", "value": "45s"}
]
}
]
}'
From JSON file:
python3 scripts/send_teams.py <WEBHOOK_URL> -c card.json
Raw Payload
For custom message structures not covered by text or card modes.
python3 scripts/send_teams.py <WEBHOOK_URL> -r '{"type": "message", "text": "Custom"}'
Common Patterns
Build/Deployment Notification
python3 scripts/send_teams.py <WEBHOOK_URL> -c '{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"body": [
{"type": "TextBlock", "text": "Deployment Notification", "weight": "Bolder", "size": "Medium"},
{"type": "TextBlock", "text": "Project: my-app deployed to production", "wrap": true}
],
"actions": [
{"type": "Action.OpenUrl", "title": "View Logs", "url": "https://ci.example.com/logs/123"}
]
}'
Alert with Facts
python3 scripts/send_teams.py <WEBHOOK_URL> -c '{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"body": [
{"type": "TextBlock", "text": "â ï¸ Alert Summary", "weight": "Bolder"},
{
"type": "FactSet",
"facts": [
{"title": "Severity", "value": "High"},
{"title": "Service", "value": "api-gateway"},
{"title": "Time", "value": "2026-01-23 09:45:00 UTC"}
]
}
]
}'
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 |
Exit codes: 0 on success, 1 on failure.
Error Handling
The script reports errors clearly:
â HTTP Error: 401– Invalid webhook URLâ HTTP Error: 400– Malformed JSON or invalid card schemaâ URL Error– Network connectivity issueâ Message sent successfully– Confirmed delivery
For 4xx errors, the response body is printed to help diagnose schema issues.
Suspended Workflow
If you receive errors indicating the workflow is “suspended” or “inactive”:
-
Open Power Automate in your browser:
- https://make.powerautomate.com
- OR your org’s URL: https://.powerautomate.com
-
Go to My flows / Workflows
-
Find your workflow (look for “Suspended” status)
-
Click â Resume / Activate / Turn on
-
Retry sending your message