longrun.
Split CSV

Docs

Data actions / Split CSV

Split CSV

Use Split CSV to process your inputs. Submit the request, then retrieve the run to get its result.

POSThttps://uselongrun.app/v1/data/split-csv
Request
curl --request POST "https://uselongrun.app/v1/data/split-csv" \
  --header "Authorization: Bearer ${API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{
  "inputs": {},
  "options": {
    "rows_per_part": 1
  }
}'
Accepted · 202
{
  "id": "run_example",
  "status": "queued",
  "outputs": null,
  "error": null,
  "retry_of_run_id": null,
  "created_at": "2026-10-22T10:00:00.000Z",
  "updated_at": "2026-10-22T10:00:00.000Z"
}

The request is accepted, but processing has not finished. Retrieve the run using its ID to get the result.

Completed run · 200
{
  "id": "run_example",
  "status": "completed",
  "outputs": {
    "files": [
      {
        "saved": false,
        "retained": false,
        "id": "file_result",
        "name": "2026-10-22_10-00-03-000.csv",
        "mime_type": "text/csv",
        "size": 52,
        "category": "CSV",
        "storage": "longrun",
        "url": "https://uselongrun.app/v1/files/file_result/content",
        "access": "authenticated",
        "source": "action",
        "created_at": "2026-10-22T10:00:03.000Z",
        "expires_at": "2026-10-23T10:00:03.000Z",
        "expired": false,
        "source_run_id": "run_example",
        "source_name": "Generated file"
      },
      {
        "saved": false,
        "retained": false,
        "id": "file_result_2",
        "name": "2026-10-22_10-00-04-000.csv",
        "mime_type": "text/csv",
        "size": 52,
        "category": "CSV",
        "storage": "longrun",
        "url": "https://uselongrun.app/v1/files/file_result_2/content",
        "access": "authenticated",
        "source": "action",
        "created_at": "2026-10-22T10:00:03.000Z",
        "expires_at": "2026-10-23T10:00:03.000Z",
        "expired": false,
        "source_run_id": "run_example",
        "source_name": "Generated file"
      }
    ],
    "data": {
      "row_count": 2,
      "columns": [
        {
          "name": "name",
          "types": [
            "string"
          ]
        },
        {
          "name": "total",
          "types": [
            "number"
          ]
        }
      ],
      "rows": [
        {
          "name": "Ada",
          "total": 25
        },
        {
          "name": "Sam",
          "total": 40
        }
      ]
    }
  },
  "error": null,
  "retry_of_run_id": null,
  "created_at": "2026-10-22T10:00:00.000Z",
  "updated_at": "2026-10-22T10:00:03.000Z"
}

Example result from Get a run after processing completes. File examples use temporary storage; metadata and values will vary with your inputs.

Get the run result

Request parameters

header
Idempotency-KeystringOptional

Scoped to workspace and operation; same key and payload reuses the run during its seven-day retention period. Changed payload returns 409.

Example
"receipt-1042-v1"

Maximum length: 200 characters.

Request body

Send a JSON body with the following inputs. Put processing settings inside options.

Inputs

inputs.fileFile fileOptional

The File file to process. Upload it first and use the returned file ID.

Example
"${FILE_ID}"

Use an uploaded file ID or a supported file reference. Learn how to send files

inputs.rowsarray of objectOptional

Rows to process directly as JSON objects. Supply rows or an uploaded file, not both.

Example
[
  {
    "name": "Ada",
    "total": 42
  }
]
Show child fields

Options

options.input_formattextOptional

Format to use when reading the source data file.

Example
"csv"

Allowed values: csv json xlsx

options.formattextOptional

File format of the generated output. Choose an allowed extension below.

Example
"csv"

Allowed values: csv json xlsx

options.delimitertextOptional

Character separating columns in a CSV file.

Example
";"

Allowed values: , ; |

options.sheettextOptional

Name of the worksheet to read from an XLSX file.

Example
"Orders"
options.max_rowsnumberOptional

Maximum number of data rows to include in the response.

Example
100

Minimum: 0

Maximum: 10000

options.file_onlybooleanOptional

Return the generated file without including the row data in the response.

Example
true
options.columns_inputarray of textOptional

Column names to use when interpreting input rows.

Example
[
  "name",
  "total"
]
options.row_schemaobjectOptional

Expected column types for each row. This validates values; it does not convert them.

Example
{
  "kind": "object",
  "properties": {
    "name": {
      "kind": "text"
    },
    "total": {
      "kind": "number"
    }
  },
  "required": [
    "name",
    "total"
  ]
}
Show child fields
options.rows_per_partnumberRequired

Maximum number of rows in each split CSV output.

Example
1000

Minimum: 1

Maximum: 10000

Delivery

outputobjectOptional

Choose where the result is delivered. Omit this to use temporary LongRun storage.

Example
{
  "storage": "temporary"
}

Storage guide · Bubble delivery setup

Show child fields
output.storagestringOptional

temporary stores results in LongRun. bubble delivers them to a connected Bubble app. These are the only supported values. A published workflow uses its configured destination unless you override it.

Example
"temporary"

Default: "temporary"

Allowed values: temporary bubble

output.connection_idstringConditionally required

Required when storage is bubble. Copy the connection ID from Settings → Integrations → Bubble. Not used for temporary storage.

Example
"${STORAGE_CONNECTION_ID}"
output.privatebooleanOptional

Only for Bubble delivery. true creates a private file and requires attach_to. false requests a public upload; access still depends on the receiving app configuration.

Example
false

Default: false

output.attach_tostringConditionally required

Required when storage is bubble and private is true. The Bubble Thing ID that owns the file. See the Bubble integration guide for setup.

Example
"${BUBBLE_THING_ID}"
output.file_namestringOptional

Optional output filename, such as receipt.pdf. Omit it to use the generated timestamp-based name. Applies to either destination.

Example
"receipt.pdf"

Maximum length: 255 characters.

webhook_idsarray of stringOptional

IDs of configured webhook endpoints to notify for this run. Omit this to send no webhooks for a direct action.

Example
[
  "${WEBHOOK_ID}"
]

Returns

Returns 202 Accepted with a run ID. Processing continues after the response. Retrieve the run until its status is completed, failed, or cancelled.

Retrieve a run →

Outputs when completed

These fields appear inside outputs on the completed run.

outputs.filesarray of CSV file
outputs.dataobject

Structured results from this action. Expand the child fields to see the returned values.

Show child fields
outputs.data.row_countnumber
outputs.data.columnsarray of object
Show child fields
outputs.data.columns[].nametext
outputs.data.columns[].typesarray of text
outputs.data.rowsarray of object
Show child fields

Limits

Input file
100 MiB
Generated files
200 MiB combined across all output files
Processing deadline
120 seconds; processing may stop earlier if a renderer or resource limit is reached
inputs.rows items
100 maximum
options.columns_input items
100 maximum
Structured result
8 MiB including file metadata
Rows loaded from a file
10,000 maximum; max_rows can lower this
Dataset columns
256 maximum
Text cell length
100,000 characters maximum