n8n AI-gesteuerter AWS S3-Manager mit Audit-Logs (Slack/ChatOps-Workflows)
Dies ist ein DevOps, AI Chatbot-Bereich Automatisierungsworkflow mit 16 Nodes. Hauptsächlich werden AwsS3Tool, Agent, GoogleSheetsTool, ChatTrigger, LmChatOpenAi und andere Nodes verwendet. Verwaltung von AWS S3 mit GPT-4-Agenten und Google Tabellen-Audit-Logs über Slack
- •AWS Access Key und Secret
- •Google Sheets API-Anmeldedaten
- •OpenAI API Key
Verwendete Nodes (16)
Kategorie
{
"id": "0mnXbzHdP3r7Uk5p",
"meta": {
"instanceId": "e145bfb15cacc90e0d1ae6ee743e6744f8fc7108de50458700cb2ae620dc5ca5",
"templateCredsSetupCompleted": true
},
"name": "AI-Powered AWS S3 Manager with Audit Logging in n8n (Slack/ChatOps Workflow)",
"tags": [
{
"id": "zVkByIt5M465W2a8",
"name": "aws",
"createdAt": "2025-09-12T06:14:33.823Z",
"updatedAt": "2025-09-12T06:14:33.823Z"
}
],
"nodes": [
{
"id": "e61c5d1b-7c6a-486a-b7ab-8af828dfb2e1",
"name": "OpenAI-Chat-Modell",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-160,
736
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "tnXtbK3d66hDjxXa",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "198007d2-5b4f-449e-8e6b-b54c76bf394a",
"name": "Simple Speicher",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-32,
736
],
"parameters": {
"contextWindowLength": 10
},
"typeVersion": 1.3
},
{
"id": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"name": "AWS S3 Manager Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
280,
512
],
"parameters": {
"options": {
"systemMessage": "You are an intelligent assistant for managing AWS S3 via natural language.\n\nYou are equipped with 7 tools:\n\n1. ListBuckets — to list all available S3 buckets.\n2. ListObjects — to list files in a specific bucket or prefix.\n3. CopyObject — to copy a file from one bucket/key to another.\n4. DeleteObject — to delete a file from an S3 bucket.\n5. ListFolders — to list top-level folders using S3 prefixes.\n6. CreateFolder — to create a new folder using a zero-byte object with a trailing slash.\n7. AddAuditLog — to log all tool calls to Google Sheets (via appendOrUpdate: sheet).\n\nYour responsibilities:\n\n- Parse user requests, determine intent, and call the appropriate S3 tool.\n- Immediately after executing **any of the first 6 tools**, you **must call the `AddAuditLog` tool** with full context.\n- **Do NOT call AddAuditLog** if:\n - You didn’t call any operational tool\n - The tool being executed is already `AddAuditLog` (to avoid loops)\n\n---\n\n### The audit log entry (AddAuditLog) should include:\n\n```json\n{\n \"timestamp\": \"<UTC timestamp>\",\n \"tool\": \"<ToolName used>\",\n \"parameters\": { /* tool call parameters */ },\n \"status\": \"success\",\n \"user\": {\n \"name\": \"<if available>\",\n \"source\": \"<e.g., Slack, Telegram>\"\n },\n \"chat_prompt\": \"<original user message>\",\n \"tool_call_reasoning\": \"<why this tool was chosen>\"\n}"
}
},
"typeVersion": 2.2
},
{
"id": "d8acd9a1-bd45-4953-82ae-bb27ef449011",
"name": "Bei Chat-Nachricht empfangen",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-384,
512
],
"webhookId": "7d48edec-7760-43f3-87da-c4721a69468a",
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "28fc7970-7fd7-44b3-bf4e-1281c322bb65",
"name": "Get many buckets in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
96,
736
],
"parameters": {
"resource": "bucket",
"operation": "getAll",
"returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "ddea4199-a84f-4c66-8764-18bb609ec4e7",
"name": "Get many files in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
224,
736
],
"parameters": {
"options": {},
"operation": "getAll",
"returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
"bucketName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Bucket_Name', ``, 'string') }}"
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "faf57b94-3073-47e6-ac88-5203fb2d9ad6",
"name": "Copy a file in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
352,
736
],
"parameters": {
"operation": "copy",
"sourcePath": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Source_Path', ``, 'string') }}",
"destinationPath": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Destination_Path', ``, 'string') }}",
"additionalFields": {}
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "2099f8fa-d295-47f3-a014-2d22b35f4676",
"name": "Delete a file in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
480,
736
],
"parameters": {
"fileKey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('File_Key', ``, 'string') }}",
"options": {},
"operation": "delete",
"bucketName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Bucket_Name', ``, 'string') }}"
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "0b5fc6f0-43e2-4000-b58e-6ffe240d99bf",
"name": "Get many folders in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
608,
736
],
"parameters": {
"options": {},
"resource": "folder",
"operation": "getAll",
"returnAll": "",
"bucketName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Bucket_Name', ``, 'string') }}"
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "71afb290-a9e8-4ac7-bf02-09687ab630cd",
"name": "Create a folder in AWS S3",
"type": "n8n-nodes-base.awsS3Tool",
"position": [
736,
736
],
"parameters": {
"resource": "folder",
"bucketName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Bucket_Name', ``, 'string') }}",
"folderName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Folder_Name', ``, 'string') }}",
"additionalFields": {}
},
"credentials": {
"aws": {
"id": "Q5gor70maeAQPEU4",
"name": "AWS account 2"
}
},
"typeVersion": 2
},
{
"id": "046374dc-9b0f-460a-85a6-5e53ba2648d4",
"name": "Append or update row in sheet in Google Tabellen",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
864,
736
],
"parameters": {
"columns": {
"value": {},
"schema": [],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aaDJ9ZAt2LLpZDFcXjVaYW57JwyruCrl5UJWejG1ZTk/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1aaDJ9ZAt2LLpZDFcXjVaYW57JwyruCrl5UJWejG1ZTk",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aaDJ9ZAt2LLpZDFcXjVaYW57JwyruCrl5UJWejG1ZTk/edit?usp=drivesdk",
"cachedResultName": "AWS S3 Audit Logs"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "7zk8xcj4pNU6f1WM",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "df1923d0-a7b5-44a4-808e-380d4784b007",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-96
],
"parameters": {
"color": 6,
"width": 832,
"height": 1856,
"content": "# AI-Powered AWS S3 Manager with Audit Logging in n8n (Slack/ChatOps Workflow)\n> This n8n workflow empowers users to manage AWS S3 buckets and files using natural language via Slack or chat platforms. Equipped with an OpenAI-powered Agent and integrated audit logging to Google Sheets, it supports operations like listing buckets, copying/deleting files, managing folders, and automatically records every action for compliance and traceability.\n## 👥 Who’s it for\nThis workflow is built for:\n- DevOps engineers who want to manage AWS S3 using natural chat commands.\n- Technical support teams interacting with AWS via Slack, Telegram, etc.\n- Automation engineers building ChatOps tools.\n- Organizations that require **audit logs** for every cloud operation.\n\nUsers don’t need AWS Console or CLI access — just send a message like “Copy file from dev to prod”.\n## ⚙️ How it works / What it does\nThis workflow turns natural chat input into **automated AWS S3 actions** using an OpenAI-powered AI Agent in n8n.\n### 🔁 Workflow Overview:\n1. **Trigger**: A user sends a message in Slack, Telegram, etc.\n2. **AI Agent**: \n - Interprets the message\n - Calls one of 6 S3 tools:\n - `ListBuckets`\n - `ListObjects`\n - `CopyObject`\n - `DeleteObject`\n - `ListFolders`\n - `CreateFolder`\n3. **S3 Action**: Performs the requested AWS S3 operation.\n4. **Audit Log**: Logs the tool call to Google Sheets using `AddAuditLog`:\n - Includes timestamp, tool used, parameters, prompt, reasoning, and user info.\n\n## 🛠️ How to set up\n### Step-by-step Setup:\n1. **Webhook Trigger**\n - Slack, Telegram, or custom chat platform → connects to n8n.\n\n2. **OpenAI Agent**\n - Model: `gpt-4` or `gpt-3.5-turbo`\n - Memory: Simple Memory Node\n - Prompt: Instructs agent to always follow tool calls with an `AddAuditLog` call.\n\n3. **AWS S3 Nodes**\n - Configure each tool with AWS credentials.\n - Tools:\n - `getAll: bucket`\n - `getAll: file`\n - `copy: file`\n - `delete: file`\n - `getAll: folder`\n - `create: folder`\n\n4. **Google Sheets Node**\n - Sheet: `AWS S3 Audit Logs`\n - Operation: `Append or Update Row`\n - Columns (must match input keys): \n - `timestamp`, `tool`, `status`, `chat_prompt`, `parameters`, `user_name`, `tool_call_reasoning`\n\n5. **Agent Tool Definitions**\n - Include `AddAuditLog` as a 7th tool.\n - Agent calls it **immediately after every S3 action** (except when logging itself).\n\n## ✅ Requirements\n- [ ] n8n instance with AI Agent feature\n- [ ] OpenAI API Key\n- [ ] AWS IAM user with S3 access\n- [ ] Google Sheet with required columns\n- [ ] Chat integration (Slack, Telegram, etc.)\n\n## 🧩 How to customize the workflow\n| Feature | Customization Tip |\n|----------------------|--------------------------------------------------------------|\n| 🌎 Multi-region S3 | Let users include region in the message or agent memory |\n| 🛡️ Restricted actions| Use memory/user ID to limit delete/copy actions |\n| 📁 Folder filtering | Extend `ListObjects` with prefix/suffix filters |\n| 📤 Upload file | Add `PutObject` with pre-signed URL support |\n| 🧾 Extra logging | Add IP, latency, error trace to audit logs |\n| 📊 Reporting | Link Google Sheet to Looker Studio for audit dashboards |\n| 🚨 Security alerts | Notify via Slack/Email when `DeleteObject` is triggered |"
},
"typeVersion": 1
},
{
"id": "a0f2d80c-3e15-4316-82a2-10145760e966",
"name": "Haftnotiz1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
352
],
"parameters": {
"color": 5,
"height": 112,
"content": "### **Webhook Trigger**\nSlack, Telegram, or custom chat platform → connects to n8n."
},
"typeVersion": 1
},
{
"id": "e099afbd-5f92-40d3-aa3e-c22e719c0574",
"name": "Haftnotiz2",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
256
],
"parameters": {
"color": 5,
"height": 208,
"content": "\n### **OpenAI Agent**\n - Model: `gpt-4` or `gpt-3.5-turbo`\n - Memory: Simple Memory Node\n - Prompt: Instructs agent to always follow tool calls with an `AddAuditLog` call."
},
"typeVersion": 1
},
{
"id": "2e6816bd-f7b4-4332-ae3f-864410083a6e",
"name": "Haftnotiz3",
"type": "n8n-nodes-base.stickyNote",
"position": [
304,
928
],
"parameters": {
"color": 5,
"width": 304,
"height": 256,
"content": "### **AWS S3 Nodes**\n - Configure each tool with AWS credentials.\n - Tools:\n - `getAll: bucket`\n - `getAll: file`\n - `copy: file`\n - `delete: file`\n - `getAll: folder`\n - `create: folder`"
},
"typeVersion": 1
},
{
"id": "da526631-6758-4c91-be12-7d279a8e7fd0",
"name": "Haftnotiz4",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
928
],
"parameters": {
"color": 5,
"height": 256,
"content": "### **Google Sheets Node**\n - Sheet: `AWS S3 Audit Logs`\n - Operation: `Append or Update Row`\n - Columns (must match input keys): \n - `timestamp`, `tool`, `status`, `chat_prompt`, `parameters`, `user_name`, `tool_call_reasoning`"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "ac313ae3-60e9-4145-8c45-72c3192a96f2",
"connections": {
"Simple Memory": {
"ai_memory": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"b57e9ec2-dd1d-496d-947f-40f1c18e5506": {
"main": [
[]
]
},
"faf57b94-3073-47e6-ac88-5203fb2d9ad6": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"2099f8fa-d295-47f3-a014-2d22b35f4676": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"ddea4199-a84f-4c66-8764-18bb609ec4e7": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"71afb290-a9e8-4ac7-bf02-09687ab630cd": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"28fc7970-7fd7-44b3-bf4e-1281c322bb65": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"0b5fc6f0-43e2-4000-b58e-6ffe240d99bf": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "main",
"index": 0
}
]
]
},
"Append or update row in sheet in Google Sheets": {
"ai_tool": [
[
{
"node": "b57e9ec2-dd1d-496d-947f-40f1c18e5506",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Experte - DevOps, KI-Chatbot
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Trung Tran
@trungtranEmpowering small and medium businesses with smart automation and practical AI, no big tech team required. Youtube channel: youtube.com/@theStackExplorer
Diesen Workflow teilen