Overview
Refrain provides two messaging features:- Approval — Before executing a step marked with
requiresConfirmation: true, a message with Approve / Skip / Abort buttons is sent to your team channel. Execution pauses until someone responds. - Notification — After execution completes, a summary card is sent with success/failure counts, execution time, and failed step details.
HITL approval via Slack/Teams/Discord requires Business or higher. Notifications require Team or higher.
Approval workflow
When a step hasrequiresConfirmation: true, the executor:
- Sends a card message to the configured channel with step details and risk level
- Pauses execution and waits for a response
- Resumes based on the response:
- Approve — Executes the step
- Skip — Skips the step and continues
- Abort — Stops the entire execution
Notification
After execution completes (success or failure), a summary card is posted with:- Total steps, success count, failure count, skipped count
- Execution duration
- Failed step details (if any)
Platform setup
- Slack
- Teams
- Discord
1. Create a Slack App
- Go to api.slack.com/apps and click Create New App → From scratch
- Name it (e.g.,
refrain) and select your workspace
2. Add Bot Token Scopes
Go to OAuth & Permissions → Bot Token Scopes and add:| Scope | Purpose |
|---|---|
chat:write | Send messages (approval requests, notifications) |
files:write | Upload report files |
3. Install to workspace
Click Install to Workspace and copy the Bot User OAuth Token (xoxb-...).4. Invite the bot to a channel
In Slack, run/invite @refrain in the target channel.Find the channel ID: right-click the channel name → View channel details → the ID is at the bottom (format: C0123456789).5. Enable Interactivity (approval only)
If using--approval-mode slack:- Go to Interactivity & Shortcuts → Turn On
- Set Request URL to
https://<your-domain>/webhooks/slack
--notify slack only.6. Set environment variables
CLI example
CLI examples
Approval only:Troubleshooting
Slack shows 'This didn't work' after clicking a button
Slack shows 'This didn't work' after clicking a button
Approval times out and execution aborts
Approval times out and execution aborts
The callback is not reaching the executor. Verify that the callback endpoint is accessible from the internet and the Request URL is correctly configured.
'not_in_channel' error
'not_in_channel' error
The bot hasn’t been invited to the channel. Run
/invite @your-bot-name in the target channel.