camelRun by camelAI · Slack

Build a Slack AI agent

camelRun runs an AI agent for every Slack thread, with your model, your tools and its own memory. Before a risky step it asks in the thread, then sleeps until someone answers.

Thread#support
Maya Chen10:41 AM
@Support Agent can you refund order 4471? The customer cancelled before it shipped.
3 replies
Support AgentApp10:41 AM
It hasn't shipped, so I can refund order 4471 in full. Approve this action? shop__refund (shop) with {"orderId":"4471"} Reply approve or deny.
Maya Chen10:43 AM
approve
Support AgentApp10:43 AM
Done. Order 4471 is refunded in full.
Reply…

A custom Slack AI bot that uses your own tools

That thread, in the console: every call the agent made, to tools you wrote and serve from your own app.

run.camelai.com/console/agents/client_9c41…
Agents
Slack: U07K3M9QX2
Asleepanthropic/claude-sonnet-5-5· channel· definition revision 3
  1. can you refund order 4471? The customer cancelled before it shipped.
  2. It hasn't shipped, so I can refund order 4471 in full.

    shop__refund({"orderId":"4471"})
  3. Result of shop__refund
    {"orderId":"4471","amount":86,"status":"refunded"}
    (Approved by slack:U07K3M9QX2 after 2m.)
  4. Done. Order 4471 is refunded in full.

import { schema, tool } from "@camelai/run";
import { serveTools } from "@camelai/run/server";

const refund = tool({
  description: "Refund an order in full",
  input: schema.Object({ orderId: schema.String() }),
  timeoutMs: 60_000,
  execute: async ({ orderId }, context) => {
    context.progress("Contacting the payment provider");
    return payments.refund(orderId, { idempotencyKey: context.idempotencyKey, signal: context.signal });
  },
});

// A fetch handler: Cloudflare Workers, Bun and Deno serve it as is.
// tenant: your tenant's id (GET /v1/me, or `await agents.runtime.me()`): tokens for other tenants' agents are refused.
export default { fetch: serveTools({ refund }, { runtime: "https://run.camelai.com", tenant: "acme" }) };
Tools docs

It knows who is asking. Each call says which Slack channel, thread and member it's for.

One AI agent for every Slack thread

Each @mention starts a thread with an agent of its own, made from your definition: your model, your instructions, your tools. Replies in the thread reach it without another mention, and a DM with your app gets one too.

support14
Wednesday, October 14th
Jonah Reyes3:05 PM
@Support Agent which Fernhill invoices are still unpaid?
3 replies
Today
Priya Shah9:20 AM
@Support Agent draft a reply for the customer asking about EU shipping times
2 replies
Maya Chen10:41 AM
@Support Agent can you refund order 4471? The customer cancelled before it shipped.
3 replies
Sam Ortiz11:02 AM
@Support Agent what did we refund last week, in total?
2 replies
Message #support
Support AgentApp
Lee Park10:58 AM
has order 4510 shipped yet?
Support AgentApp10:58 AM
Yes, it shipped this morning.
Message Support Agent

A Slack agent that remembers every thread

Ask a follow-up in an old thread and the agent already knows what you were talking about. No one has to paste the context back in.

Asleep for a week. Idle and sleeping agents cost only storage.

Thread# support
Wednesday, October 14th
Jonah Reyes3:05 PM
@Support Agent which Fernhill invoices are still unpaid?
3 replies
Support AgentApp3:05 PM
Three are open: 1182, 1190 and 1204, $12,480 in all. 1182 is 30 days past due. The list is attached.fernhill-unpaid.csvCSV
Asleep
Today
Jonah Reyes11:15 AM
any of those paid yet?
Support AgentApp11:15 AM
Yes, 1190 was paid on Oct 19. 1182 and 1204 are still open, $7,930 between them.
Reply…

Human in the loop

Approve agent actions in Slack

Mark a tool as needing approval, or give a tool server an approval policy in its definition, and the agent stops before the call. Its reply shows the exact call, and a one-word answer in the thread sends it on its way.

Add one line to the tool.

needsApproval: true, // the run stops and waits for a person before each call
Support AgentApp10:41 AM

It hasn't shipped, so I can refund order 4471 in full.

Approve this action? shop__refund (shop) with {"orderId":"4471"}
Reply approve or deny.

  1. The real call
    The tool and where it comes from, as camelRun sees it, not as the model describes it.
  2. Exact arguments
    An approved call runs with exactly these. A denied one never runs.
  3. A one-word answer
    approve · approved · yes · ydeny · denied · no · nCapitals and a period are fine.

Who can say yes

The person who asked, and the approvers you name in the definition, as slack:U07N6T1VB8. The model can't answer for them.

Questions, answered with a number

With the ask_user built-in, the agent asks the same way and picks up from the answer.

Support AgentWhich warehouse should ship the replacement? 1. Dallas 2. Rotterdam
Maya Chen2
Support AgentRotterdam it is. I'll set up the replacement from there.

Setup

Build a Slack agent with your own Slack app

Make the app in Slack. Two values go to camelRun, one URL comes back, and every thread that mentions the app has an agent. Slack sends its events straight to camelRun, so you run no server to listen for them.

Create a Slack app and install it
api.slack.com/appsSupport AgentAcme
OAuth & Permissions
Bot User OAuth Token
xoxb-••••••••a91f Copy
Bot Token Scopes
app_mentions:readchat:writeim:historychannels:historygroups:historyfiles:readfiles:write
Basic Information
Signing Secret
••••••••3c2eShow
Add a Slack channel in the console
run.camelai.com/console/channels
New Slack channel

Each thread where someone @mentions the app, and each DM, gets its own agent. Create a Slack app with the bot scopes app_mentions:read, chat:write, im:history, channels:history, files:read and files:write, install it, and paste its bot token and signing secret. Then paste the webhook URL into the app's Event Subscriptions and subscribe to app_mention, message.im and message.channels.

Service
Slack
Bot token
••••••••••••••••••
Signing secret
••••••••••••••••••
Definition
Support
Then the console shows
run.camelai.com/console/channels
Edit Slack @support_agent
Webhook URL
https://run.camelai.com/channels/slack/ch_4b1e9c07a2d35f8e6b10Paste it into Event Subscriptions → Request URL.
Paste it into Event Subscriptions
api.slack.com/appsSupport AgentAcme
Event Subscriptions
Enable Events
Request URL
https://run.camelai.com/channels/slack/ch_4b1e9c07a2d35f8e6b10Verified
Subscribe to bot events
app_mentionmessage.immessage.channels
Invite the app to a channel and mention it

That thread has its agent. Set the channel up in the console or with one REST call, and the channel docs walk through every setting.

Slack AI agent questions

How do I build a Slack AI agent?

Create a Slack app and install it. In the camelRun console, add a Slack channel with the app's bot token and signing secret, and a definition with your model, instructions and tools. Paste the channel's webhook URL into Event Subscriptions, then mention the app.

How does the agent connect to Slack?

Through your own Slack app. Slack sends each message to the channel's webhook URL, camelRun checks its signature with your signing secret, and the agent replies in the thread with your bot token. Your token and secret are only ever shown masked.

Does the agent remember the thread?

Yes. Each thread gets its own agent, and it keeps the thread's history until you delete it. Replies in the thread reach it without another mention, and it knows who sent each message. A DM is its own conversation with its own agent.

Can it use my company's tools?

Yes. Write tools as functions in your own app and serve them over HTTPS with serveTools, or connect MCP servers and OpenAPI specs. Each call says which Slack channel, thread and member it is for, so your tools can check what that person may do.

Can it ask before it does something?

Yes. Mark a tool as needing approval and the agent's reply ends with the exact call and "Reply approve or deny." The person who asked, or an approver you name, answers in the thread. The agent sleeps until then and carries on from that step.

Can it follow up later in the same thread?

Yes. Give the agent the schedule built-in and it can set its own wake-ups. A turn started by a schedule or by your code posts into the same thread, and any file the agent shares is posted there too.

Which AI models can a Slack agent use?

Any model in camelRun's catalog, including Claude, GPT, Gemini, DeepSeek, Kimi, Qwen and Mistral, set in the channel's definition. Tokens cost $0 on your own provider keys, or the provider's price on camelRun's keys, with no markup on tokens.

How much does a Slack AI agent cost to run?

Agent time costs $0.01 per agent-hour while an agent is in a run, and storage costs $0.10 per GB-month. A thread's agent that is waiting for a reply costs only storage. Billing is prepaid credit with no subscription, no seats and no per-agent fee.

Put an AI agent in
every Slack thread

$0.01 per agent-hour while it runs, and a thread's agent that's waiting costs only storage.

Set up with your coding agent

Read https://run.camelai.com/SKILL.md and set up camelRun in this project. Ask me what the agent should do.

Paste into Claude Code, Codex, Cursor or any coding agent. It asks what your agent should do, then builds it.