AptlyStar

Connect Slack to an agent

Receive Slack messages in a product agent and reply from the same workflow

Use this guide when you created an agent from the Agents hub and want Slack channels or threads to run that agent automatically. AptlyStar wires a Slack trigger block to your Agent block, stores conversation memory per thread, and ensures the agent can send messages back to Slack.

For canvas-only workflows (no Agents product), the underlying trigger is the same — see Slack triggers and the Slack block setup wizard on the canvas.

Prerequisites

  • A workspace where you can create agents and deploy workflows
  • Permission to create a Slack app in your Slack workspace (or approval from an admin)
  • An agent with instructions and tools configured (at minimum, the agent should be able to answer the kinds of messages you expect in Slack)

How it works

Slack event → AptlyStar webhook → Agent workflow run
  → conversation memory key: slack:{team}:{channel}:{thread}
  → Agent block (user message from Slack)
  → optional tool calls (e.g. slack send message)
  → reply posted to Slack when the model uses the send tool

Each thread (or top-level message timestamp) gets its own conversation id so multi-turn Slack threads stay coherent.

Setup

Go to Agents in the workspace sidebar. Create an agent or open an existing one. Confirm Settings has the persona, model, and tools you need.

Deploy is required before Slack can call your webhook — you will deploy in a later step.

Open the agent → Channels → Slack.

Enter:

FieldRequiredPurpose
Signing secretYesVerifies requests from Slack (Basic Information → App Credentials)
Bot tokenRecommendedxoxb-… so the agent can post replies and read file attachments
Include file attachmentsNoDownloads files from messages; needs bot token with files:read

Click Enable Slack. AptlyStar adds a Slack trigger block on the workflow graph, connects it to the Agent block, turns on conversation memory, and adds the Slack send tool if it was missing.

On the Channels tab, use Deploy workflow in the Web chat section if needed, then configure and Launch Chat in the same panel (no need to open the canvas deploy sheet).

Until the workflow is deployed, the webhook URL is not active.

After deploy, the Channels tab shows your webhook URL (format: {APP_URL}/api/webhooks/trigger/{path}).

In the Slack API → your app → Event Subscriptions:

  1. Turn Enable Events on
  2. Paste the Request URL from AptlyStar
  3. Wait for Slack to verify the URL (the endpoint must be reachable and the signing secret must match)

Subscribe to the bot events your use case needs, for example:

EventUse when
app_mentionUsers @-mention the bot in a channel
message.imDirect messages to the bot
message.channelsMessages in public channels the bot joined
message.groupsMessages in private channels the bot joined
message.mpimGroup DMs

Under OAuth & Permissions, install the app to the workspace with scopes that match your events (e.g. chat:write for replies, channels:history for public channel messages). The canvas Slack setup wizard on the trigger block can generate a manifest with the right scopes if you prefer that flow.

Invite the bot to the channel you use for testing. Send a message or @-mention the bot.

Check Overview → View runs (logs filtered to this agent) to confirm a run started. A successful reply means the agent run completed and the Slack send message tool executed with your bot token.

Credentials and security

  • Signing secret — Required. AptlyStar rejects webhooks that fail Slack signature verification.
  • Bot token — Stored on the Slack trigger block (same as canvas workflows). Use a bot token dedicated to this agent; rotate it in Slack if compromised.
  • Webhook URL — Treat it as sensitive; only paste it into your Slack app’s Event Subscriptions.

Do not commit signing secrets or bot tokens to source control. Enter them only in the Agents Channels UI or the canvas trigger block.

Conversation memory

When Slack is enabled, AptlyStar sets the Agent block to conversation memory and assigns a stable id:

slack:{team_id}:{channel_id}:{thread_ts_or_message_ts}

Replies in the same Slack thread reuse the same memory key. New threads start a new conversation from the model’s perspective.

Replies

Enabling Slack automatically ensures the Slack send operation is on the agent’s tool list. The model must call that tool to post back to a channel; there is no separate “auto-reply” step outside the agent run.

If users see runs in logs but nothing in Slack:

  1. Confirm a bot token with chat:write was saved
  2. Confirm the bot is in the target channel
  3. Review the run trace for failed slack_* tool calls or missing channel id

Orchestrator agents

Agents in orchestrator mode still use the same Slack ingress. The parent run receives the Slack message; delegated sub-sessions are separate executions (see agent Settings → orchestrator limits). For simple “message in, reply in thread” setups, focused mode is usually enough.

Troubleshooting

SymptomWhat to check
URL verification failsWorkflow deployed, signing secret matches Slack app, NEXT_PUBLIC_APP_URL / public URL correct
Events received but no runsBot events subscribed, bot invited to channel, event type matches (e.g. app_mention vs plain message)
Runs succeed, no Slack replyBot token present, chat:write scope, send tool on agent, channel id in tool args
Wrong thread contextThread ts in event; memory key uses thread_ts when present
File content missingEnable Include file attachments and files:read on the bot token

Advanced: canvas and custom graphs

  • Open canvas from the Channels tab to edit the Slack trigger block, add steps after the Agent block, or use the Slack setup wizard sub-block for manifest generation.
  • Output shape of the trigger matches Slack webhook trigger (event.text, event.channel, etc.).

On this page