AWS S3 Integration

No sections found for this integration
The integration documentation may not have the expected structure

Overview

The AWS S3 node connects Lamatic to Amazon S3, and works in two modes:

  • Trigger mode: automatically detects file additions and modifications in a bucket and syncs them into a flow, most commonly for vectorization and indexing in Retrieval-Augmented Generation (RAG) flows. This is the original behavior of the node and is unchanged.
  • Action mode: lets a flow directly upload, fetch, list, move, copy, or delete files, read file metadata, and create or delete folders, on demand, as one step in a larger flow.
⚠️

To use the AWS S3 node in Trigger mode for RAG, you need to create a separate flow to implement RAG. You can integrate it into this distinct flow.

Features

âś… Key Functionalities

  • Batch Trigger: Automates file fetching and synchronization on a schedule or in real-time using S3 event notifications.
  • File Type Support: Handles text files, PDFs, Word Documents, and other compatible formats.
  • Scheduled Processing: Supports automated sync schedules with configurable intervals for regular file updates.
  • Selective Filtering: Use glob patterns to filter specific file types and paths for targeted file processing.
  • Multiple Sync Modes: Supports both incremental (new/updated files only) and full-refresh (all files) synchronization modes.
  • Scalable Processing: Scales efficiently with growing data volumes and large S3 buckets.
  • File Actions: Upload, fetch, list, move, copy, delete, and read metadata for individual files on demand from within a flow.
  • Folder Management: Create folders and delete folders (including everything inside them) directly from a flow.
  • Configurable Signed URLs: Choose how long returned file URLs stay valid, from 15 minutes up to 7 days.
  • S3-Compatible Providers: Works with any S3-compatible storage, not just AWS, including Supabase Storage, MinIO, and Cloudflare R2, by setting a custom endpoint.

âś… Benefits

  • Streamlined File Collection: Automates the process of collecting files from Amazon S3 buckets, reducing manual effort and ensuring consistency.
  • RAG Flow Preparation: Prepares files for vectorization and indexing to enhance Retrieval-Augmented Generation workflows.
  • Scalable Architecture: Scales efficiently with growing data volumes and large S3 repositories.
  • Flexible Configuration: Supports various file types and configurable processing strategies.
  • Cost-Effective: Leverages AWS S3’s cost-effective storage for large-scale document management.

Prerequisites

Before setting up the AWS S3 node, ensure you have the following:

  • An AWS account with appropriate bucket access permissions.
  • The target S3 bucket name and configuration.
  • An understanding of IAM policies and credentials.
⚠️

If the connection fails, review IP Allowlisting and allow the required Lamatic and Cloudflare ranges.


Setup

Step 1: Set Up AWS Credentials

  1. Create IAM Policy:

    • Navigate to the IAM console.

    • Create a new policy with required S3 permissions.

    • Use the provided JSON policy template.

      ⚠️

      The read-only policy below is enough for Trigger mode. If you’re using the node in Action mode, see Action mode permissions further down, Upload, Copy, and Create Folder need s3:PutObject, and Delete File, Delete Folder, and Move need s3:DeleteObject too.

          {
              "Version": "2012-10-17",
              "Statement": [
                  {
                      "Effect": "Allow",
                      "Action": [
                          "s3:GetObject",
                          "s3:ListBucket",
                          "s3:ListAllMyBuckets"
                      ],
                      "Resource": "*"
                  }
              ]
          }
      ℹ️

      Note: If you want to given permission only to specific buckets then add them to resource key, refer the below example

      {
          "Version": "2012-10-17",
          "Statement": [
              {
              "Effect": "Allow",
              "Action": [
                  "s3:GetObject",
                  "s3:ListBucket"
              ],
              "Resource": [
                      "arn:aws:s3:::{your-bucket-name-1}/*",
                      "arn:aws:s3:::{your-bucket-name-1}",
                      "arn:aws:s3:::{your-bucket-name-2}/*",
                      "arn:aws:s3:::{your-bucket-name-2}"
                  ]
              }
          ]
      }
      đź’ˇ

      Note: At this time, object-level permissions alone are not sufficient to successfully authenticate the connection. Please ensure you include the bucket-level permissions as provided in the example above.


      If you want to restrict the usage to specific bucket then you can create the policy as follows:

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "VisualEditor0",
                  "Effect": "Allow",
                  "Action": [
                      "s3:GetObject",
                      "s3:ListBucket"
                  ],
                  "Resource": [
                      "arn:aws:s3:::bucket-name",
                      "arn:aws:s3:::bucket-name/*"
                  ]
              },
              {
                  "Sid": "VisualEditor1",
                  "Effect": "Allow",
                  "Action": "s3:ListAllMyBuckets",
                  "Resource": "*"
              }
          ]
       
      }
      đź’ˇ

      Note: You need to make sure that you are giving ListAllMyBuckets permission with resource as * else you will not be able to see the available buckets in the node config.

      Action mode permissions

      If you’re using the S3 node in Action mode, extend the policy with write and delete permissions. Upload File, Upload File from URL, Copy File, and Create Folder need s3:PutObject. Delete File, Delete Folder, and Move File (which deletes the source after copying) need s3:DeleteObject.

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": [
                      "s3:GetObject",
                      "s3:PutObject",
                      "s3:DeleteObject",
                      "s3:ListBucket",
                      "s3:ListAllMyBuckets"
                  ],
                  "Resource": "*"
              }
          ]
      }

      Moving or copying a file to a different bucket (via Destination Bucket) needs s3:PutObject on that destination bucket too, not just the source bucket. If you’re scoping permissions to specific buckets, include both in the policy’s Resource list.

  2. Configure IAM User:

    • Create or select an IAM user.

    • Attach the created policy.

    • Generate and securely store access credentials.

      ️⚠️

      Caution: Your Secret Access Key will only be visible once upon creation. Be sure to copy and store it securely.


      For more information on managing your access keys, please refer to the official AWS documentation.

Step 2: Configure S3 Credentials

Use the following format to set up your credentials:

Key NameDescriptionExample Value
Credential NameName to identify this set of credentialsmy-s3-creds
AWS Access KeyAWS access key ID for authenticationAKIAIOSFODNN7EXAMPLE
AWS Secret KeyAWS secret access key for authenticationwJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS RegionRequired. The bucket’s AWS region, used to sign every request.us-east-1
EndpointOptional. Set this to use an S3-compatible provider instead of AWS, e.g. Supabase Storage, MinIO, or Cloudflare R2. Leave empty for AWS.https://your-project.supabase.co/storage/v1/s3

The S3 node isn’t limited to AWS. Any S3-compatible storage provider (Supabase Storage, MinIO, Cloudflare R2, DigitalOcean Spaces, and others) works by setting the Endpoint field.

Step 3: Set Up Lamatic Flow

  1. Add the S3 node to your flow, either as a Trigger (for scheduled RAG sync) or as an Action (for on-demand file operations).
  2. Provide the credentials and bucket details.
  3. For a Trigger, configure sync settings, schedule, and file filters. For an Action, pick the operation you want from the Action dropdown and fill in its fields.

Trigger Configuration Reference

This applies when the S3 node is used as a Trigger for scheduled RAG sync. See Action Reference below for the on-demand file operations.

FieldDescriptionOptions/ExamplesRequirement/Default
CredentialsSpecifies the credentials required to access the S3 bucket. Ensure you have appropriate IAM credentials configured for the node.Pre-configured S3 credentials (e.g., “S3”).Mandatory
BucketSpecifies the name of the Amazon S3 bucket that the node will interact with.Example: new-testing-12345.Mandatory
Parsing StrategyDefines how files in the S3 bucket will be parsed.Auto (automatic detection), other custom strategies.Default: Auto
Globs (Path Patterns)Allows specifying file path patterns to include or exclude files during processing.Example: *.csv (include all CSV files).Default: None (all files included).
Days to Sync If History Is FullDefines how many days’ worth of historical data to sync when the history is full.Example: 3.Default: 3.
Start DateSpecifies the date from which the node should begin syncing files.Format: YYYY-MM-DD.Default: Empty (process all files).
Sync ModeDetermines how the synchronization is performed.Incremental (new/updated files), other modes.Default: Incremental.
Sync ScheduleDefines the frequency at which the synchronization process occurs.Every 24 hours, custom intervals (e.g., hourly).Default: Every 24 hours.
Credentials

These are the authentication details used to connect to the S3 bucket. You must configure IAM credentials with appropriate permissions (e.g., read access to the bucket).

Bucket

The S3 bucket acts as the data source for this trigger. Enter the name of the bucket where your files are stored.

Parsing Strategy

This option determines how the files will be interpreted.

  • auto lets the system decide the best way to parse files, while other strategies might require manual setup for specific file types.
  • fast extracts text directly from the document which doesn’t work for all files.
  • ocr_only is more reliable, but slower.
Globs (Path Patterns)

Use glob patterns to filter which files should be processed.

  • **: match everything.
  • **/*.csv: match all files with a specific extension.
  • myFolder/**/*.csv: match all .csv files anywhere under myFolder.
  • */**: match everything at least one folder deep.
  • */*/*/**: match everything at least three folders deep.
  • **/file.*|**/file: match every file called “file” with any extension (or no extension).
  • x/*/y/*: match all files that sit in folder x -> any folder -> folder y.
  • **/prefix*.csv: match all .csv files with a specific prefix.
  • **/prefix*.parquet: match all .parquet files with a specific prefix.

This is helpful for excluding unnecessary files. See Glob Patterns for the full syntax reference.

Supported File Types

Only specific file types are currently supported for vectorization and indexing in Lamatic. Using unsupported formats may result in parsing errors during synchronization.

âś… Allowed File Extensions
  • .pdf — PDF Documents
  • .txt — Plain Text Files
  • .docx — Microsoft Word
  • .pptx — Microsoft PowerPoint
  • .md — Markdown Files

To avoid sync issues, ensure your glob patterns are configured to include only these types.

    globs:
    - "**/*.pdf"
    - "**/*.txt"
    - "**/*.docx"
    - "**/*.pptx"
    - "**/*.md"
Days to Sync If History Is Full

If the system encounters a large backlog of files, this setting limits the synchronization to a defined number of recent days. It helps manage processing time and storage efficiently.

Start Date

Define a specific date from which the system should start processing files. This is particularly useful for incremental syncs where you only want to process data from a certain point in time.


Format: YYYY-MM-DDTHH:mm:ss.SSSSSSZ


Example: 2025-01-03T00:00:00.000000Z

Sync Mode

The S3 source connector supports the following:

  1. In Incremental mode, the system only processes files that have been added or updated since the last sync. This reduces redundancy and improves performance.

  2. Full Refresh sync mode is a data replication method that copies all data from a source to a destination

Sync Schedule

This setting allows you to specify how often the synchronization process should run, such as every hour or every 24 hours. Regular intervals ensure that your data stays updated. You can Schedule the Sync on Every 3, 6, 8, 12 and 24 hours


Trigger Output

FieldTypeAdditional Info
document_keyStringDocument key (filename).
contentStringExtracted text content from the file.
document_urlStringSigned HTTPS URL for the processed file, valid for 5 hours. Use document_url to extract data if your file contains unstructured data.

Example Output

{
  "document_key": "example.pdf",
  "content": "Extracted text content from the S3 file",
  "document_url": "https://bucket-name.s3.us-east-1.amazonaws.com/example.pdf?X-Amz-Expires=18000&..."
}

Action Reference

When used as an Action, the S3 node runs one of ten operations, picked from the Action dropdown. Each operation only shows the fields it needs.

Most actions accept a Signed URL Expiry field (900 = 15 minutes, 3600 = 1 hour, default, 21600 = 6 hours, 86400 = 24 hours, 604800 = 7 days, the maximum a signed S3 URL can allow). It controls how long the url returned in the action’s output stays valid.

Get File

Returns a signed URL for a single file, without downloading its contents into the flow.

FieldDescriptionRequired
File PathExact path to the file in the bucket, e.g. reports/quarterly-report.pdfYes
Signed URL ExpiryHow long the returned URL stays validNo, default 1 hour
{
  "key": "reports/quarterly-report.pdf",
  "bucket": "my-bucket",
  "url": "https://my-bucket.s3.us-east-1.amazonaws.com/reports/quarterly-report.pdf?..."
}

List Files in Folder

FieldDescriptionRequired
Folder PathPath to the folder, e.g. invoices/2024/. Leave empty for the bucket root.No
File PatternGlob pattern to filter results, e.g. *.pdf. Leave empty to list everything.No
Max ResultsNumber of files to return, from 1 to 1000No, default 100
Signed URL ExpiryHow long each file’s returned URL stays validNo, default 1 hour

Folder placeholder objects (see Keep Empty Folder below) are automatically excluded from results.

{
  "bucket": "my-bucket",
  "folder": "invoices/2024/",
  "files": [
    { "key": "invoices/2024/jan.pdf", "size": 10432, "lastModified": "2025-01-04T10:00:00.000Z", "url": "https://..." }
  ],
  "count": 1
}

Upload File

Creates a new file from text content typed or mapped directly into the node.

FieldDescriptionRequired
File PathDestination path, e.g. notes/summary. The correct extension is appended automatically if you leave it off.Yes
File TypeText (.txt), Markdown (.md), JSON (.json), CSV (.csv), or HTML (.html). Sets both the file extension and the S3 content type.Yes, default Text
ContentThe file contents to uploadYes
Signed URL ExpiryHow long the returned URL stays validNo, default 1 hour

If File Type is JSON, the content must be valid JSON, either a JSON string or an object mapped from a previous node. Invalid JSON is rejected before anything is uploaded.

{
  "bucket": "my-bucket",
  "key": "notes/summary.md",
  "fileType": "markdown",
  "etag": "d41d8cd98f00b204e9800998ecf8427e",
  "size": 128,
  "contentType": "text/markdown; charset=utf-8",
  "url": "https://..."
}

Upload File from URL

Downloads a file from a URL and stores it in the bucket as-is, keeping the source’s original content type.

FieldDescriptionRequired
File PathDestination path in the bucketYes
File URLURL to fetch, e.g. {{triggerNode.output.document_url}}Yes
Signed URL ExpiryHow long the returned URL stays validNo, default 1 hour
⚠️

Since the URL is flow-controlled, it’s treated as untrusted input: only http/https are allowed, private and internal addresses (localhost, 10.x, 172.16-31.x, 192.168.x, link-local, and their IPv6 equivalents) are blocked, and up to 3 redirect hops are followed, each re-checked against the same rules before being fetched. Downloads are capped at 100 MB and time out after 120 seconds.

{
  "bucket": "my-bucket",
  "key": "imports/photo.jpg",
  "etag": "d41d8cd98f00b204e9800998ecf8427e",
  "size": 204800,
  "contentType": "image/jpeg",
  "url": "https://..."
}

Move File / Copy File

Moving is a copy followed by deleting the source. Both actions share the same fields.

FieldDescriptionRequired
File PathSource file pathYes
Destination PathNew path for the file, e.g. archive/2024/report.pdfYes
Destination BucketBucket to move/copy into. Leave empty to stay in the same bucket.No
Keep Empty FolderIf this move empties the source folder, write a hidden .emptyFolderPlaceholder file so the folder stays visible (Move File only)No, default true
Signed URL ExpiryHow long the returned URL stays validNo, default 1 hour

The node checks the source file exists (and the destination bucket, if different) before copying, so a missing source or bucket returns a clear error instead of a generic failure. Moving/copying a file onto itself (same bucket, same path) is rejected up front.

{
  "sourceBucket": "my-bucket",
  "sourceKey": "reports/draft.pdf",
  "bucket": "my-bucket",
  "key": "archive/2024/draft.pdf",
  "url": "https://...",
  "moved": true
}

Delete File

FieldDescriptionRequired
File PathPath of the file to deleteYes
Keep Empty FolderIf deleting this file empties its folder, write a hidden .emptyFolderPlaceholder file so the folder stays visibleNo, default true

S3 normally reports success even when you delete a key that never existed. This action checks first, so existed and deleted tell you whether there was actually a file there.

.emptyFolderPlaceholder is a zero-byte file, the same convention Supabase Storage uses to keep an otherwise-empty folder visible. It’s excluded from List Files results and hidden in Supabase’s own dashboard, but it will show up as a real object if you browse the bucket directly in the AWS console.

{
  "bucket": "my-bucket",
  "key": "reports/draft.pdf",
  "existed": true,
  "deleted": true
}

Get File Metadata

Reads a file’s size, content type, and custom metadata without downloading it.

FieldDescriptionRequired
File PathPath of the fileYes
Signed URL ExpiryHow long the returned URL stays validNo, default 1 hour
{
  "bucket": "my-bucket",
  "key": "reports/draft.pdf",
  "exists": true,
  "size": 10432,
  "contentType": "application/pdf",
  "lastModified": "2025-01-04T10:00:00.000Z",
  "etag": "d41d8cd98f00b204e9800998ecf8427e",
  "metadata": {},
  "url": "https://..."
}

If the file doesn’t exist, the action still succeeds and returns { "exists": false } rather than erroring.

Create Folder

S3 has no real folders, this writes a zero-byte marker object with a trailing slash, the same convention the AWS console uses.

FieldDescriptionRequired
Folder PathPath of the folder to create, e.g. invoices/2025/Yes
{
  "bucket": "my-bucket",
  "folder": "invoices/2025/",
  "created": true
}

Delete Folder

Deletes every file under the given path.

FieldDescriptionRequired
Folder PathPath of the folder to delete, e.g. invoices/2023/. Deletes everything under this path.Yes
⚠️

Each run deletes at most 10,000 objects. If the folder held more, truncated comes back true and you’ll need to run the action again to finish clearing it. The action refuses to run on an empty path or /, so it can’t be used to wipe an entire bucket by accident.

{
  "bucket": "my-bucket",
  "folder": "invoices/2023/",
  "deletedCount": 842,
  "truncated": false
}

Low-Code Example

Trigger mode

triggerNode:
nodeId: triggerNode_1
nodeType: s3Node
nodeName: S3
values:
  credentials: "AWS"
  bucket: "TEST"
  strategy: auto
  globs:
    - "**"
  days_to_sync_if_history_is_full: "3"
  start_date: "2025-01-03T00:00:00.000000Z"
  syncMode: incremental_append
  cronExpression: 0 0 00 1/1 * ? * UTC

Action mode

- nodeId: s3Node_512
  nodeType: s3Node
  nodeName: S3
  values:
    credentials: "AWS"
    bucket: "TEST"
    action: S3_UPLOAD_FILE
    filePath: "notes/{{triggerNode_1.output.title}}"
    fileType: markdown
    content: "{{triggerNode_1.output.body}}"
    urlExpiry: "3600"
  needs:
    - triggerNode_1

Troubleshooting

Common Issues

ProblemSolution
Invalid CredentialsVerify IAM user credentials and policy permissions.
Bucket Not FoundConfirm bucket name and region configuration.
Sync Not WorkingCheck sync schedule settings and IAM permissions.
File Types UnsupportedVerify file formats are among supported types.
Permission DeniedEnsure IAM policy includes required S3 permissions.
Network ConnectivityCheck network access and firewall settings.
Large File IssuesVerify file size limits and parsing strategy.
”File URL points to a private or internal address”Upload File from URL blocks localhost and private network ranges as a security measure. Point it at a publicly reachable URL instead.
”File is too large to upload from URL”Upload File from URL caps downloads at 100 MB. Split the file or upload it directly with Upload File instead.
”Source file not found” on Move/CopyCheck the File Path is the exact source key. If a previous Move already ran, the file is already at its destination.
”Source and destination point to the same file”You set Destination Path (and bucket, if different) to the exact same location as File Path. Pick a different destination.
”Too many redirects while downloading the file”Upload File from URL follows at most 3 redirect hops. Use a direct URL instead of one behind a long redirect chain.
”Content is not valid JSON” on Upload FileEnsure Content is a valid JSON string (or a mapped object) when File Type is set to JSON.
truncated: true on Delete FolderThe folder had more than 10,000 objects. Run Delete Folder again to continue clearing it.

Debugging

  • Review AWS CloudWatch logs for access issues.
  • Verify IAM policy permissions are correctly configured.
  • Test bucket accessibility using AWS CLI or console.
  • Check Lamatic Flow logs for detailed error information.
  • If the connection fails, review IP Allowlisting and confirm the required Lamatic and Cloudflare ranges are allowed.

Best Practices

  • Use incremental sync mode for better performance.
  • Implement specific glob patterns to avoid processing unnecessary files.
  • Schedule syncs during off-peak hours to minimize impact.
  • Use appropriate parsing strategies for different file types.
  • Regularly monitor sync logs for any issues.
  • Set appropriate days_to_sync_if_history_is_full to limit historical data.
  • Test with sample files before processing large buckets.
  • Ensure proper IAM permissions with least privilege principle.

Example Use Cases

Document Intelligence Workflows

  • Business Documents: Sync reports, contracts, and spreadsheets from S3 for automated processing.
  • Data Archives: Index historical documents and data files stored in S3.
  • Compliance Documents: Process audit trails and compliance-related content.
  • Backup Files: Automate processing of backup documents and files.

RAG Applications

  • Semantic Search: Enable natural language search across S3 documents.
  • Question Answering: Build AI assistants that can answer questions about stored documents.
  • Document Summarization: Automatically summarize lengthy reports and documents.
  • Content Discovery: Help users find relevant information across S3 repositories.

Additional Resources

Was this page useful?

Subscribe to updates