test: prove saved artifact subgraphs via Python client

This commit is contained in:
lda
2026-09-03 14:49:44 +07:00 Verified
parent 143e70bcf7
commit 327a7b24b0
3 changed files with 147 additions and 2 deletions
+16 -1
View File
@@ -117,7 +117,7 @@ a durable run would use the following complete flow:
from pydantic import BaseModel
from wf_client import App
from wf_authoring import input_from, input_value, output_to, state_path
from wf_authoring import input_from, input_path, input_value, output_to, state_path
class Input(BaseModel):
@@ -181,6 +181,21 @@ paged immutable summary rows; `app.deployments()` returns an immutable tuple.
Call `app.workflow(id, version=...)`, `app.deployment(id)`, or `app.run(id)` to
reconstruct the selected rich object.
A saved workflow artifact can be used directly as a native subgraph:
```python
child = await app.workflow("child", version=2)
child_step = parent.subgraph(
child,
input=[input_from(input_path("prompt"), "prompt")],
output=[output_to("value", state_path("result"))],
)
```
The boundary snapshots the child's public input/output contract for local
validation. The saved parent retains the exact child artifact ID and version;
deployment validation and execution resolve that separate saved dependency.
## WorkflowApiSurface And Domain Services
`WorkflowApiSurface` is the public application contract shared by local and