Portal Community
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

Configuration

Connection

FieldRequiredDescription
botTokenRequiredBot 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

FieldRequiredDescription
channelRequiredChannel ID containing the message to delete. Must match the channel the message was originally posted to.
messageTsRequiredTimestamp 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 CodeCause
message_not_foundNo message exists with the given messageTs in the specified channel. The message may have already been deleted, or the timestamp is incorrect.
cant_delete_messageThe 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_foundThe specified channel does not exist or is not accessible to the bot token.
VAL_MISSING_CHANNELThe channel field is empty or not provided.
VAL_MISSING_TSThe messageTs field is empty or not provided.

Output

Success Port

Fires after Slack confirms the message has been permanently deleted.

FieldTypeDescription
deletedbooleantrue on successful deletion.
channelstringChannel ID from which the message was deleted.
messageTsstringTimestamp of the deleted message (for audit logging purposes).
statusstring"ok" on success.
errorCodestringEmpty on success.
payloadobjectFull 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.

FieldTypeDescription
statusstring"error"
errorCodestringSlack error code, e.g. message_not_found, cant_delete_message.
payloadobjectFull 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

FieldExpressionNotes
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 AreaRecommendation
Irreversibility warningDeletion 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 earlyCapture messageTs from the message/send success port immediately using a VariableAssignment node. Do not rely on reconstructing it later.
Same token requirementThe 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 gracefullyIn 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 deleteFor 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 TTLWhen 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 storageStore 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.