Skip to content

Upload ​

<sea-upload> supplies documents to a labelled extraction step in an existing pipeline run.

At a glance
TypeBuilding block
Elementsea-upload
ReactSeaUpload from @sea-dev/widget-lit/react/upload
Without React@sea-dev/widget-lit/upload
ConnectionAn ancestor Context provider
ConfigureAttributes and properties

Usage ​

Place SeaUpload inside a process and set stepLabel to the extraction step's unique label, such as trade-licence, memorandum or financial-statements. The widget resolves that step's missing_upload dependency from the existing run.

Within a step group, uploads inherit its binding. An explicit label on the uploader overrides that binding. A label that resolves to another role disables the uploader and identifies the selected step and its role in a configuration message.

tsx
import * as React from "react";
import { SeaContextProvider } from "@sea-dev/widget-lit/react/context";
import { SeaProcess } from "@sea-dev/widget-lit/react/process";
import { SeaUpload } from "@sea-dev/widget-lit/react/upload";

export function Uploads(p: {
  apiUrl: string;
  bearerToken: string;
  runId: string;
}) {
  return (
    <SeaContextProvider apiUrl={p.apiUrl} bearerToken={p.bearerToken}>
      <SeaProcess runId={p.runId}>
        <SeaUpload
          stepLabel="financial-statements"
          formats="pdf,images,spreadsheets"
          maxSizeMb={20}
          multiple
        />
      </SeaProcess>
    </SeaContextProvider>
  );
}

Set the API URL and credential on the required Sea context. The process and its children reuse that client. Uploads need no host-managed form, submission or extraction IDs.

The widget manages batch uploads and retries, then refreshes the process so bound forms and source viewers receive the run's outputs. Other blockers, such as parent_incomplete, can still prevent the step from running. Use manual input for a manual step's required form.

Partially accepted files stay staged. The Retry batch action retains the original batch and its identity. A committed batch waits for its selected step to run before showing processing progress; the step's completion determines when processing is done.

Choosing another output or source document keeps an accepted batch attached to its original run step. Your application starts the run before mounting the widgets. To supply documents from a server, see Upload documents.

Attributes and properties ​

PropertyAttributeTypeDefaultDescription
formIdform-idstring or undefined—Selects the form for standalone submission uploads, overriding run-step uploads when set directly.
dealIddeal-idstring or undefined—Selects the existing deal for a new standalone submission.
submissionIdsubmission-idstring or undefined—Uploads into this standalone submission, overriding run-step uploads when set directly.
modelmodelExtractionModel"general"Selects general, smart, bank_statement, financials or agentic_analyst extraction for standalone submission uploads.
multiplemultiplebooleanfalseAllows more than one file per upload batch.
multipleFilesmultiple-filesDocumentsMultipleFiles or undefined—Sets enabled or disabled for multiple-file selection, taking precedence over multiple and maxCount.
formatsformatsstring or string[] or undefined—Sets accepted file types using presets, extensions or MIME types supplied as a comma-separated string or an array.
maxSizeMbmax-size-mbnumber or undefined—Limits each file's size in megabytes, up to the API's upload limit.
maxCountmax-countnumber or undefined—Limits the total number of documents, including existing documents and files in the current batch.
existingCountexisting-countnumber0Supplies the total existing-document count when the host has a broader inventory than the mapped sources.
existingFileNames—readonly string[][]Supplies additional existing filenames for duplicate detection alongside mapped sources.
existingDocumentIds—readonly string[][]Identifies completed uploads already included in existingCount so they count only once towards maxCount.
zeroFieldDocumentIds—readonly string[][]Marks completed uploads the extraction read nothing from, replacing their "Done" status with a truthful one.
onDuplicateon-duplicate"add" or "reject""add"Controls whether duplicate uploads are added again or rejected.
stepRolestep-rolePipelineStepRoleWire or undefined—Constrains the selected step to this pipeline role.
stepLabelstep-labelstring or undefined—Selects one step by its unique pipeline label within the enclosing process.
stepIdstep-idstring or undefined—Selects a pipeline step definition within the enclosing process.
runStepIdrun-step-idstring or undefined—Selects one executable step instance within the enclosing process.
outputFormIdoutput-form-idstring or undefined—Narrows the selected step's outputs to this form.
outputSubmissionIdoutput-submission-idstring or undefined—Selects an exact output submission from the enclosing process.

Events ​

EventTypeDescription
documents-uploadedCustomEventThe exact pipeline document batch receipt, with outcome distinguishing staging from a committed step attachment.
upload-startedCustomEvent{ fileName } after local validation, before an API upload attempt.
submission-createdCustomEvent{ submissionId } after creating a standalone submission for the first upload.
upload-acceptedCustomEvent{ submissionId, fileName, documentId, extractionId } when one standalone submission upload is accepted.
upload-failedCustomEvent{ fileName, error, acceptance, code?, documentId?, extractionId?, status? } when an attempted API upload fails, including when submission creation fails for the batch, with code identifying a per-file upload failure and acceptance set to unknown or rejected.
processing-errorCustomEvent{ submissionId, extractionId, fileName, error, status? } when one standalone extraction fails.
processing-completeCustomEvent{ submissionId, results } when all standalone submission uploads finish. Each result includes its status and filename.

documents-uploaded reports the run-step batch receipt. Observing events is optional; the widgets coordinate uploads and run refreshes themselves. Extraction events such as upload-accepted and processing-complete belong to submission compatibility mode. Upload documents defines committed, partial and uncertain outcomes.

File limits ​

formats accepts these presets, file extensions or MIME types. The default presets are pdf, images and spreadsheets.

PresetExtensionsMIME types
pdf.pdfapplication/pdf
images.png, .jpg, .jpegimage/png, image/jpeg
spreadsheets.xlsx, .xls, .csvapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/csv
text.txttext/plain

Each preset expands to the listed extensions. The API accepts multipart files without an extension or MIME-type allowlist; formats restricts the widget's file selection.

maxSizeMb limits each file, up to 100 MB. maxCount includes existing and pending documents. onDuplicate="reject" compares tracked filenames and sizes, and filenames in existingFileNames.

multipleFiles="enabled" permits several files in a batch for the same selected step. The uploader counts documents in its mapped scope. Unrelated steps' documents do not consume that scope's cap.

API and transport ​

Run-bound uploads use pipeline.uploadDocuments through the context's client. This operation supplies documents directly to the selected extraction step.

Custom transports must implement that operation alongside the process's read operations. Upload documents documents the request, receipts and safe retries.

Existing submission uploads ​

Setting formId or submissionId directly on SeaUpload selects submission compatibility mode, including inside a process. Ancestor form or submission metadata does not switch a run-bound upload into this mode. Use formId with dealId to create a submission, or submissionId to add files to an existing one. This mode uses the submission upload API and extraction status reads.

The previous upload names remain compatibility aliases. Use the canonical upload names for new integrations.

Styling parts ​

PartDescription
rootThe upload container.
dropzoneThe file drop and browse control.
contentThe accepted file list.
itemAn individual upload.
statusUpload progress and error messages.

Common problems ​

SymptomAction
File rejected before uploadCheck the displayed type, size or duplicate reason
Upload failsRead upload-failed.detail.error and its HTTP status
Receipt is partial or lostRetain the batch and use the widget's retry action
Step does not runCheck its remaining blockers in the process