Build a Slack File Backup Bot
Automate Slack file backups to AWS S3 with a no-code n8n workflow.
Introduction
30 Second Summary
Important files get shared in chat every day. Documents, screenshots, reports. They scroll out of sight and disappear into the history, making them nearly impossible to find when you actually need them.
In this project, you will build a Slack bot that automatically backs up every file shared in a channel to cloud storage on AWS S3.
What You'll Build
A complete file backup automation powered by n8n that monitors a Slack channel for uploads, stores each file in an organized date-based folder on S3, and posts a confirmation message back to Slack.
By the end of this project, you'll have:
- A Slack App with bot permissions installed in your own workspace.
- An S3 bucket configured as your file archive with date-organized folders.
- A live n8n workflow that triggers on file shares, uploads to S3, and confirms in Slack.
- Secret Mission: Add smart file routing that automatically sorts files into subfolders by type (images, documents, other).
Are there any prerequisites?
You need an active n8n Cloud account and an AWS account with console access. Both offer free tiers that cover this project at no cost.
Before We Start
Before We Start...
Set Up Your Slack Workspace and App
Every team has experienced it. Someone shares a critical file in Slack, and weeks later, nobody can find it buried in the chat history.
In this step, you'll create a Slack workspace and build a Slack App with the permissions it needs to watch for file uploads. This app becomes the foundation of your backup bot.
In this step, get ready to:
- Create a Slack workspace and configure a bot app with file-related permissions.
- Set up a dedicated backup channel and invite your bot to it.
Create your Slack workspace and app
Your bot needs a home. You'll create a free Slack workspace, then register a Slack App that the bot will live inside.
- Open your browser and go to slack.com.
- Click Sign Up (or Create a new workspace if you already have an account) and follow the prompts to create a free workspace.
- Name your workspace anything you like (e.g., "File Backup Test").
- Once you're inside your workspace, open a new browser tab and go to api.slack.com/apps.
- Click Create New App.
- Select From scratch.
- Enter File Backup Bot as the app name.
- Select your new workspace from the dropdown menu.
- Click Create App.
What is a Slack App?
A Slack App is a container that holds your bot's identity, permissions, and event subscriptions. It's the official way to extend Slack with custom functionality.
The app itself doesn't do anything until you give it permissions (scopes) and connect it to an automation tool like n8n.
Now you'll give your app the permissions it needs to read files, read channel history, and post messages.
- In the left sidebar of your app's settings page, click OAuth & Permissions.
- Scroll down to the Scopes section.
- Under Bot Token Scopes, click Add an OAuth Scope.
- Add the scope channels:history.
- Click Add an OAuth Scope again and add channels:read.
- Add chat:write as a third scope.
- Add files:read as a fourth scope.
What do these scopes do?
- channels:history lets the bot see messages and events in channels it belongs to.
- channels:read lets the bot see basic information about public channels.
- chat:write lets the bot post messages to channels.
- files:read lets the bot access and download files shared in channels.
With scopes configured, install the app to your workspace to activate the bot.
- Scroll back up to the top of the OAuth & Permissions page.
- Click Install to Workspace.
- On the authorization page, click Allow.
- You'll be redirected back to the OAuth & Permissions page. Copy the Bot User OAuth Token (it starts with xoxb-) and save it somewhere safe, like a text file or password manager.
Keep your token private
This token gives full access to your bot's permissions. Treat it like a password. Never share it publicly or commit it to a repository.
Don't see Install to Workspace?
Make sure you've added at least one Bot Token Scope. The install button only appears after you configure scopes.
If you see a message about admin approval, your workspace may have app approval enabled. Since you created this workspace, you are the owner and can approve the app yourself from the admin panel.
Help me troubleshoot installing my Slack App to my workspace.
Create a channel and invite the bot
Your bot needs to know which channel to watch for file uploads. You'll create a dedicated channel and add the bot to it.
- Switch back to your Slack workspace tab in the browser.
- In the left sidebar, click the + icon next to Channels.
- Select Create a new channel.
- Enter file-archive as the channel name.
- Click Create.
- If prompted to add members, click Skip for now or close the dialog.
Now add your bot to the channel so it can listen for file uploads.
- In the #file-archive channel, click the channel name at the top of the conversation to open channel details.
- Select the Integrations tab.
- Click Add an App.
- Search for File Backup Bot and select it.
You should see a message in the channel confirming that File Backup Bot has been added.
Why add the bot to the channel?
Even though your bot is installed to the workspace, it can only see messages and file events in channels where it's been explicitly added. This keeps bots from accessing conversations they shouldn't see.
Don't see your app in the Integrations list?
Make sure you completed the Install to Workspace step. The app only appears in the integrations list after it's been installed and authorized.
If you still don't see it, try refreshing the Slack page in your browser.
Help me add my File Backup Bot to the #file-archive channel.
A note about Event Subscriptions
There's one more piece of configuration your Slack App needs: Event Subscriptions. This tells Slack to notify your bot whenever a file is shared.
However, configuring Event Subscriptions requires a webhook URL from n8n, which you don't have yet. You'll complete this configuration in Step 3 after you build the workflow.
Why can't we do this now?
Slack's Event Subscriptions require a live URL that responds to a verification challenge. The n8n Slack Trigger node generates this URL. So you need the n8n workflow first, then you come back to configure Slack. This is a common chicken-and-egg pattern in webhook-based integrations.
Your Slack App is configured and waiting in its channel. Next up, you'll set up AWS S3 to give your bot a place to store all those backed-up files.
Set Up AWS S3 and Connect Credentials
Your Slack bot is configured and ready to detect file uploads. Now it needs somewhere to store those files permanently.
Amazon S3 is a cloud storage service that can hold any type of file. In this step, you'll create an S3 bucket, set up a dedicated IAM user with the right permissions, and connect your AWS credentials to n8n so the workflow can upload files on your behalf.
In this step, get ready to:
- Create an S3 bucket to store backed-up files.
- Create an IAM user with permission to upload files to your bucket.
- Add your AWS credentials to n8n so the workflow can access S3.
Create an S3 bucket for file storage
Your bot needs a dedicated storage container in AWS where every backed-up file will live. S3 organizes files into "buckets," each with a globally unique name.
- In the AWS Console, type S3 in the top search bar and select the S3 service.
- Click Create bucket.
- In the Bucket name field, enter a unique name like slack-file-backup-yourname (replace yourname with your actual name to make it globally unique).
- For AWS Region, select your preferred region (e.g., us-east-1).
- Leave all other settings as their defaults. Confirm that Block all public access is checked (it should be ON by default).
- Scroll to the bottom and click Create bucket.
Why block all public access?
These are private backup files from your Slack workspace. Blocking public access ensures only your IAM credentials can read or write to this bucket. No one else on the internet can see your files.
You should see your new bucket listed on the S3 Buckets page with a green "Successfully created bucket" banner at the top.
Seeing a "Bucket name already exists" error?
S3 bucket names are globally unique across all AWS accounts. If someone else already used that name, try adding extra characters like your initials or a number (e.g., slack-file-backup-jd-2026).
Help me pick a unique S3 bucket name for my Slack file backup project.
Create an IAM user for n8n access
Your n8n workflow needs its own set of credentials to upload files to S3. You'll create a dedicated IAM user with just the permissions it needs.
- In the AWS Console search bar, type IAM and select the IAM service.
- In the left sidebar, click Users.
- Click Create user.
- Enter n8n-s3-bot as the user name.
- Leave the Provide user access to the AWS Management Console checkbox unchecked (this user only needs programmatic access).
- Click Next.
- On the permissions page, select Attach policies directly.
- In the search box, type AmazonS3FullAccess and check the box next to that policy.
- Click Next, then click Create user.
What is AmazonS3FullAccess?
This is a managed AWS policy that grants full read and write access to all S3 buckets in your account. It's broader than strictly needed, but appropriate for a learning project.
In a production environment, you would create a custom policy scoped to only your specific bucket.
Now you need to generate an access key for this user so n8n can authenticate.
- On the Users page, click n8n-s3-bot to open the user details.
- Click the Security credentials tab.
- Scroll down to Access keys and click Create access key.
- Select Third-party service as the use case.
- Check the confirmation acknowledgment box, then click Next.
- Click Create access key.
- Copy both the Access Key ID and the Secret Access Key and paste them somewhere safe (a temporary note, password manager, etc.).
Save your Secret Access Key now
AWS only shows the Secret Access Key once at creation time. If you close this page without copying it, you will need to delete the key and create a new one. Make sure you have both values saved before moving on.
Add AWS credentials to n8n
With your access key ready, you can now connect n8n to your AWS account so it can upload files to S3 on behalf of your bot.
- Switch back to your n8n Cloud browser tab.
- In the left sidebar, click Credentials.
- Click Add Credential (or the Create button in the upper-left corner, then select Credential).
- Search for AWS and select the AWS credential type.
- In the Region field, enter the same region you chose for your S3 bucket (e.g., us-east-1).
- In the Access Key ID field, paste the Access Key ID you copied from AWS.
- In the Secret Access Key field, paste the Secret Access Key you copied from AWS.
- Click Save. n8n automatically tests the credential when you save it.
What happens when you save?
When you save a credential in n8n, it automatically runs a test to confirm the connection works. You should see a success message confirming that n8n can reach your AWS account with these credentials.
You should see a green success indicator confirming the credential is valid and connected.
Credential test failed?
Double-check that the Region matches exactly what you set for your S3 bucket (e.g., us-east-1 not US East 1). Make sure you pasted the full Access Key ID and Secret Access Key with no trailing spaces.
Help me troubleshoot my AWS credential connection in n8n.
Your cloud storage is connected and ready to receive files. Next up, you'll build the actual n8n workflow that ties Slack file uploads, S3 storage, and confirmation messages together.
Build the Backup Workflow
Your credentials are configured and your tools are connected. Now it's time to build the actual automation that ties Slack, S3, and n8n together into a single pipeline.
The workflow has three parts: a trigger that detects file uploads in Slack, an S3 node that stores the file in your bucket, and a Slack node that posts a confirmation message back to the channel.
In this step, get ready to:
- Create the n8n workflow and configure the Slack Trigger node.
- Add the AWS S3 Upload node with a date-based file path.
- Add a Slack message node that confirms each backup.
Create the workflow and configure the Slack Trigger
The Slack Trigger node is the entry point for your automation. It listens for events from Slack and kicks off the workflow whenever a file is shared.
- Switch back to your n8n Cloud dashboard.
- Click the + button (or Create Workflow) to create a new workflow.
- Click the workflow name at the top and rename it to Slack File Backup Bot.
Now add the trigger node that will listen for file uploads.
- Click the + node on the canvas (or click Add first step) to open the node panel.
- Search for Slack Trigger and select it.
- In the Credential dropdown, click Create New Credential.
- Paste your Bot User OAuth Token (the xoxb- token from Step 1) into the Access Token field.
- Click Save to store the credential.
- Back in the Slack Trigger node, set Events to File Shared.
- Expand the Options section and toggle Download Files to on.
Why enable Download Files?
When Download Files is on, the Slack Trigger node automatically downloads the file's binary content (image, PDF, document) and attaches it to the output. The AWS S3 node in the next step can consume this binary data directly without any extra conversion.
Now grab the webhook URL that Slack needs in order to send events to n8n.
- At the top of the Slack Trigger node panel, click Production URL to toggle the displayed URL to the production version.
- Copy this Production Webhook URL. You will paste it into Slack in the next few steps.
Why use the Production URL?
n8n provides two webhook URLs per trigger node: a Test URL (active for 120 seconds while testing) and a Production URL (active whenever the workflow is published). Since your bot runs continuously, you need the Production URL.
Slack only allows one Request URL per app. If you use the Test URL now, you would need to swap it later.
Now configure Slack to send file events to that URL.
- Open a new browser tab and go to api.slack.com/apps.
- Select your File Backup Bot app.
- In the left sidebar, click Event Subscriptions.
- Toggle Enable Events to On.
- Paste your n8n Production Webhook URL into the Request URL field.
What happens when you paste the URL?
Slack immediately sends a verification challenge to your URL. The n8n Slack Trigger node handles this automatically by responding with the correct challenge value. Once verified, you will see a green checkmark next to the URL field.
- Scroll down to Subscribe to bot events and click Add Bot User Event.
- Search for and select file_shared.
- Click Save Changes at the bottom of the page.
URL verification failed?
If Slack does not verify the URL, make sure you copied the Production URL (not the Test URL) from the n8n Slack Trigger node. The Production URL must be active for Slack to reach it. Save your n8n workflow first, then retry pasting the URL in Slack.
help me fix the Slack Event Subscriptions URL verification
Add the AWS S3 Upload node
With the trigger in place, you need a node that takes the downloaded file and stores it in your S3 bucket under an organized folder path.
- Return to your n8n workflow tab.
- Click the + connector on the right side of the Slack Trigger node to add a new node.
- Search for AWS S3 and select it.
- In the Credential dropdown, select the AWS credential you configured in the previous step.
- Set Operation to Upload.
- In the Bucket Name field, enter your bucket name (e.g., slack-file-backup-yourname).
- In the File Name field, click the Expression tab (the gears icon) and enter this expression:
{{ $now.format('yyyy/MM/dd') }}/{{ $json.file.name }}
What does this expression do?
This creates a date-based folder path for every file. For example, a file uploaded today would be stored at 2026/06/12/report.pdf. The $now.format('yyyy/MM/dd') part generates today's date as a folder path. The $json.file.name part uses the original filename from Slack.
The binary data from the Slack Trigger (with Download Files enabled) is automatically available to the S3 node for upload. No extra configuration is needed.
Don't see the Expression tab?
Click the small icon to the right of the File Name field to switch between fixed value and expression mode. In expression mode, you can type or paste the expression above directly.
help me find where to enter expressions in the n8n S3 node
Add the Slack confirmation message
The final node posts a message back to your channel confirming that the file was backed up successfully.
- Click the + connector on the right side of the AWS S3 node to add a new node.
- Search for Slack and select the Slack node (not Slack Trigger).
- In the Credential dropdown, select the Slack credential you created earlier in this step.
- Set Resource to Message.
- Set Operation to Send a Message.
- In the Channel field, select #file-archive from the dropdown.
- In the Message Text field, click the Expression tab and enter this expression:
Backed up *{{ $('Slack Trigger').item.json.file.name }}* ({{ $('Slack Trigger').item.json.file.size }} bytes) to S3 path: {{ $now.format('yyyy/MM/dd') }}/{{ $('Slack Trigger').item.json.file.name }}
What does this message expression do?
This builds a confirmation message with the file name in bold (using Slack's *asterisk* formatting), the file size in bytes, and the full S3 path where the file was stored.
The $('Slack Trigger').item.json syntax references data from the Slack Trigger node specifically, so you always get the original file details even after the S3 upload step.
Now activate the workflow so it runs automatically whenever a file is shared.
- Close the Slack node panel.
- In the top-right corner of the workflow editor, toggle the Active switch to on.
- Save the workflow if prompted.
Your workflow is now live. You should see three nodes connected in a chain: Slack Trigger, AWS S3, and Slack.
Workflow won't activate?
Make sure all three nodes have valid credentials selected and no red error indicators. If the Slack Trigger shows an error, confirm that the Event Subscriptions Request URL in Slack was verified successfully (green checkmark).
help me figure out why my n8n workflow won't activate
Your automation is live and listening. Next up, you will test the full pipeline by uploading real files to Slack and confirming they land in S3.
Test Your File Backup Bot
You have a fully wired automation sitting ready to go. The Slack Trigger listens for file uploads, the AWS S3 node stores them, and the confirmation node replies in your channel.
Now it is time to prove the whole pipeline works end-to-end. You will upload real files into Slack, watch your n8n workflow fire automatically, and verify the files land in the correct date-based folder inside your S3 bucket.
In this step, get ready to:
- Upload a test file to Slack and trigger the backup workflow.
- Verify the file appears in S3, the confirmation posts in Slack, and the execution succeeds in n8n.
- Test with a second file type to confirm reliability across different formats.
Upload a test file
The fastest way to trigger your workflow is to share a file directly in your archive channel. Any file type will work.
- Switch to your Slack workspace and open the #file-archive channel.
- Drag and drop any file into the message area. An image, a PDF, or a document all work.
- Press Enter or click the send button to share the file in the channel.
- Wait about 5-10 seconds for the workflow to trigger.
What happens behind the scenes?
When you share a file, Slack fires a file_shared event to your n8n webhook URL. n8n downloads the file binary data, uploads it to S3 under today's date path, then posts a confirmation message back in the channel.
Verify the backup worked
A successful run produces three observable signals. Check all three to confirm end-to-end success.
- In #file-archive, look for a new message from File Backup Bot confirming the file name, size, and S3 path.
- Return to your n8n workflow and click the Executions tab in the top menu.
- Confirm the latest execution shows a Success status with all three nodes completed.
- Switch to the AWS Console and open the S3 service.
- In the left navigation pane, choose General purpose buckets.
- Click your bucket name (e.g., slack-file-backup-yourname).
- On the Objects tab, click into the year folder, then the month folder, then the day folder (e.g., 2026/06/12).
- Confirm your uploaded file appears inside the date folder.
What should I see in S3?
S3 uses prefixes to simulate folders. Your workflow creates a path like 2026/06/12/yourfile.png. In the console, this looks like nested folders you can click into until you reach your file.
File not showing up?
Make sure your workflow is toggled to Active in n8n. An inactive workflow will not respond to Slack events.
Check that the bot is still in the #file-archive channel. If you removed it accidentally, type /invite @File Backup Bot in the channel to re-add it.
Open the Executions tab in n8n. If you see a failed execution, click into it to inspect which node errored and read the error message for clues.
Help me troubleshoot why my Slack file backup bot is not triggering or uploading files to S3.
Test with different file types
One successful upload is a great start. Testing with a second file type confirms your workflow handles any format reliably.
- Return to the #file-archive channel in Slack.
- Upload a different file type than your first test. For example, if you first uploaded an image, try a PDF or a text document.
- Wait a few seconds for the workflow to trigger again.
- Check Slack for a second confirmation message from the bot with the new file details.
- In the AWS Console, return to your S3 bucket and navigate into today's date folder.
- Confirm the second file also appears alongside the first one.
- In n8n, check the Executions tab to verify a second successful execution is listed.
Keep an eye on your execution count
Each file upload consumes one execution from your n8n Cloud trial allowance of 1000 executions. Testing a handful of files is perfectly fine, but avoid uploading dozens of files in rapid succession during testing.
Second file not appearing?
If the first file worked but the second did not, check whether the n8n execution failed by reviewing the Executions tab. A common issue is a filename with special characters that S3 does not accept.
Why did my second file upload fail in n8n even though the first one succeeded?
Secret mission
Smart File Type Routing
Your backup bot dumps everything into one folder. What if it could automatically sort images, documents, and other files into their own subfolders? Add conditional logic to make your archive browsable at a glance.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. S3 storage is covered by the AWS Free Tier (5 GB free for 12 months), and your n8n Cloud trial includes 1000 executions over 14 days.
Cost warning
After the AWS Free Tier expires (12 months), S3 storage costs approximately $0.023 per GB per month. After your n8n Cloud trial ends (14 days), the workflow will stop executing unless you upgrade to a paid plan. If you are not planning to continue using these resources, choose Pause or Delete below.
Resources you used:
- AWS S3 bucket (slack-file-backup-yourname) storing your backed-up files.
- AWS IAM user (n8n-s3-bot) with an access key for n8n.
- n8n Cloud workflow (Slack File Backup Bot) and associated credentials (AWS, Slack).
- Slack App (File Backup Bot) installed in your workspace.
- Slack workspace and #file-archive channel.
Keep everything running
No action needed. Choose this if you are still actively using the bot or plan to continue building on this project.
- Your bot will keep backing up files every time someone shares in #file-archive.
- Monitor your n8n execution count on the n8n Cloud dashboard to stay within your trial limit.
- Monitor your S3 storage under the AWS Free Tier limit of 5 GB.
Pause - I'll come back to this later
Shut down the running workflow to stop consuming executions. Your S3 bucket, files, and Slack App remain intact for when you return.
- In n8n Cloud, open your workflow and toggle the **Active** switch to off (deactivate the workflow).
- Your S3 bucket and all backed-up files remain untouched.
- Your Slack App stays installed but will not trigger any actions while the workflow is paused.
- To resume later, toggle the workflow back to Active in n8n.
Delete - I don't want to use this again
Remove all project resources and start fresh. Follow each step below to fully clean up.
Delete the n8n workflow and credentials
- In n8n Cloud, open the Slack File Backup Bot workflow.
- Click the three-dot menu in the top right and select Delete.
- Go to Credentials in n8n Cloud, find your AWS credential and Slack credential, and delete each one.
Delete the S3 bucket
- In the AWS Console, open S3.
- Select your bucket (slack-file-backup-yourname) and click Empty.
- Type permanently delete to confirm, then click Empty.
- After the bucket is empty, select it again and click Delete.
- Type the bucket name to confirm, then click Delete bucket.
Delete the IAM user
- In the AWS Console, open IAM.
- In the left navigation pane, choose Users.
- Select the checkbox next to n8n-s3-bot and click Delete at the top of the page.
- Type the username n8n-s3-bot in the confirmation dialog, then click Delete.
Delete the Slack App
- Go to api.slack.com/apps and select your File Backup Bot app.
- Scroll down to Settings in the left sidebar, then click Basic Information.
- Scroll to the bottom of the page and click Delete App.
- Confirm the deletion when prompted.
Delete the Slack workspace (optional)
- If you created this workspace only for this project, you can delete it entirely.
- In Slack on desktop, click Admin in the sidebar.
- Select Workspace settings from the menu.
- Scroll down to Delete Workspace and click Delete Workspace.
- Check the confirmation box, enter your password, and click Yes, delete my workspace.
Nice Work!
Nice Work!
You just built a fully automated file backup bot that watches your Slack channel and archives every shared file to AWS S3. No code, no cron jobs, just event-driven automation running 24/7 on n8n Cloud.
You've learned how to:
- Built and configured a Slack App with bot permissions and event subscriptions for real-time file monitoring.
- Created an AWS S3 bucket with an IAM user and access policies for automated file storage.
- Wired together a complete n8n workflow connecting a Slack file trigger to S3 upload to Slack confirmation, and tested it with real files organized in date-based folders.
- Secret Mission: Added intelligent file type routing that automatically categorizes uploads into images/, documents/, and other/ subfolders automatically.
Ready to quiz yourself?