Skip to main content
connic
Connectors

S3

Start agents from Amazon S3 bucket events, such as uploads, with the file content in the input if you want it.

Last updated
ModesInbound
YAML types3
CredentialsA Connection of type S3 with the AWS access key, needed only to download file content
BridgeOn the Connection, to download file content from S3-compatible storage in a private network
Custom domainSupported
Linked agentsOne or more. Each object event starts every linked agent.
While pausedNotifications get 404 and start no runs. connic doesn't store them. SNS subscription confirmations still go through.

Set up

  1. In AWS, note the bucket's name and region, and create an access key for an IAM user. connic uses the key only to download file content, which needs s3:GetObject on the bucket; see File content.

  2. Open the agent. In Connector Flow, click Add inbound connector, then Create New Connector, and select AWS S3.

  3. Enter the Bucket Name and, if needed, the Event Filters. To add file content to the input, turn on Include File Content under Processing Options, enter the bucket's AWS Region, and choose a Connection or create one with the AWS Access Key ID and AWS Secret Access Key; see Connection. Click Create.

  4. The details drawer shows the Webhook URL and Secret Key. To reopen it, hover over the connector in the flow and click the eye icon.

  5. Send the bucket's events to the webhook URL through Amazon SNS or Amazon EventBridge.

In code

Declare the connector in connectors/*.yaml. connection names the S3 Connection, so the file never contains the access key; a connector without include_content needs none. The first deploy generates the webhook URL and secret key, which then appear in the details drawer.

connectors/invoice-uploads.yaml
type: s3
connection: aws-uploads          # S3 Connection with the access key, needed for include_content
config:
  bucket_name: invoice-uploads
  prefix: incoming/
  suffix: .pdf
  include_content: true
  region: eu-central-1
  max_file_size_mb: 5
agents:
  - invoice-processor

Configuration

The fields of an S3 connector, the same in connectors/*.yaml, the REST API, and connic MCP. The descriptions name the matching setting in the dashboard. Connectors in code describes the fields every connector shares, such as agents and environments.

FieldTypeStatusDescription
typestringRequireds3.
connectionstringOptionalName or ID of the S3 Connection with the access key, the optional endpoint URL, and the Bridge. Required with include_content; otherwise the connector needs none. See Connection. Dashboard: Connection.
domainstringOptionalHostname or ID of an active custom domain for the webhook URL. Dashboard: Domain.
configobjectRequiredS3 settings.
bucket_namestringRequiredThe bucket to start runs for: letters, digits, hyphens, and dots. connic skips events from other buckets. Dashboard: Bucket Name.
prefixstringOptionalOnly keys that start with this value, such as incoming/. Removing it on a later deploy removes the filter. Dashboard: Key Prefix (Optional).
suffixstringOptionalOnly keys that end with this value, such as .pdf. Removing it on a later deploy removes the filter. Dashboard: Key Suffix (Optional).
event_typesstringOptionalcreated starts runs for every object-created event, such as Put, Post, Copy, and CompleteMultipartUpload. all also starts runs for every other event the bucket sends, such as deletes and restores. Dashboard: Event Types.Default: created
include_contentbooleanOptionalDownload created objects and add them to the input; see File content. Needs a connection and a region. Dashboard: Include File Content.Default: false
regionstringOptionalAWS region of the bucket, such as eu-central-1, used to download file content. Applies only with include_content: true, which requires it. Dashboard: AWS Region.
max_file_size_mbintegerOptionalLargest object to download, in MiB, from 1 to 32. Larger objects arrive without content. Dashboard: Max File Size (MiB).Default: 10

Connection

A Connection of type S3 holds these fields. connic uses it only to download file content, so a connector needs one only with include_content. Every S3 connector in the project can use it, and a connector's config doesn't take these fields. Manage Connections in Project Settings → Connections or through the REST API.

FieldTypeStatusDescription
aws_access_key_idstringRequiredAccess key ID of the IAM user. Dashboard: AWS Access Key ID.
aws_secret_access_keystringRequiredSecret access key of the IAM user. Secret. Dashboard: AWS Secret Access Key.
endpoint_urlstringOptionalOrigin of S3-compatible storage to download from, such as a MinIO server: scheme, host, and optional port, without credentials, path, query, or fragment. Leave it unset to download from AWS S3. Without a Bridge it must be a public HTTPS URL; with one, it can be a private http:// or https:// address. For https://, the storage needs a certificate from a public certificate authority that's valid for its hostname. Dashboard: Endpoint URL (Optional).
bridgestringOptionalName or ID of the Bridge that downloads from storage in a private network. Only together with endpoint_url; without one, connic downloads from AWS S3 directly and refuses a Bridge. The REST API and connic MCP take it as the Connection's top-level bridge, not in config. Dashboard: Bridge.

To use a different endpoint or Bridge per environment, give each environment its own Connection; see Connections and Bridges. When you change the access key ID, the endpoint URL, or the Bridge of a saved Connection, enter the secret access key again; connic refuses the change otherwise. Until April 30, 2027, connector files and requests can still set config.endpoint_url and bridge on the connector, as long as they match the Connection.

Generated values

connic creates these when the connector is created and keeps them across updates and deploys. Copy them from the details drawer. Leave webhook_secret out of YAML files; connic lint rejects it.

ValueDescription
Webhook URLThe address the bucket's notifications go to. It uses the connector's custom domain when one is set.
Secret KeyThe secret every notification must carry. See Event notifications.

Event notifications

S3 doesn't call webhook URLs itself. Send the bucket's events through Amazon SNS or Amazon EventBridge. Every request must carry the secret key in the X-Connic-Secret header, an Authorization: Bearer header, or the secret query parameter.

Amazon SNS

Subscribe the webhook URL to an SNS topic with the secret key as ?secret=, and send the bucket's events to the topic. The topic's access policy must allow S3 to publish to it. connic confirms the subscription, checks the AWS signature of every SNS message, and unwraps the S3 event. The subscription is confirmed even while the connector is paused.

terminal
# 1. Create a topic
aws sns create-topic --name s3-events

# 2. Subscribe the webhook URL, with the secret key
aws sns subscribe \
  --topic-arn arn:aws:sns:eu-central-1:123456789012:s3-events \
  --protocol https \
  --notification-endpoint '<webhook-url>?secret=<secret>'

# 3. Send the bucket's object-created events to the topic
aws s3api put-bucket-notification-configuration \
  --bucket invoice-uploads \
  --notification-configuration '{
    "TopicConfigurations": [{
      "TopicArn": "arn:aws:sns:eu-central-1:123456789012:s3-events",
      "Events": ["s3:ObjectCreated:*"]
    }]
  }'

put-bucket-notification-configuration replaces the bucket's whole notification configuration. Include any existing configurations you want to keep.

Amazon EventBridge

Turn on EventBridge for the bucket, then create a rule for the bucket's events with an API destination that POSTs to the webhook URL. For the destination's connection, choose API key authorization with X-Connic-Secret as the key name and the secret key as the value.

terminal
# 1. Send the bucket's events to EventBridge
aws s3api put-bucket-notification-configuration \
  --bucket invoice-uploads \
  --notification-configuration '{"EventBridgeConfiguration": {}}'

# 2. Create a rule for the bucket's events with an API destination target:
#    endpoint <webhook-url>, method POST,
#    connection with API key authorization: name X-Connic-Secret, value <secret>

connic turns the detail type Object Created into ObjectCreated:Put, ObjectCreated:Post, ObjectCreated:Copy, or ObjectCreated:CompleteMultipartUpload, depending on the S3 API that created the object. Object Deleted becomes ObjectRemoved:Delete or ObjectRemoved:DeleteMarkerCreated when a request deleted the object, and LifecycleExpiration:Delete or LifecycleExpiration:DeleteMarkerCreated when a lifecycle rule expired it. The DeleteMarkerCreated names mean S3 created a delete marker instead of deleting the object permanently. Object Restore Initiated and Object Restore Completed become ObjectRestore:Post and ObjectRestore:Completed. Other detail types keep their name, so they start runs only with event_types: all.

Agent input

Each record in a notification starts a run for every linked agent. The input describes the object:

payload.json
{
  "bucket": "invoice-uploads",
  "key": "incoming/invoice-2026-001.pdf",
  "size": 245789,
  "etag": "d41d8cd98f00b204e9800998ecf8427e",
  "event_name": "ObjectCreated:Put",
  "event_time": "2026-01-15T10:30:00.000Z",
  "_s3": {
    "event_source": "aws:s3",
    "aws_region": "eu-central-1",
    "request_id": "C3D13FE58DE4C810",
    "source_ip": "192.0.2.1"
  }
}

key is URL-decoded. _s3 holds the event source, AWS region, request ID, and source IP. The model receives the input as JSON text, and middleware reads it as context["payload"]. When SNS or EventBridge delivers a record again, each agent reuses the run the record already started, so retries don't start duplicate runs.

Filters

connic skips a record without starting runs when its bucket isn't bucket_name, its event doesn't match event_types, or its key doesn't match prefix and suffix. Skipped records count as processed in the response.

File content

With include_content, connic downloads each created object up to max_file_size_mb and adds it under content. Objects of a text type (text/*, JSON, XML, JavaScript) that are valid UTF-8 arrive as text; all others arrive as base64. Deletes and restores never include content.

payload-with-content.json
{
  "bucket": "invoice-uploads",
  "key": "incoming/order.json",
  "size": 1234,
  "etag": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "event_name": "ObjectCreated:Put",
  "event_time": "2026-01-15T10:30:00.000Z",
  "_s3": { "event_source": "aws:s3", "aws_region": "eu-central-1", "request_id": "C3D13FE58DE4C810", "source_ip": "192.0.2.1" },
  "content": {
    "text": "{\"customer_id\": \"12345\", \"amount\": 234.56}",
    "content_type": "application/json",
    "size_bytes": 1234,
    "encoding": "utf-8"
  }
}

In context["payload"], the content stays under content. The model receives it as a file named after the key, with the rest of the input as JSON text. Whether the model can read the file depends on the model and the file type; see file input for connic/* models.

connic leaves the content out when the object is larger than max_file_size_mb, the download fails three times, or the serialized input would exceed 48 MiB. The input then keeps the metadata, content has skipped: true and a reason, and file_issues describes the omission. For larger objects, a tool can download the object with the bucket and key from the input.

Content is optional by default. Turn on Files required for an agent in the connector's details drawer, or set files_required: true on its link in YAML, to fail the run before it starts when the content is missing or was left out.

connic downloads from the bucket's region with the Connection's access key, which needs s3:GetObject on the bucket's objects:

iam-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::invoice-uploads/*"
    }
  ]
}

For S3-compatible storage, set endpoint_url on the Connection. connic downloads from it directly when it's a public HTTPS URL. For storage in a private network, also set the Connection's Bridge; connic then downloads through the Bridge.

Limits and errors

LimitValue
Request body10 MiB
Records per notification100
Downloaded objectmax_file_size_mb, at most 32 MiB
Input per record, including content15 MiB
Download attempts per object3
StatusMeaning
200Processed. processed counts the records, including those the filters skipped. SNS subscription confirmations and S3 test events also get 200.
400The body isn't a valid S3, SNS, or EventBridge event, or it has more than 100 records. A record whose metadata alone exceeds 15 MiB also gets 400, with the code input_too_large. connic doesn't ask the sender to retry these.
401The secret key is missing or wrong.
403An SNS message has an invalid AWS signature.
404No active S3 connector exists at this URL, for example because it's paused.
413The body is larger than 10 MiB.
429A platform limit is reached. Retry after the seconds in Retry-After.
503A record couldn't be handed to an agent, or connic couldn't confirm the SNS subscription. The sender can retry; records that already started runs reuse them.