arazzo: 1.0.1 info: title: Microsoft Teams Add Member and Welcome summary: Add a member to a team and post a welcome message to a chosen channel. description: >- Welcoming new members keeps a team engaged. This workflow lists the team's channels to confirm a place to post, adds the new user as a member, and posts a welcome message into the supplied 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: add-member-and-welcome summary: Add a user to a team and greet them in a channel. description: >- Confirms the team has channels, adds the user as a member, and posts a welcome message to the chosen channel. inputs: type: object required: - accessToken - teamId - userId - channelId - welcomeMessage properties: accessToken: type: string description: OAuth 2.0 bearer token with TeamMember.ReadWrite.All and ChatMessage.Send scopes. teamId: type: string description: The unique identifier of the team. userId: type: string description: The id of the user to add to the team. channelId: type: string description: The channel id to post the welcome message into. welcomeMessage: type: string description: The HTML body of the welcome message. steps: - stepId: listChannels description: >- List the team's channels to confirm a target channel exists before adding the member and posting a welcome. 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 - stepId: addMember description: >- Add the user to the team with the member role. operationId: addTeamMember parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: team-id in: path value: $inputs.teamId requestBody: contentType: application/json payload: roles: - member userId: $inputs.userId successCriteria: - condition: $statusCode == 201 outputs: membershipId: $response.body#/id - stepId: postWelcome description: >- Post the welcome message into the chosen 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.welcomeMessage successCriteria: - condition: $statusCode == 201 outputs: messageId: $response.body#/id outputs: membershipId: $steps.addMember.outputs.membershipId messageId: $steps.postWelcome.outputs.messageId