The Problem
Consider a loan document with a “Section G” containing many fields. Without structured inputs, you’d need to define separate variables for each:The Solution: Nested Access
With structured inputs, you can pass a single JSON object and access nested properties directly:- TypeScript
- Python
Syntax Reference
Dot Notation
Access object properties with.:
Bracket Notation (Arrays)
Access array elements by index:Bracket Notation (Special Keys)
For keys with special characters, use bracket notation with quotes:Combining Notations
Chain any combination for deeply nested structures:Works Across All Variable Types
Structured access works consistently for all three variable types:| Type | Syntax | Example |
|---|---|---|
| Input | {var.path} | {patient.demographics.dob} |
| Sensitive | {$var.path} | {$credentials.api_key} |
| Runtime | {{var.path}} | {{extracted_data.invoice_id}} |
Sensitive Inputs Example
Runtime Values Example
When afocused_action sets a runtime value as an object:
Error Handling
Type Mismatches (Fails the Run)
If you try to access a nested property on a value that isn’t an object or array, the run fails immediately with a clear error:Missing Fields (Uses __EMPTY__)
If a nested path simply doesn’t exist, it’s replaced with the __EMPTY__ sentinel value (same behavior as regular empty inputs):
Array Out of Bounds
Accessing an array index that doesn’t exist is treated as missing (not a type error):Backward Compatibility
Existing workflows continue to work exactly as before:{variable}with a string value → replaced with the string{variable}with an object/array value (no nested access) → JSON stringified
Best Practices
Group Related Fields
Organize related inputs into logical objects (e.g.,
patient, billing, shipping) rather than dozens of flat variables.Use Consistent Structures
Define a standard schema for your inputs across workflows. This makes SDK integration easier and reduces errors.
Validate Early
Cyberdesk validates type mismatches at run start. Structure your inputs correctly to catch errors before execution begins.
Handle Optional Fields
Missing nested fields become
__EMPTY__. Design your prompts to handle this gracefully for optional data.Real-World Example: Healthcare Form
- TypeScript
- Python