feat(teams-workflows): add rawCardPayload option to send AdaptiveCard directly#441
Open
aspenneberg wants to merge 1 commit into
Open
feat(teams-workflows): add rawCardPayload option to send AdaptiveCard directly#441aspenneberg wants to merge 1 commit into
aspenneberg wants to merge 1 commit into
Conversation
… JSON directly Signed-off-by: D055531 <a.spenneberg@sap.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #441 +/- ##
==========================================
+ Coverage 55.41% 57.16% +1.74%
==========================================
Files 46 48 +2
Lines 4125 3726 -399
==========================================
- Hits 2286 2130 -156
+ Misses 1511 1241 -270
- Partials 328 355 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pasha-codefresh
requested changes
May 2, 2026
pasha-codefresh
left a comment
Member
There was a problem hiding this comment.
Please add documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some Microsoft Teams webhook endpoints — particularly custom Power Automate flows — expect the AdaptiveCard JSON posted directly as the request body, without the standard Teams message envelope:
{ "type": "message", "attachments": [{ "contentType": "application/vnd.microsoft.card.adaptive", "content": { ...card... } }] }These flows accept the card at the root level instead:
{ "type": "AdaptiveCard", "version": "1.4", "body": [...], "actions": [...] }This PR adds a
rawCardPayloadboolean option toTeamsWorkflowsOptions, configurable at the same level asrecipientUrls. Whentrue, the service skips the envelope and sends the AdaptiveCard JSON directly as the POST body. The option works for both the built-in card builder and customadaptiveCardJSON templates.Configuration
Changes
TeamsWorkflowsOptions: newRawCardPayload bool \json:"rawCardPayload"`` fieldteamsWorkflowsNotificationToReader: accepts the flag and returns bare card bytes whentrue, for both the customadaptiveCardpath and the built-in card builder pathTestTeamsWorkflows_RawCardPayload_BuiltInandTestTeamsWorkflows_RawCardPayload_CustomCardTest plan
go test ./pkg/services/... -run TestTeamsWorkflows— all existing tests pass, two new tests passrawCardPayload: truerawCardPayloadis omitted (defaults tofalse)