Slack Digest Bot: A Workflow Script Tutorial
Learn how to build a Workflow Script that researches a topic on Google, writes a scannable digest, and posts it directly to a Slack channel.
User provides a topic. The script searches Google, summarizes the top results into a scannable digest, and posts it directly to a Slack channel.
Why build this
This tutorial shows how a Workflow Script can feed its output directly into a downstream canvas block — in this case, Post to Slack — rather than displaying results in the interface. You’ll see how a script acts as a data pipeline: it searches, summarizes, and returns a ready-to-send digest that the canvas routes to an external service. It’s a practical pattern for any workflow where output needs to go somewhere other than the screen.
Requirements: This tutorial requires a Slack workspace that you can connect to MindStudio.
Blocks you’ll use
- User Input — Collects the topic the user wants to research and send as a digest.
- Run Script — Houses the Workflow Script. Inside the script, a Search Google action fetches the top results and a Generate Text action writes the digest.
- Post to Slack Channel — Sends the generated digest to a configured Slack channel. No Display Content block is needed — the output goes directly to Slack.
Canvas flow
Start → User Input → Run Script → Post to Slack Channel → End
The Run Script block is where your Workflow Script lives. It uses a Search Google action to fetch the latest results on the topic, then a Generate Text action to write a scannable digest — brief intro, key findings, and a one-line takeaway — returned under the key digest. The Post to Slack Channel block then sends it directly to your chosen channel.
How to build it
-
Open the Automations Canvas — Open MindStudio. The Automations Canvas is displayed by default. You’ll see a Start block and an End block already in place.
-
Add a User Input block — Click + to add a block and select User Input. In the block settings on the right, click + to add a user input, then click Create New. Set the Type to Short Text and enter
topicin the Variable field — this is the name you’ll use to reference this input in the Run Script block. Set the Label to a short name — for example, “Topic”. Then set the Help Text to a description the user will see — for example, “What topic should I research and post to Slack?”Once you’ve set up the user input, click the Main.flow tab at the top of the editor to return to the workflow.
-
Add a Run Script block — Click + in the workflow, then select View All Blocks. From the Blocks screen, search for Run Script and select it. In the block settings, click Edit Script to open the script editor. Paste the prompt below to generate the script automatically.
Generate a script that takes a topic as input. Use a Search Google action to fetch the latest results on that topic, then use a Generate Text action to write a short, scannable digest — a brief intro, 3–5 key findings with source references where available, and a one-line takeaway. Return the digest under a key named digest.- Return to the workflow — Once the script is generated, click the Main.flow tab to return to the workflow. The Input Variables and Output Variables settings will appear in the block settings on the right.
- Configure Input Variables — For the
topicparameter, set the Variable to{{topic}}. - Configure Output Variables — Confirm that
digestis mapped to the variable{{digest}}.
-
Add a Post to Slack block — Click + in the workflow, then select View All Blocks. From the Blocks screen, search for Post to Slack and select it. Connect it after the Run Script block.
- Connect your Slack account — In the block settings, click the Account dropdown. Select your Slack workspace from the list, or click + Connect a new account to connect one.
- Set the Message Type — Click the Message Type dropdown and select Markdown Text.
- Select a channel — Click the Channel dropdown and select the Slack channel you want to post to.
- Set the Message Content — In the Message Content field, enter
{{digest}}— the variable you mapped in the Run Script block’s Output Variables. The workflow will post the digest directly to Slack without displaying it in the interface first.
-
Name your AI agent — Click Untitled Agent at the top of the interface, then update the Agent Name field — for example, “Slack Digest Bot.”
-
Preview your AI agent — Click the Preview button, then select Open Draft Agent to run the AI agent and test your workflow. Once it completes, go to the Slack channel you selected and check that the digest has been posted.
Try it in MindStudio
Open MindStudio and follow along with this tutorial. No coding required.