Skip to main content

Slack: Get Conversation History

Controlled node

Overview

Retrieves the message history from a Slack channel or conversation. This node fetches messages in batches (pages) and supports pagination to retrieve up to 1000 messages per execution.

The node requires a Slack connection to be configured in the project settings. It will fetch up to 200 messages per page and can retrieve a maximum of 5 pages (1000 messages total) in a single run. For larger histories, use the cursor output to paginate through results.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the node to fetch conversation history-
Channel IDTextThe Slack channel ID or conversation ID to fetch history from-
LimitNumberMaximum number of messages to fetch per page (max 200)200
Max PagesNumberMaximum number of pages to fetch (max 5, totaling 1000 messages)1
CursorTextPagination cursor for fetching subsequent pages of history-
ConnectionsConnectionSlack connection to use for the API call-

Outputs

OutputTypeDescription
DoneEventFires when the node has finished fetching messages
MessagesDataArray of message objects from the conversation history, or an error object if the request failed

Runtime Behavior and Defaults

  • Controlled Node: This node requires a Run event to execute. It will not run automatically when data changes.
  • Pagination: The node supports Slack's cursor-based pagination. Pass the cursor from a previous run into the Cursor input to fetch the next page of results.
  • Rate Limiting: The node respects Slack's rate limits by fetching pages sequentially with a small delay between requests.
  • Error Handling: If the Slack API returns an error (e.g., invalid channel ID, missing permissions), the Messages output will contain an error object with details rather than the message array.
  • Maximum Results: While the Limit input accepts values up to 200, and Max Pages accepts values up to 5, exceeding these limits will result in an error output.

Example Usage

Basic Channel History Retrieval:

  1. Connect a Start node or event trigger to the Run input
  2. Provide a Slack channel ID (e.g., C1234567890) to the Channel ID input
  3. Set Limit to 100 to fetch 100 messages per page
  4. Set Max Pages to 2 to fetch up to 200 messages total
  5. Connect the Done event to trigger downstream processing
  6. Access the message history from the Messages output, which will contain an array of Slack message objects

Paginated History Retrieval:

  1. First run: Leave Cursor empty to fetch the first page
  2. Store the returned messages and check if more pages exist (the Slack API returns a response_metadata.next_cursor in the result)
  3. Subsequent runs: Pass the next_cursor value into the Cursor input to fetch the next page
  4. Repeat until no more cursor is returned or you've reached your desired message count