Deletion is permanent. Slack does not provide an undo for deleted messages. Once a message is deleted, it cannot be recovered — including any replies, reactions, and file attachments associated with it. Always confirm the correct messageTs before using this operation in automated production workflows.
When to Use
- Temporary status notifications: Delete "Processing your request..." or "Build queued..." messages after the workflow completes. Replacing transient status messages with a final result keeps the channel uncluttered.
- Expiring time-sensitive alerts: Automatically remove maintenance window announcements, flash sale alerts, or emergency notifications after their validity window expires.
- Error recovery: A workflow detects that a malformed or incorrect notification was sent (wrong data, wrong channel). Delete the bad message and send a corrected version.
- Test and CI cleanup: Automated test workflows post test messages to verify Slack integration, then delete them after the assertion passes — keeping test channels clean.
- Sensitive data removal: A workflow temporarily posts a transient access token or one-time code to a DM for a user, then immediately deletes it after a short TTL to minimize exposure window.
Configuration
Connection
| Field | Required | Description |
botToken | Required | Bot Token in xoxb-... format. Must have chat:write scope and must be the same token that sent the original message. Store in BizFirst Credentials Manager. |
Operation
| Field | Required | Description |
channel | Required | Channel ID containing the message to delete. Must match the channel the message was originally posted to. |
messageTs | Required | Timestamp of the message to delete (e.g. 1716700412.087200). This is the messageTs returned by the original message/send node. This is the message's unique identifier within its channel. |
Sample Configuration
{
"resource": "message",
"operation": "delete",
"botToken": "{{ $credentials.slackBotToken }}",
"channel": "{{ $vars.statusChannel }}",
"messageTs": "{{ $vars.processingMessageTs }}"
}
Validation Errors
| Error Code | Cause |
message_not_found | No message exists with the given messageTs in the specified channel. The message may have already been deleted, or the timestamp is incorrect. |
cant_delete_message | The bot token is not the original sender and does not have admin delete permissions. Only the original sender or a workspace admin can delete a message. |
channel_not_found | The specified channel does not exist or is not accessible to the bot token. |
VAL_MISSING_CHANNEL | The channel field is empty or not provided. |
VAL_MISSING_TS | The messageTs field is empty or not provided. |
Output
Success Port
Fires after Slack confirms the message has been permanently deleted.
| Field | Type | Description |
deleted | boolean | true on successful deletion. |
channel | string | Channel ID from which the message was deleted. |
messageTs | string | Timestamp of the deleted message (for audit logging purposes). |
status | string | "ok" on success. |
errorCode | string | Empty on success. |
payload | object | Full raw Slack API response. |
Error Port
Fires when the message cannot be found, the bot is not the original sender, or the API call fails.
| Field | Type | Description |
status | string | "error" |
errorCode | string | Slack error code, e.g. message_not_found, cant_delete_message. |
payload | object | Full raw Slack error response. |
Sample Output
{
"deleted": true,
"channel": "C04STATUSCH1",
"messageTs": "1716700412.087200",
"status": "ok",
"errorCode": "",
"payload": {
"ok": true,
"channel": "C04STATUSCH1",
"ts": "1716700412.087200"
}
}
Expression Reference
| Field | Expression | Notes |
| Deletion confirmed | {{ $output.deleteMsg.deleted }} | true when successfully deleted. Use in downstream audit log writes. |
| Deleted from channel | {{ $output.deleteMsg.channel }} | Channel ID the message was removed from — record this in audit logs. |
| Deleted message TS | {{ $output.deleteMsg.messageTs }} | Timestamp of the deleted message — use in audit log records to reference the original message. |
| Operation status | {{ $output.deleteMsg.status }} | "ok" on success. Check before proceeding to cleanup steps. |
| Error code | {{ $output.deleteMsg.errorCode }} | Non-empty on failure — log for monitoring and alerting. |
Node Policies & GuardRails
| Policy Area | Recommendation |
| Irreversibility warning | Deletion is permanent and cannot be undone. In automated workflows, add a guard condition (e.g. IfCondition) before the delete node to verify the message timestamp and channel are correct and expected. |
| Store messageTs early | Capture messageTs from the message/send success port immediately using a VariableAssignment node. Do not rely on reconstructing it later. |
| Same token requirement | The bot token used for delete must be the same token that sent the original message. Cross-token deletion requires workspace admin-level token scope. |
| Handle already-deleted gracefully | In retry scenarios, a message_not_found error likely means the message was already deleted. Consider this a success case in idempotent cleanup workflows — use an IfCondition on the error port to branch appropriately. |
| Audit log before delete | For compliance-sensitive workflows, write the message content, channel, and timestamp to an audit database before deleting. Once deleted, Slack does not retain the message content. |
| Sensitive data TTL | When deleting messages containing sensitive data (OTPs, transient credentials), chain the message/delete node immediately after the message/send success port with a Delay node in between for the intended visibility window (e.g. 30 seconds). |
| Credential storage | Store the Bot Token in BizFirst Credentials Manager. Never hard-code xoxb- tokens inline. |
Examples
Delete Temporary "Processing" Message
// Step 1 — Post the temporary status message (message/send node)
{
"resource": "message",
"operation": "send",
"botToken": "{{ $credentials.slackBotToken }}",
"channel": "C04REQUESTCH",
"text": ":hourglass: Processing your report request... This may take a minute."
}
// Step 2 — After processing completes, delete it (message/delete node)
{
"resource": "message",
"operation": "delete",
"botToken": "{{ $credentials.slackBotToken }}",
"channel": "C04REQUESTCH",
"messageTs": "{{ $output.sendProcessing.messageTs }}"
}
// Step 3 — Post the final result (message/send node)
{
"resource": "message",
"operation": "send",
"botToken": "{{ $credentials.slackBotToken }}",
"channel": "C04REQUESTCH",
"text": ":white_check_mark: Your report is ready: <{{ $output.generateReport.downloadUrl }}|Download Report>"
}
A three-step pattern: post a "Processing..." message, run the actual report generation, delete the processing message, then post the final result. The channel only shows the outcome, not the in-progress state.
Expiring Announcement Cleanup
{
"resource": "message",
"operation": "delete",
"botToken": "{{ $credentials.slackBotToken }}",
"channel": "C04GENERAL01",
"messageTs": "{{ $input.announcementTs }}"
}
A scheduled workflow (e.g. triggered 24 hours after posting) deletes a time-limited announcement. The announcementTs is stored in a database record when the announcement is first posted and retrieved here via an earlier database lookup node.
CI Test Message Cleanup
{
"resource": "message",
"operation": "delete",
"botToken": "{{ $credentials.slackTestBotToken }}",
"channel": "C04TESTCHAN1",
"messageTs": "{{ $output.postTestMessage.messageTs }}"
}
After an integration test posts a message to #bot-test-channel and asserts the expected content was received, this cleanup node removes the test message. The test channel remains clean for subsequent test runs without accumulating test artifacts.