Microsoft Teams · Arazzo Workflow

Microsoft Teams Offboard Team Member

Version 1.0.0

Find a member by user id in a team and remove their membership.

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

Provider

microsoft-teams

Workflows

offboard-team-member
List members and remove a membership, branching when the team is empty.
Lists the team's members so the caller can resolve the membership id, then removes the supplied membership. When the team has no members the flow ends.
2 steps inputs: accessToken, membershipId, teamId outputs: members
1
listMembers
listTeamMembers
List the team's members so the caller can confirm and resolve the membership to remove.
2
removeMember
removeTeamMember
Remove the supplied membership from the team.

Source API Descriptions

Arazzo Workflow Specification

microsoft-teams-offboard-team-member-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Teams Offboard Team Member
  summary: Find a member by user id in a team and remove their membership.
  description: >-
    Removing a member requires the membership id rather than the user id. This
    workflow lists the team's members, branches on whether any members exist, and
    removes the membership identified by the caller. 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: offboard-team-member
  summary: List members and remove a membership, branching when the team is empty.
  description: >-
    Lists the team's members so the caller can resolve the membership id, then
    removes the supplied membership. When the team has no members the flow ends.
  inputs:
    type: object
    required:
    - accessToken
    - teamId
    - membershipId
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer token with TeamMember.ReadWrite.All scope.
      teamId:
        type: string
        description: The unique identifier of the team.
      membershipId:
        type: string
        description: The membership id of the member to remove.
  steps:
  - stepId: listMembers
    description: >-
      List the team's members so the caller can confirm and resolve the
      membership to remove.
    operationId: listTeamMembers
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: team-id
      in: path
      value: $inputs.teamId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      members: $response.body#/value
    onSuccess:
    - name: membersExist
      type: goto
      stepId: removeMember
      criteria:
      - context: $response.body
        condition: $.value.length > 0
        type: jsonpath
    - name: noMembers
      type: end
      criteria:
      - context: $response.body
        condition: $.value.length == 0
        type: jsonpath
  - stepId: removeMember
    description: >-
      Remove the supplied membership from the team.
    operationId: removeTeamMember
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: team-id
      in: path
      value: $inputs.teamId
    - name: membership-id
      in: path
      value: $inputs.membershipId
    successCriteria:
    - condition: $statusCode == 204
  outputs:
    members: $steps.listMembers.outputs.members