from workflows_py.workflow import ScreenStep, Step, Workflow
from client_manager import SampleHealthcareClient
workflow = Workflow(...)
def split_document(ctx):
client = SampleHealthcareClient()
response = client.v2.documents.split(
document=ctx.get_step_result("document-upload")["document"],
)
return response.async_result_id
workflow.then(
# See: Document Upload Screen template
ScreenStep(
"document-upload",
screen_path="./screens/document-upload-screen.tsx",
)
).then(
Step(
"split-document",
split_document,
)
)
.then(
ScreenStep(
"document-splitting",
screen_path="./screens/document-splitting-screen.tsx",
get_props=lambda ctx: {"resultId": ctx.get_step_result("split-document")},
)
)