Slack · Arazzo Workflow

Slack Post a Poll Message, Seed Reactions, and Read Tally

Version 1.0.0

Post a message, seed two reaction options, and read back the reaction tally.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub BotsChatCollaborationMessagingProductivityT1Team CommunicationArazzoWorkflows

Provider

slack

Workflows

post-message-get-reactions
Post a poll prompt, seed two reactions, and read the tally.
Posts a prompt message, adds two seed reactions, and reads the reactions back to inspect the current tally.
4 steps inputs: channel, optionA, optionB, text outputs: channelId, messageTs, tallyRead
1
postPrompt
postChatPostmessage
Post the poll prompt message and capture its channel and timestamp.
2
seedOptionA
postReactionsAdd
Seed the first reaction option onto the poll prompt.
3
seedOptionB
postReactionsAdd
Seed the second reaction option onto the poll prompt.
4
readTally
getReactionsGet
Read the reactions on the poll prompt to inspect the current tally.

Source API Descriptions

Arazzo Workflow Specification

slack-post-message-get-reactions-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Slack Post a Poll Message, Seed Reactions, and Read Tally
  summary: Post a message, seed two reaction options, and read back the reaction tally.
  description: >-
    A lightweight poll pattern built entirely on reactions. The workflow posts a
    prompt message, seeds it with two reaction options for members to vote with,
    and then reads the reactions back so the current tally can be inspected.
    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: chatApi
  url: ../openapi/slack-chat-openapi.yml
  type: openapi
- name: reactionsApi
  url: ../openapi/slack-reactions-openapi.yml
  type: openapi
workflows:
- workflowId: post-message-get-reactions
  summary: Post a poll prompt, seed two reactions, and read the tally.
  description: >-
    Posts a prompt message, adds two seed reactions, and reads the reactions
    back to inspect the current tally.
  inputs:
    type: object
    required:
    - channel
    - text
    - optionA
    - optionB
    properties:
      channel:
        type: string
        description: The channel ID to post the poll prompt into.
      text:
        type: string
        description: The poll prompt text.
      optionA:
        type: string
        description: The first reaction (emoji) name to seed, without colons.
      optionB:
        type: string
        description: The second reaction (emoji) name to seed, without colons.
  steps:
  - stepId: postPrompt
    description: >-
      Post the poll prompt message and capture its channel and timestamp.
    operationId: postChatPostmessage
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        channel: $inputs.channel
        text: $inputs.text
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.ok == true
      type: jsonpath
    outputs:
      channelId: $response.body#/channel
      messageTs: $response.body#/ts
  - stepId: seedOptionA
    description: >-
      Seed the first reaction option onto the poll prompt.
    operationId: postReactionsAdd
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        channel: $steps.postPrompt.outputs.channelId
        name: $inputs.optionA
        timestamp: $steps.postPrompt.outputs.messageTs
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.ok == true
      type: jsonpath
    outputs:
      seededA: $response.body#/ok
  - stepId: seedOptionB
    description: >-
      Seed the second reaction option onto the poll prompt.
    operationId: postReactionsAdd
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        channel: $steps.postPrompt.outputs.channelId
        name: $inputs.optionB
        timestamp: $steps.postPrompt.outputs.messageTs
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.ok == true
      type: jsonpath
    outputs:
      seededB: $response.body#/ok
  - stepId: readTally
    description: >-
      Read the reactions on the poll prompt to inspect the current tally.
    operationId: getReactionsGet
    parameters:
    - name: channel
      in: query
      value: $steps.postPrompt.outputs.channelId
    - name: timestamp
      in: query
      value: $steps.postPrompt.outputs.messageTs
    - name: full
      in: query
      value: true
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.ok == true
      type: jsonpath
    outputs:
      tallyRead: $response.body#/ok
  outputs:
    channelId: $steps.postPrompt.outputs.channelId
    messageTs: $steps.postPrompt.outputs.messageTs
    tallyRead: $steps.readTally.outputs.tallyRead