AWS - S3 Storage
在 Amazon S3 或兼容 S3 的存储上上传、下载、列出和删除对象。
使用 AWS SDK v3 对兼容 S3 的存储桶执行一次 S3 操作(getObject、putObject、listObjects 或 deleteObject),并将 SDK 结果放在 result 中返回。
连接你的 AWS 账户,自动化对象存储操作:存储文件、获取文档、列出存储桶内容,以及管理对象生命周期。
操作:
- Get Object: 按键下载对象内容。
- Put Object: 将内容上传到存储桶中的指定键。
- List Objects: 列出存储桶中的对象,可按前缀过滤。
- Delete Object: 按键删除对象。
工作原理
- 解析节点配置中的表达式。若
connection_id、bucket、operation、key或body为空,worker 会从输入项($json)读取同名字段。 - 必须提供
connection_id、bucket和operation。 - 在服务端解析凭据。支持的类型:
object、basic-auth或custom,需包含accessKeyId和secretAccessKey(或access_key_id/secret_access_key),可选region(默认us-east-1)和endpoint。设置自定义endpoint后客户端改用 path-style 寻址。 - 发送命令:
getObject读取key并以 UTF-8 字符串返回内容;putObject将body上传到key;listObjects以key作为前缀列出存储桶;deleteObject删除key。 - 成功时经
out返回{ result }。任何失败(包括校验错误)都以{ error }经error返回;节点不会抛出异常。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-read-report",
"label": "Read daily report",
"operator_slug": "integrations.aws.s3.storage",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"bucket": "reports",
"operation": "getObject",
"key": "daily/{{ $json.date }}.csv"
}
}{
"ok": true,
"data": {
"result": "order_id,total\nord_123,129.99\n"
},
"port": "out"
}配置
-
connection_idstring 必填 -
兼容 S3 的存储账户凭据。接受 `object`(或 `basic-auth` / `custom`)类型的凭据,字段为 `{ accessKeyId, secretAccessKey, region?, endpoint? }`。AWS 不支持 `connection-string` 形式的凭据。
-
bucketstring 必填 支持表达式 -
要操作的 S3 存储桶名称。
-
operationstring 必填 -
要执行的存储操作。
-
keystring 可选 支持表达式 -
对象在存储桶中的路径/键(例如“reports/2024/summary.pdf”)。
-
bodystring 可选 支持表达式 -
作为对象正文上传的内容(字符串或 base64)。
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
key - 在
listObjects中作为Prefix使用(为空则列出整个存储桶),尽管表单只在其他操作中显示该字段。 -
body - 按原样上传。base64 字符串会作为文本存储,worker 不会解码。
-
connection_id - 以
{开头的值会被解析为内联 JSON 设置(accessKeyId、secretAccessKey、region、endpoint),并跳过凭据库。仅用于本地测试;在工作流中请使用已保存的凭据。
输出端口
out 默认 S3 调用成功。getObject 时 result 为对象内容字符串;其他操作时为 SDK 原始响应(例如 listObjects 的 Contents、KeyCount、IsTruncated,或 putObject 的 ETag)。
{
"result": "order_id,total\nord_123,129.99\n"
}error 校验、凭据解析或 S3 调用失败。
{
"error": "The specified key does not exist."
}在表达式中
后续节点可通过 $("AWS - S3 Storage").item.json.<路径> 读取此节点输出中的内容(请把 AWS - S3 Storage 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("AWS - S3 Storage").item.json.resultS3 操作结果或元数据 |
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
connection_id is required | error | 配置和输入项中都没有凭据。bucket is required 与 operation is required 同理。 |
Unknown operation: <operation> | error | operation 不是 getObject、putObject、listObjects 或 deleteObject 之一(区分大小写)。 |
Credential <connection_id> has unsupported type '<type>' for integrations.aws.s3.storage. Use 'object' with { accessKeyId, secretAccessKey, region?, endpoint? }. | error | 凭据类型为 connection-string 或 api-key。请改存为 object 类型凭据。 |
Credential <connection_id> missing accessKeyId / secretAccessKey | error | 凭据密钥中缺少这两个字段之一。 |
Failed to resolve connection <connection_id>: <detail> | error | 凭据不存在、对当前组织不可用,或无法连接后端。 |
The specified key does not exist. | error | 对不存在的键执行 getObject 时的 S3 错误。其他 S3 错误(AccessDenied、NoSuchBucket)也按原样传递。 |
输入契约
-
connection_idstring 必填 -
bucketstring 必填 -
operationstring 必填 -
keystring 可选 -
bodystring 可选
输出契约
-
resultobject 可选 -
S3 操作结果或元数据
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "integrations.aws.s3.storage",
"name": "AWS - S3 Storage",
"category": "integrations",
"version": "1.0.0",
"description": "Upload, download, list, and delete objects on Amazon S3 or S3-compatible storage.\n\n Connect your AWS account and automate object storage operations — store files, retrieve documents, list bucket contents, and manage object lifecycle.\n\n **Operations:**\n - **Get Object:** Download an object's content by key.\n - **Put Object:** Upload content to a specific key in the bucket.\n - **List Objects:** List objects in a bucket with optional prefix filtering.\n - **Delete Object:** Remove an object by key.",
"capabilities": [
"storage",
"s3",
"files",
"aws",
"cloud"
],
"group": [
{
"key": "aws",
"name": "AWS",
"icon_url": "/icons/integrations/aws/aws.svg"
}
],
"icon_url": "/icons/integrations/aws/s3.svg",
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "AWS S3 Credential",
"description": "Credential for your S3-compatible storage account. Accepts credentials of type `object` (or `basic-auth` / `custom`) with fields `{ accessKeyId, secretAccessKey, region?, endpoint? }`. AWS does not support `connection-string` style credentials.",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"object",
"basic-auth",
"custom"
],
"types": [
"s3"
]
}
},
"bucket": {
"type": "string",
"title": "Bucket",
"description": "Name of the S3 bucket to operate on.",
"format": "expression"
},
"operation": {
"type": "string",
"title": "Operation",
"enum": [
"getObject",
"putObject",
"listObjects",
"deleteObject"
],
"default": "getObject",
"description": "The storage operation to perform."
},
"key": {
"type": "string",
"title": "Object Key",
"description": "Path/key of the object in the bucket (e.g., \"reports/2024/summary.pdf\").",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"getObject",
"putObject",
"deleteObject"
]
}
}
},
"body": {
"type": "string",
"title": "Content",
"description": "Content to upload as the object body (string or base64).",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"putObject"
]
}
}
}
},
"required": [
"connection_id",
"bucket",
"operation"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"bucket": {
"type": "string"
},
"operation": {
"type": "string"
},
"key": {
"type": "string"
},
"body": {
"type": "string"
}
},
"required": [
"connection_id",
"bucket",
"operation"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "S3 operation result or metadata"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Result",
"description": "Operation result (content, metadata, or list)",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Storage operation failed",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"standard-io",
"cloud-io"
],
"tags": [
"storage",
"cloud",
"aws"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://sommatic.ai",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "AWS S3 Credential",
"description": "Credential for your S3-compatible storage account. Accepts credentials of type `object` (or `basic-auth` / `custom`) with fields `{ accessKeyId, secretAccessKey, region?, endpoint? }`. AWS does not support `connection-string` style credentials.",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"object",
"basic-auth",
"custom"
],
"types": [
"s3"
]
}
},
"bucket": {
"type": "string",
"title": "Bucket",
"description": "Name of the S3 bucket to operate on.",
"format": "expression"
},
"operation": {
"type": "string",
"title": "Operation",
"enum": [
"getObject",
"putObject",
"listObjects",
"deleteObject"
],
"default": "getObject",
"description": "The storage operation to perform."
},
"key": {
"type": "string",
"title": "Object Key",
"description": "Path/key of the object in the bucket (e.g., \"reports/2024/summary.pdf\").",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"getObject",
"putObject",
"deleteObject"
]
}
}
},
"body": {
"type": "string",
"title": "Content",
"description": "Content to upload as the object body (string or base64).",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"putObject"
]
}
}
}
},
"required": [
"connection_id",
"bucket",
"operation"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"bucket": {
"type": "string"
},
"operation": {
"type": "string"
},
"key": {
"type": "string"
},
"body": {
"type": "string"
}
},
"required": [
"connection_id",
"bucket",
"operation"
]
}{
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "S3 operation result or metadata"
}
}
}[
{
"port_id": "out",
"label": "Result",
"description": "Operation result (content, metadata, or list)",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Storage operation failed",
"is_default": false,
"supports_condition": false
}
]执行
- 执行方式
async- 有状态
- 否
- 凭据
- 在服务器端根据
connection_id解析,密钥不会进入工作流。 - 能力
storages3filesawscloud- 标签
storagecloudaws
说明与限制
listObjects只返回一页(按 S3 API 最多 1,000 个键),不会发送续传令牌。对于大量数据,请检查IsTruncated并缩小前缀范围。getObject会将内容按文本解码,二进制对象(PDF、图片)无法完整返回。- 不重试:调用失败直接进入
error。
已对照编排器代码核实 · 31e874b · 2026-11-26