Slack Integration
Overview
Section titled “Overview”Orvanta enables two-way integration with Slack: triggering Orvanta scripts from Slack commands and using the Slack API from Orvanta scripts.
Action on Orvanta from Slack
Section titled “Action on Orvanta from Slack”Setup requirements
Section titled “Setup requirements”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.
Using slash commands
Section titled “Using slash commands”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}` }) });}Using @mentions
Section titled “Using @mentions”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.
Responding to different trigger types
Section titled “Responding to different trigger types”- Slash commands: Use the
response_urlparameter (webhook) - @mentions: Use the Slack Web API with bot token to post messages
Workspace-level Slack app configuration
Section titled “Workspace-level Slack app configuration”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"Permissions and groups
Section titled “Permissions and groups”Share resources and variables with the automatically created slack group. Alternatively, host resources in folders assigned to the slack group for simpler permission management.
Monitoring and auditing
Section titled “Monitoring and auditing”View who executed commands via the Runs page. Access the Slack username through the contextual variable WM_USERNAME within scripts.
Approval steps
Section titled “Approval steps”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"});Action on Slack from Orvanta
Section titled “Action on Slack from Orvanta”Creating a Slack resource
Section titled “Creating a Slack resource”Navigate to the Resources page and add a Slack resource via OAuth. This allows Orvanta scripts to interact with Slack on your behalf.
Publishing messages
Section titled “Publishing messages”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.
Error handling and alerts
Section titled “Error handling and alerts”Error handlers
Section titled “Error handlers”Slack efficiently notifies of Orvanta run errors. See the Error handling documentation for details.
Critical alerts
Section titled “Critical alerts”Enterprise feature: receive alerts for job crashes, license renewal failures, workspace error handler failures, worker threshold drops, and queue depth issues.
Setup requirements:
- Configure SMTP in instance settings
- Connect instance to Slack
- Specify alert channel
Worker group-specific alerts can be configured separately.
For more Slack scripts, flows, and apps, visit the Orvanta Hub.