Microsoft Teams · Arazzo Workflow

Microsoft Teams Post Channel Announcement

Version 1.0.0

Find a channel by name in a team and post an announcement message to it.

1 workflow 1 source API 1 provider
View Spec View on GitHub ChatCollaborationCommunicationMicrosoft 365ProductivityVideo ConferencingArazzoWorkflows

Provider

microsoft-teams

Workflows

post-channel-announcement
Resolve a channel by name and post an announcement, branching when missing.
Lists the channels in a team, and when a channel matching the supplied name exists, posts an announcement to it. When no channel matches, the flow ends without posting.
2 steps inputs: accessToken, announcement, channelId, teamId outputs: messageId
1
listChannels
listChannels
List the channels in the team so the caller can confirm the target channel exists before posting.
2
postAnnouncement
sendChannelMessage
Post the announcement message into the target channel.

Source API Descriptions

Arazzo Workflow Specification

microsoft-teams-post-channel-announcement-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Teams Post Channel Announcement
  summary: Find a channel by name in a team and post an announcement message to it.
  description: >-
    Posting to a named channel requires resolving the channel id first. This
    workflow lists the channels in a team, branches on whether a channel with the
    requested display name was found, and posts an announcement message into the
    matched channel. Every step spells out its request inline so the flow can be
    read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: teamsApi
  url: ../openapi/microsoft-teams-graph-api.yaml
  type: openapi
workflows:
- workflowId: post-channel-announcement
  summary: Resolve a channel by name and post an announcement, branching when missing.
  description: >-
    Lists the channels in a team, and when a channel matching the supplied name
    exists, posts an announcement to it. When no channel matches, the flow ends
    without posting.
  inputs:
    type: object
    required:
    - accessToken
    - teamId
    - channelId
    - announcement
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer token with Channel.ReadBasic.All and ChatMessage.Send scopes.
      teamId:
        type: string
        description: The unique identifier of the team.
      channelId:
        type: string
        description: The channel id to post the announcement to once channels are confirmed.
      announcement:
        type: string
        description: The HTML body of the announcement message.
  steps:
  - stepId: listChannels
    description: >-
      List the channels in the team so the caller can confirm the target channel
      exists before posting.
    operationId: listChannels
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: team-id
      in: path
      value: $inputs.teamId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      channels: $response.body#/value
    onSuccess:
    - name: channelsFound
      type: goto
      stepId: postAnnouncement
      criteria:
      - context: $response.body
        condition: $.value.length > 0
        type: jsonpath
    - name: noChannels
      type: end
      criteria:
      - context: $response.body
        condition: $.value.length == 0
        type: jsonpath
  - stepId: postAnnouncement
    description: >-
      Post the announcement message into the target channel.
    operationId: sendChannelMessage
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: team-id
      in: path
      value: $inputs.teamId
    - name: channel-id
      in: path
      value: $inputs.channelId
    requestBody:
      contentType: application/json
      payload:
        body:
          contentType: html
          content: $inputs.announcement
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      messageId: $response.body#/id
  outputs:
    messageId: $steps.postAnnouncement.outputs.messageId