Installation

Install the screen template by running the following command:

npx shadcn add https://registry.samplehc.com/r/document-upload.json

The screen file will be added at screens/document-upload-screen.tsx.

Usage

Required Props

This screen template does not require any props. It handles document upload and returns the uploaded document information.

Example

workflow.py
from workflows_py.workflow import ScreenStep, Step, Workflow

workflow = Workflow(...)

workflow.then(
    ScreenStep(
        "document-upload",
        screen_path="./screens/document-upload-screen.tsx",
    )
).then(
    # Access the uploaded document in subsequent steps
    Step(
        "process-document",
        lambda ctx: process_document(ctx.get_step_result("document-upload")["document"]),
    )
)

Returns

The screen returns the uploaded files directly:

NameTypeDescription
uploadedFilesobjectThe uploaded document files object containing file metadata and content

Preview