Skip to content

How to build a Slack and Teams agent

People ask for help in Slack and Teams, not in another app. Run the agent there, and keep approval and the run log where they belong.

Last reviewed November 2026

App, built with Tray Helix

The short answer

A Tray Helix agent can work in Slack and Microsoft Teams in two ways. The app can call Slack's and Teams' APIs directly, with the credentials held by Tray. Or a Tray workflow can listen for the message, call the agent's API route with a Helix API token, and post the answer back. Either way the agent is the same one that runs in the app, with the same tools, approvals and logs.

it-help.helix-app.ai

IT Help

#it-help: "I need access to the finance dashboard"

Slack · Asked by Tom Reyes · 14:05

Channel
Slack, through a Tray workflow
Agent
IT access agent
Tool waiting
grantAccess, needs approval
Reply
Posted in thread: "Request sent to the dashboard owner."

Agent run

  • 14:05 Workflow received the Slack message and called the agent route Tray workflow
  • 14:05 Looked up the dashboard owner Agent
  • 14:06 Paused: grantAccess needs approval Agent
  • 14:06 Replied in the Slack thread Tray workflow
A sketch of a Slack request. The message, the agent's steps and the approval all show under one run.

What matters here

  • A Tray Helix agent can work in Slack and Microsoft Teams through their APIs from the app, or through a Tray workflow.
  • The Slack and Teams credentials are held by Tray, so they never sit in the agent's code.
  • The agent in chat is the same agent as in the app, with the same tools, approval and run log.
  • Approval still applies in chat: a write pauses the run and an approver sees the tool and exact input.
  • A Tray workflow is the simplest way in: it listens for the message, calls the agent's route with a Helix API token, and posts the reply.

Who this is for

You have built, or are about to build, an agent in Tray Helix, and the people who need it live in Slack or Teams. You want them to ask there without a second copy of the agent.

How it works in practice

A question in a channel, the same agent, and a reply in the thread.

  1. 1

    Someone asks in a channel

    They mention the agent in Slack or Teams, or message it directly.

  2. 2

    The message reaches the agent

    A Tray workflow triggered by the message calls the agent's API route with a Helix API token, or the app reads it through the Slack or Teams API.

  3. 3

    The agent works as usual

    Same tools, same limits. Reads run on their own.

  4. 4

    Writes wait for approval

    A tool marked for approval pauses the run, and the approver gets the tool and exact input.

  5. 5

    The reply lands in the thread

    The workflow or the app posts the answer back where the question was asked.

What a chat agent is made of

The agent you already have, an API route, and a way in from chat.

An agent in a Helix app

With its tools, approvals and limits, exactly as it runs in the app.

An API route

A route on the app that takes a message and a conversation ID and returns the agent's reply. Called with a Helix API token.

A way in from chat

A Tray workflow triggered by Slack or Teams messages, or the app calling the Slack and Teams APIs itself.

Threads as conversations

Each Slack or Teams thread maps to one agent conversation, so follow-ups keep their context.

The prompts

Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.

These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix.

1

Give the agent an API route

One way in for every channel.

Claude Code, Codex or Cursor

In my Helix app, add an API route for the agent.

It takes a message, a conversation ID and who is asking, runs the agent, and returns the reply. If the agent pauses for approval, return that it is waiting and what for.

Map each conversation ID to one agent conversation, so a follow-up in the same thread keeps its context. Keep conversations separate per user.

2

Post approvals and replies back to chat

The thread stays the place people look.

Claude Code, Codex or Cursor

When a run pauses for approval, post the request to the approvers' channel with the tool, the exact input and a link to approve in the app.

When the run finishes, post the reply in the thread the question came from.

Use the Slack API for Slack and the Microsoft Teams API for Teams, with credentials held in the workspace, never in code.

Approval happens in the app, behind its sign-in. Chat carries the notice and the link.
3

Connect the chat tools

Slack and Teams, or a workflow in between.

Claude Code, Codex or Cursor

Now connect it to the chat tools we actually run.

Anything in angle brackets is a placeholder. Swap it for whatever we use.

<Slack>. Post replies in threads and approval notices in the approvers' channel.

<Microsoft Teams>. The same, in Teams.

Incoming messages come from a Tray workflow that triggers on a mention or direct message and calls this app's agent route with a Helix API token.

Tray holds the Slack and Teams credentials as workspace authentications, so the app references a name and never the secret itself.
4

Ship it

A URL, and the channels on it.

Claude Code, Codex or Cursor

Deploy my app.

Your assistant runs helix deploy and the app comes back as a URL. Create a named Helix API token for the workflow, so you can revoke it on its own.

What it connects to

Two chat tools, one agent.

Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.

Running it for real

The build gets you an agent in chat. Running it means a token you can revoke, credentials out of the code, and one log for every channel.

  1. 1

    One agent, deployed once

    The agent ships with its app. Chat calls the same deployment, so you can roll back any deployment and every channel follows.

  2. 2

    A named token for each caller

    The workflow calls the agent with a Helix API token: a named API user that you can revoke, with every call logged.

  3. 3

    Chat credentials held by Tray

    The Slack and Teams credentials are held in Tray, not in the code, so they can be rotated without a redeploy.

  4. 4

    A named owner and every step logged

    Every run is logged under the message that started it, whatever channel it came from, and Tray streams the logs to your SIEM.

  5. 5

    Know what chat costs

    AI usage shows per app, so the agent's cost covers every channel in one place.

Questions people ask

Can a Tray Helix agent work in Slack or Microsoft Teams?

Yes. The app can call Slack's and Teams' APIs directly with credentials held by Tray, or a Tray workflow can listen for messages, call the agent's API route with a Helix API token and post the reply. It is the same agent either way.

Do approvals still apply when someone asks in Slack?

Yes. A tool marked for approval pauses the run whatever channel started it. The approver gets the tool and the exact input, and approves in the app.

Which is better, the app calling Slack or a Tray workflow?

A Tray workflow is the quickest way in: it triggers on the message and needs only the agent's route and a token. Calling the Slack or Teams API from the app suits replies and notices the app sends itself.

Does the agent remember the thread?

Yes. Each thread maps to one agent conversation, and conversations are kept separate per user.

Build it, then run it properly

Helix is the governed runtime for AI-built apps and agents. Deploy what you build, put SSO in front of it, connect it to your systems with managed credentials, and give it a named owner.