arazzo: 1.0.1 info: title: Slack Read Channel History and Mark It Read summary: Fetch a channel's recent history and mark the channel read up to the latest message. description: >- A catch up pattern that reads a channel's recent activity and clears the unread badge. The workflow fetches the channel history, takes the timestamp of the most recent message, and marks the channel read up to that point so the conversation no longer shows as unread. 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: conversationsApi url: ../openapi/slack-conversations-openapi.yml type: openapi workflows: - workflowId: read-history-mark-read summary: Fetch channel history and mark the channel read at the latest message. description: >- Fetches the recent history of a channel and marks the channel read up to the timestamp of the most recent message. inputs: type: object required: - channel properties: channel: type: string description: The ID of the channel to read and mark. limit: type: integer description: The maximum number of messages to return. steps: - stepId: fetchHistory description: >- Fetch the recent message history for the channel and capture the timestamp of the most recent message. operationId: getConversationsHistory parameters: - name: channel in: query value: $inputs.channel - name: limit in: query value: $inputs.limit successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.ok == true type: jsonpath outputs: messages: $response.body#/messages latestTs: $response.body#/messages/0/ts - stepId: markRead description: >- Mark the channel read up to the timestamp of the most recent message so it no longer appears unread. operationId: postConversationsMark requestBody: contentType: application/x-www-form-urlencoded payload: channel: $inputs.channel ts: $steps.fetchHistory.outputs.latestTs successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.ok == true type: jsonpath outputs: marked: $response.body#/ok outputs: messages: $steps.fetchHistory.outputs.messages latestTs: $steps.fetchHistory.outputs.latestTs marked: $steps.markRead.outputs.marked