channel/archive
Archives a Slack channel, hiding it from all members' channel lists and preventing new messages from being posted. The channel and all its history are preserved and remain searchable. Use channel/unarchive to restore. Requires channels:manage scope.
Archiving hides the channel for all members. Members cannot post to an archived channel and it will no longer appear in their channel list. The channel name is blocked from reuse while archived. Use
channel/unarchive to restore access. This is the closest Slack has to "deleting" a channel — history is always preserved.
When to Use
- Project completion: Archive project channels after the final handoff is complete and the team no longer needs an active communication space for that work.
- Seasonal channel cleanup: Archive event or campaign channels at the end of a season or campaign (e.g.,
#hackathon-2024after the event concludes). - Workspace audit cleanup: As part of a periodic channel hygiene review, archive channels that have had no activity for 90+ days.
- Channel lifecycle automation: Part of a project lifecycle workflow — create on kickoff, archive on completion, with automatic notification to members before archiving.
Configuration
Connection
| Field | Type | Required | Description |
|---|---|---|---|
botToken | string | Required | Bot Token starting with xoxb-. Requires channels:manage scope. The bot must have admin permissions in some workspace configurations. |
Operation Fields
| Field | Type | Required | Description |
|---|---|---|---|
channelId | string | Required | The channel to archive. Starts with C (public) or G (private). |
Sample Configuration
{
"operation": "channel/archive",
"connection": {
"botToken": "{{credentials.slackBotToken}}"
},
"fields": {
"channelId": "{{$json.channelId}}"
}
}
Validation Errors
| Error Code | Cause | Resolution |
|---|---|---|
already_archived | The channel is already archived. | Check isArchived with channel/get before archiving. Treat this error as a warning, not a failure. |
cant_archive_general | Attempting to archive the workspace's #general channel. | The #general channel cannot be archived. Skip it in bulk archive workflows. |
not_authorized | The bot does not have permission to archive this channel. Some workspaces require admin-level permissions. | Check workspace settings. The operation may require workspace admin privileges beyond the bot's current scope. |
channel_not_found | Invalid channel ID. | Verify the channel ID with channel/get first. |
missing_scope | Bot token lacks channels:manage scope. | Re-authorize the Slack app with the required scope. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
channelId | string | The channel that was archived. |
status | string | success or error. |
errorCode | string | Slack error code when status is error. |
payload | object | Full raw Slack API response. |
Error Port
On failure with Continue on Error enabled, routes to the error port. For bulk archive workflows, treat already_archived and cant_archive_general as safe-to-ignore warnings.
Sample Output
{
"channelId": "C08PROJECT01",
"status": "success",
"errorCode": "",
"payload": {
"ok": true
}
}
Expression Reference
| Expression | Result |
|---|---|
{{$node["channel-archive"].json.channelId}} | Archived channel ID — use in audit log entries and completion notifications. |
{{$node["channel-archive"].json.status === "success"}} | Boolean confirmation — gate downstream archival notifications. |
Node Policies & GuardRails
| Policy Area | Recommendation |
|---|---|
| Scope requirements | Requires channels:manage scope. Some workspace configurations require workspace admin privileges to archive channels. |
| Rate limiting | Tier 2 (20+ req/min). For bulk archive operations, add delays between calls. |
| No hard-coded IDs | Always source channelId dynamically. Never hard-code channel IDs in archive configurations. |
| Archive instead of delete | Slack has no delete operation for channels. Archive is the permanent lifecycle end state. Archived channels preserve full history and are searchable. Do not try to recreate channels by name after archiving without unarchiving first. |
| Pre-archive notification | Always post a final message to the channel before archiving, informing members that the channel will be archived and where they should go for future communication. |
| General channel exception | Always filter out the #general channel from bulk archive workflows. Attempting to archive it returns cant_archive_general. |
Examples
Example 1 — Project Completion Archival Workflow
Full project lifecycle close-out: post final message, export history, then archive.
// Node 1: message/send — final notification
{
"channelId": "{{$json.channelId}}",
"text": "Project {{$json.projectName}} is now complete and marked as delivered. This channel will be archived in 24 hours. Post-mortem document: {{$json.documentUrl}}"
}
// Node 2 (24h later): channel/archive
{ "channelId": "{{$json.channelId}}" }
// Node 3: log archival to project management system
Example 2 — Inactive Channel Cleanup Audit
Monthly scheduled workflow that archives channels with no activity in 90 days.
// channel/getMany → all active channels
// For each channel: channel/getHistory (oldest: 90 days ago, limit: 1)
// IF: messageCount === 0
// channel/archive
const ninetyDaysAgo = (Date.now() / 1000 - 90 * 86400).toString();
// IF last message older than 90 days → archive
Example 3 — Post-Incident Channel Archive
After an incident is marked resolved in PagerDuty, archives the incident channel after exporting the thread.
// Trigger: incident resolved event
// Node 1: channel/getHistory → export to incident archive DB
// Node 2: message/send — "Incident resolved. Channel archived for records."
// Node 3: channel/archive
{ "channelId": "{{$json.incidentChannelId}}" }