Azure Web PubSub · Arazzo Workflow

Azure Web PubSub Join Group, Send, then Leave

Version 1.0.0

Add a connection to a group, broadcast a message to that group, then remove the connection.

1 workflow 1 source API 1 provider
View Spec View on GitHub MessagingPub-SubReal-TimeServerlessWebSocketsArazzoWorkflows

Provider

microsoft-azure-web-pubsub

Workflows

join-group-send-leave
Add a connection to a group, send a message to the group, then remove the connection.
Adds a connection to a group via addConnectionToGroup, broadcasts to the group via sendToGroup, then removes the connection via removeConnectionFromGroup.
3 steps inputs: accessToken, apiVersion, connectionId, group, hub, message outputs: addStatus, removeStatus, sendStatus
1
addConnection
webPubSub_addConnectionToGroup
Add the connection to the named group so it begins receiving group messages.
2
sendToGroup
webPubSub_sendToGroup
Broadcast the supplied plain-text message to every connection in the group.
3
removeConnection
webPubSub_removeConnectionFromGroup
Remove the connection from the group so it stops receiving future group messages.

Source API Descriptions

Arazzo Workflow Specification

microsoft-azure-web-pubsub-join-group-and-send-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Azure Web PubSub Join Group, Send, then Leave
  summary: Add a connection to a group, broadcast a message to that group, then remove the connection.
  description: >-
    A scoped fan-out pattern: a connection is added to a named group, a message
    is broadcast to everyone in that group, and finally the connection is removed
    from the group so it no longer receives future group traffic. Every step
    inlines its request — Authorization bearer header, required api-version query,
    request body, and documented status codes — so the flow is self-describing.
  version: 1.0.0
sourceDescriptions:
- name: webPubSubApi
  url: ../openapi/microsoft-azure-web-pubsub-openapi.yml
  type: openapi
workflows:
- workflowId: join-group-send-leave
  summary: Add a connection to a group, send a message to the group, then remove the connection.
  description: >-
    Adds a connection to a group via addConnectionToGroup, broadcasts to the
    group via sendToGroup, then removes the connection via
    removeConnectionFromGroup.
  inputs:
    type: object
    required:
    - accessToken
    - hub
    - group
    - connectionId
    - message
    properties:
      accessToken:
        type: string
        description: JWT bearer token for the Web PubSub data plane.
      apiVersion:
        type: string
        description: Data plane REST API version.
        default: "2024-01-01"
      hub:
        type: string
        description: Target hub name.
      group:
        type: string
        description: Group name to add the connection to and broadcast to.
      connectionId:
        type: string
        description: The connection id to add to the group.
      message:
        type: string
        description: The plain-text message to broadcast to the group.
  steps:
  - stepId: addConnection
    description: >-
      Add the connection to the named group so it begins receiving group
      messages.
    operationId: webPubSub_addConnectionToGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: hub
      in: path
      value: $inputs.hub
    - name: group
      in: path
      value: $inputs.group
    - name: connectionId
      in: path
      value: $inputs.connectionId
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      addStatus: $statusCode
  - stepId: sendToGroup
    description: >-
      Broadcast the supplied plain-text message to every connection in the group.
    operationId: webPubSub_sendToGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: hub
      in: path
      value: $inputs.hub
    - name: group
      in: path
      value: $inputs.group
    - name: api-version
      in: query
      value: $inputs.apiVersion
    requestBody:
      contentType: text/plain
      payload: $inputs.message
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      sendStatus: $statusCode
  - stepId: removeConnection
    description: >-
      Remove the connection from the group so it stops receiving future group
      messages.
    operationId: webPubSub_removeConnectionFromGroup
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: hub
      in: path
      value: $inputs.hub
    - name: group
      in: path
      value: $inputs.group
    - name: connectionId
      in: path
      value: $inputs.connectionId
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      removeStatus: $statusCode
  outputs:
    addStatus: $steps.addConnection.outputs.addStatus
    sendStatus: $steps.sendToGroup.outputs.sendStatus
    removeStatus: $steps.removeConnection.outputs.removeStatus