Overview
This example demonstrates a complete workflow that:- Logs into a desktop application using secure credentials
- Searches for a customer by name
- Extracts structured customer data
- Downloads and organizes invoice files
Complete Code
workflow.py
Breakdown
Input Models
The workflow accepts structured parameters with validation:SecureParams:
Secure Login
The password is typed viacomputer.type(), which sends a reference to the orchestrator. The real value never enters the desktop:
File Handling
The workflow uses two file strategies:- Copy to workflow directory
- Stream to mount
Files copied to the workflow’s working directory end up in
assets.zip:Returning Results
model_validate() runs the full Pydantic validation pipeline on the extracted dict and raises if any Field constraint is violated. This catches bad extractions (e.g. missing fields, wrong types, out-of-range values) before the result reaches your webhook, so prefer it even when the data looks trusted.
API Request
Because this workflow takes asecure_workflow_params, the request must be HMAC-signed — the simple x-api-key flow alone returns a 403. See Secure Parameters for the signing scheme; the trigger body itself looks like this: