Slack Summary Reporter
Pricing
Pay per usage
Slack Summary Reporter
A simple Python Actor that fetches recent Slack messages, summarizes them via OpenAI, and posts the summary back to Slack.
Pricing
Pay per usage
Rating
0.0
(0)
Developer

Marko Kubrachenko
Actor stats
0
Bookmarked
1
Total users
0
Monthly active users
5 months ago
Last modified
Categories
Share
A simple Python Actor that fetches recent Slack messages, summarizes them via OpenAI, and posts the summary back to Slack—configured entirely via per-run JSON input instead of environment variables.
🛠️ Prerequisites
- Python 3.12+
- Docker (optional, for containerized runs)
- An Apify account and the Apify CLI installed (for local development)
- A Slack app with OAuth scopes:
conversations.history(to read messages)chat:write(to post messages)
- An OpenAI API key
⚙️ Actor Input
All configuration now comes via the Actor’s INPUT schema (.actor/actor.json). Users supply a JSON object at run-time—either in the Apify Console form, as a Task, or via apify run --input input.json.
{"summaryDays": 1, // How many days back to fetch"slackTokenFetch": "xoxb-…", // [secret] token with history scope"slackChannelFetch": "C0123456789", // Channel ID to read from"slackTokenPost": "xoxb-…", // [secret] token with chat:write scope"slackChannelPost": "C9876543210", // Channel ID to post summary"openaiApiKey": "sk-…", // [secret] your OpenAI API key"openaiModel": "gpt-4o-mini" // Which OpenAI model to use}
Note: Fields marked secret (
slackTokenFetch,slackTokenPost,openaiApiKey) are defined withisSecret: truein the Actor schema, so they’re encrypted in the Console and API.
🚀 Running Locally
- Push your Actor (includes
.actor/actor.json) to Apify:$apify push - Create a local
input.json(see example above). - Run with the Apify CLI, pointing to your input file:
$apify run --input input.json
This will execute main.py under the Apify runtime, loading your JSON as await Actor.get_input().
🐳 Docker Usage
To build and run the container locally, mount your input.json into the Apify default key–value store:
- Build the image:
$docker build -t slack-summary-reporter .
- Run with volume mounts for input storage:
# Create a folder for the default storemkdir -p apify_storage/key_value_stores/default# Copy your input.json therecp input.json apify_storage/key_value_stores/default/INPUT.json# Run the containerdocker run --rm -v "$(pwd)/apify_storage":/home/apify_user/apify_storage slack-summary-reporter
The Actor will read /home/apify_user/apify_storage/key_value_stores/default/INPUT.json automatically.
🔧 Customization
summaryDays: Adjust how many days of history to include.summaryPromptTemplate(optional): Override the default summarization prompt.maxChunkTokens(optional): Change the OpenAI-chunk-size limit.
All of these are additional properties you can add to your .actor/actor.json schema and supply in the same input JSON.
📖 License
MIT © Marko Kubrachenko
