Skip to content

Slack Integration

Orvanta enables two-way integration with Slack: triggering Orvanta scripts from Slack commands and using the Slack API from Orvanta scripts.

A workspace admin must connect Slack through the UI or CLI. Navigate to Workspace Settings and select the “Slack Command” tab, then click “Connect to Slack.” Slack will request permission to access your workspace.

After connecting Slack, create a script to handle /orvanta commands. The template receives parameters including:

  • response_url (webhook for responding)
  • text (command text)
  • channel_id, user_name, user_id, command, trigger_id, api_app_id

Example response:

export async function main(response_url: string, text: string) {
await fetch(response_url, {
method: 'POST',
body: JSON.stringify({ text: `ROGER ${text}` })
});
}

Beyond slash commands, mention the Orvanta bot in channels or direct messages. The bot mention is stripped automatically before passing text to the handler. The command parameter is set to "@mention" to distinguish from slash commands.

  • Slash commands: Use the response_url parameter (webhook)
  • @mentions: Use the Slack Web API with bot token to post messages

Workspace admins can configure their own Slack app credentials in workspace settings for isolation and independent management. This overrides instance-level defaults.

Configuration via CLI:

slack_oauth_client_id: "1234567890.1234567890"
slack_oauth_client_secret: "abcdef0123456789"

Share resources and variables with the automatically created slack group. Alternatively, host resources in folders assigned to the slack group for simpler permission management.

View who executed commands via the Runs page. Access the Slack username through the contextual variable WM_USERNAME within scripts.

Use Orvanta’s Python and TypeScript clients to request interactive approvals from Slack. Forms display as modals in Slack messages:

await orvanta.requestInteractiveSlackApproval({
slackResourcePath: "/u/username/my_slack_resource",
channelId: "admins-slack-channel",
message: "Please approve this request"
});

Navigate to the Resources page and add a Slack resource via OAuth. This allows Orvanta scripts to interact with Slack on your behalf.

Use the Slack Web API client to send messages:

import { WebClient } from 'https://deno.land/x/@slack/web-api@6.7.0/mod.ts';
type Slack = { token: string };
export async function main(text: string, channel: string, slack: Slack) {
const web = new WebClient(slack.token);
await web.chat.postMessage({ channel, text });
}

Messages appear under your Slack identity when using user tokens, or under the Orvanta bot identity when using bot tokens.

Slack efficiently notifies of Orvanta run errors. See the Error handling documentation for details.

Enterprise feature: receive alerts for job crashes, license renewal failures, workspace error handler failures, worker threshold drops, and queue depth issues.

Setup requirements:

  1. Configure SMTP in instance settings
  2. Connect instance to Slack
  3. Specify alert channel

Worker group-specific alerts can be configured separately.

For more Slack scripts, flows, and apps, visit the Orvanta Hub.