Bots
A bot is an agent that you configure for one job. You tell it when to start and what to do, and it runs on its own. Each run is a thread, so you can read every step and every tool call of the run.
Polylane already turns alerts into issues, investigates them, checks deploys and watches for security risks without a bot. Use a bot for work that is specific to your team, such as a weekly cost review, a check after each deploy of one service, or a first answer to each alert in a Slack channel.
Create a bot
Open Bots in the console. You can start in three ways:
- From a template. Templates lists ready bots for deploys, alerts, errors, reliability, performance, costs, databases, engineering and product. The templates that use your connected tools show first.
- With the bot builder. Describe the job in a few words. The builder asks what it needs to know and fills in the bot as you talk: the name, the instructions, the triggers and the channels. Review the draft and save it.
- From a channel list. When you connect Slack, Polylane finds the channels where alerts land. Add Polylane next to a channel adds it to the Alert Responder bot. One Alert Responder watches every channel that you add, and the first channel creates it.
When a bot starts
A bot can have several triggers. Each run starts from one of them.
| Trigger | When the bot starts |
|---|---|
| Event | Something happens in Polylane or a connected tool: an alert fires or resolves, an issue is triaged, a deploy finishes, a pull request or a push lands, a Linear issue changes, a Slack message is posted, and more. Filters narrow the event, for example to one repository or one service. |
| Schedule | On a cron schedule, in the time zone you pick. A schedule fires at most once every 5 minutes. |
| Webhook | When something sends a POST to the bot's webhook URL. The request body goes to the bot as text. You can replace the URL, and the old URL stops working at once. |
| Watched channel | When a bot or an app posts a new message, such as an alert, in a Slack channel that the bot watches. You can also let people, or only the people and bots that you select, start the bot. |
| Mention | When someone writes @Polylane <handle> <request> in Slack. |
| Run now | When you click Run now on the bot, or call the API. |
Delay makes the bot wait after a trigger before it starts, for example to let a deploy settle.
What a bot does
What to do holds the bot's instructions: the goal, the steps, what the report contains, and any rules. Skills add Polylane's playbooks, such as incident investigation. A bot uses the same tools as a chat thread, so it can read your logs, metrics, code, deploys and topology.
At the end of each run, the bot writes a report and decides whether it is worth posting. A run that finds nothing to say posts nothing.
Where a bot posts
- A run that starts from a watched channel or a mention answers in the Slack thread of that message. Replies in that thread continue the same run.
- Any other run posts a new message in each channel that the bot watches.
- A bot that watches no channel keeps its report in the run's thread in Polylane.
In Slack, the bot posts under its own name and face.
Watch a Slack channel
Under Slack, Watches lists the public channels that the bot watches, up to 50. Polylane joins each channel when you save. Answers sets the messages that start the bot:
- All bots, the default. The bot answers each message that a bot or an app posts, such as an alert from Datadog, Sentry or Checkly. When people talk in the channel, the bot does not reply.
- All bots and people. The bot also answers each message from a person that asks a question about production or reports a problem, and it skips small talk.
- Selected people and bots. The bot answers only the people and the bots that you pick from your Slack, for example only Checkly. A message from a selected person starts the bot only when it asks about production or reports a problem.
When the bot starts on a message, Polylane adds a reaction to it, and the bot works and replies in the message's thread as a mention of Polylane does. The bot skips replies in threads, its own posts, and messages that mention Polylane, which start a normal mention instead.
In Slack, /polylane watch in a public channel adds that channel to the Alert Responder bot, and creates the bot the first time. /polylane unwatch stops the bots that watch the channel.
Watching channels needs the Team plan or above.
Manage bots
- Runs on a bot's page lists every run as a thread.
- Configuration holds all of the bot's settings.
- Edit with Polylane opens the bot builder with the bot's current settings. Tell the builder what to change, review the draft, and click Save changes. Only the settings that changed are saved. If someone changed the bot after you opened the builder, Polylane does not save, so that your changes do not replace theirs. Open the builder again from the bot.
- Disable stops the bot's events, schedules, webhook calls and watched channels until you enable it again. Run now and Slack mentions still work.
- Who can see it makes a bot private to you, or visible to a team or the whole workspace.
- Labels group and filter bots in the list.
Bot runs use credits like any other thread. The Free plan includes 1 bot and the Starter plan 3. Higher plans have no bot limit.
Use bots from the API and from agents
The /v1/bots routes create, change, run and delete bots. They need the bots:read, bots:write and bots:delete scopes. A run starts a thread, so POST /v1/bots/run also needs threads:write. To set watchFrom to selected, find the ids of the people and bots for watchSenders with GET /v1/integrations/{workspaceId}/slack/{id}/users, which needs integrations:read. To change a bot with the builder, start a session with POST /v1/bots/builder and its botId, then save with PATCH /v1/bots/{workspaceId}/{id} and the session's builderId. See the API reference.
Agents connected through the Polylane MCP can manage bots through the same routes.
Related
- Threads: every run of a bot is a thread.
- Slack: connect Slack so that bots can post and watch channels.
- Billing and usage: plans and credits.