> For the complete documentation index, see [llms.txt](https://docs.kernel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kernel.ai/integrations/s3-integration/s3-scheduled-runs.md). Agents can also search and read this documentation through its [MCP server](https://docs.kernel.ai/~gitbook/mcp).

# Scheduled imports and automatic exports

Pick up CSV files on a schedule, process new accounts, and automatically export results to Amazon S3.

Automatically pick up account files from Amazon S3, process new accounts in Kernel, and deliver CSV results back to your bucket when they are ready. Each flow brings together file selection, field mappings, a schedule, and export settings.

## Before you start

You configure file pickup, schedules, mappings, and exports, and monitor runs in the Customer App. If no flow is listed yet, contact your Kernel team to add the initial flow.

* Connect Amazon S3 and configure your input bucket and prefix, plus your output bucket, prefix, and filename.
* Set up input and output mappings in Data flows. Include a stable source account ID so Kernel can recognise the same record across files.
* Confirm the intended environment, Production or Sandbox, before changing settings or starting a run.
* For folder-based pickup, allow the input IAM role to list the configured prefix and read every eligible CSV object beneath it. If you previously allowed access to one exact input object, extend that read permission to the selected files. Retain the relevant KMS permissions for encrypted data.

Follow the [S3 connection setup instructions](https://docs.kernel.ai/integrations/s3-integration.md) for IAM trust, External ID, bucket configuration, and encryption. Scheduled runs use those configured connection details.

## Configure a flow

1. Open [Connections → Amazon S3](https://app.kernel.ai/settings/connection/s3), then open **Scheduled runs**.
2. Select the flow you want to configure. Review its import, processing, and export summary.
3. Open Schedule. Choose Files to pick up and, for folder-based modes, an optional Filename pattern.
4. Choose Repeat, the run time, and Timezone. For weekly runs, select a weekday. For monthly runs, select a day of the month.
5. Choose the Input mapping and Output mapping. Use View mapping to review or edit the selected mapping.
6. Choose Export contents and File naming. Set Export without new input if you want delivery when the selected pickup returns no rows. See [Export without new input](#export-without-new-input) for its limits.
7. Turn on Run on schedule and select Save flow. Check the flow status and Next run in Scheduled runs.

Buckets and file locations are configured on the connection. Field mappings are managed in Data flows. The flow selects which mappings to use.

## Choose which files to pick up

### Fixed file

Read the exact CSV object configured on the connection each time the flow runs. Use this when your upstream system replaces the same file, such as `input/accounts.csv`. Complete the upload before the run is due.

### Latest dated folder

Read all matching CSV files directly inside the newest dated folder under the configured prefix. Folders use `YYYY/MM/DD`, for example `input/2026/10/20/accounts_01.csv`. The newest eligible folder is selected by its date path, rather than the objects’ last-modified timestamps. A folder is eligible when it contains a matching CSV.

### New files since the last pickup

Read CSV object keys that this flow has not previously marked as processed, in object-key order. Use a new object key for each delivery, such as `input/accounts_20261020_0900.csv`. Replacing the contents of an already processed key does not make it a new file. Use Fixed file for recurring replacements of one object.

On the first run, all matching CSV keys under the input prefix are eligible, including older files. Keep files outside that prefix if you do not want the flow to pick them up.

### Filename patterns

For Latest dated folder and New files since the last pickup, optionally filter filenames with a pattern such as `accounts_*.csv`. An asterisk matches any sequence of characters; a question mark matches one character. Matching is case-insensitive and applies to the filename. Set the folder in the connection's input prefix; leave it out of the filename pattern. Leave the pattern empty to include all eligible CSV files.

## Prepare your CSV files

* Use CSV files with a header row and column names that match the selected input mapping.
* Provide a non-empty, stable source account ID on every row. Keep IDs as strings, including leading zeroes.
* Use a unique source ID for each account record. If an ID appears more than once in the selected input, Kernel keeps one row for that ID; avoid duplicates across files.
* Keep mapped headers consistent between deliveries. Update the mapping before using renamed or removed columns.
* Keep input and output prefixes separate so exported CSVs are outside the input pickup location.

Kernel reads and validates the selected files before dispatching accounts for processing. A missing mapped column or a file whose source IDs are all blank produces **Input malformed**, with no partial import from the selected file set. Individual rows with blank IDs are skipped.

## What happens to accounts

New source account IDs are imported and processed through the configured flow. Existing source IDs keep their established account links. Kernel compares incoming identity inputs with the stored identity snapshot and flags identity drift for review when applicable. Existing IDs are not automatically reprocessed by this pickup.

Accounts missing from a later file remain in Kernel. Removing a row from an input file does not delete the account.

## Schedule and manual controls

* Daily: run each day at the selected local time.
* Weekly: run on the selected weekday at the selected local time.
* Monthly: run on the selected day. Shorter months use their last day, so day 31 still has a run every month.
* Manual only: start the flow when needed with Run now.

Choose a named timezone such as `Europe/London` or UTC. Due schedules are checked hourly, so allow for dispatch on an hourly check after the configured time and for subsequent processing. Export follows when results are ready, rather than at a separate export time.

Use Pause to stop future scheduled pickups and Resume to enable them again. Use Run now for an immediate run, including on a paused flow. Save any configuration changes first. Run now uses the saved settings and leaves the regular schedule unchanged. A second manual run of the same flow is blocked while a run is waiting or processing.

## Choose what to export

### Accounts in this input

Export new accounts successfully processed in this run. Existing source IDs in the selected files are checked for identity drift but are not included in this export. Use All tracked accounts or Changes since last export to include existing accounts.

### All tracked accounts

Export all accounts retained through the connection, including those absent from the latest input. Use this for a complete snapshot of the tracked population.

### Changes since last export

Export accounts whose mapped output values differ from their last successful delivery for the output mapping. Newly delivered accounts are included. If no output rows have changed, the run records a zero-row delivery and writes no file.

### File naming

Overwrite replaces the configured output object on each delivery. Timestamped adds a timestamp before the filename extension, preserving separate delivery files. File naming applies to every export on the connection, so coordinate changes with downstream consumers.

### Export without new input

Turn this on with All tracked accounts or Changes since last export to deliver stored results when a pickup returns no rows. For example, New files since the last pickup may find no unprocessed files. With Changes since last export, a file is written only when output values have changed.

A file containing rows whose source IDs all already exist does not trigger this export. Accounts in this input also produces no export for an empty pickup. A missing or malformed input remains an input error. Exporting stored results does not request fresh enrichment of existing accounts.

## Review a run

Open the flow’s Run history and select a run to inspect its details.

* Import: files read, rows read, new accounts, drift flagged, and any input outcome.
* Processing: completed, queued or processing, and failed account counts.
* Export: status, account count, delivery time, output object key, file naming, and any failure reason.
* Drifted accounts: source record IDs whose identity inputs changed and were flagged for review.

Run results include Processing, Delivered, Completed, Export failed, Input missing, Input malformed, and Failed. Check the export details to confirm delivery. Completed can describe a run with no export, and a changes-only delivery can complete without creating a file when there are no changed rows.

## Resolve common run outcomes

Input missing: check that the configured object exists, or that the dated folder contains CSV files matching the pattern. Check the bucket, prefix, object key, and role access before starting another run.

Input malformed: restore missing mapped headers or supply the missing source IDs, upload the corrected input, and run again. Input errors are recorded without automatic retry.

No new rows: check whether all candidate object keys have already been processed. Use All tracked accounts or Changes since last export with Export without new input to deliver stored results after an empty pickup. A file containing only existing source IDs can complete with zero new accounts and no export. Use a [manual output sync](https://docs.kernel.ai/integrations/s3-integration.md#write-results) to deliver those stored results.

Export failed: inspect the failure reason and check your output permissions, encryption access, and destination settings. Contact your Kernel team to retry the failed export without starting another import.

Drift flagged: review the listed source IDs and confirm the intended account identity. Contact your Kernel team if follow-up processing is needed.

## Example configuration

For daily incremental files, set the connection's input prefix to `input/`. Use New files since the last pickup with the filename pattern `accounts_*.csv`, Daily at 09:00 in `Europe/London`, and Changes since last export. Choose Timestamped output files and enable Export without new input to deliver changed stored results when there are no unprocessed files. Upload each input under a fresh object key and check Run history for the delivered output.
