Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"generatorConfig": {
"client_class_name": "PhenomlClient"
},
"originGitCommit": "cdfe611a02d68f09dbce1eb259387269402552fb",
"sdkVersion": "9.0.0"
"originGitCommit": "670d2f19d924d953196b4131bb16a252f2b6148f",
"sdkVersion": "9.1.0"
}
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 9.1.0 - 2026-03-11
* The workflow execution methods now support an optional `preview` parameter. When set to true, workflows return mock resources instead of persisting data to the FHIR server, enabling safe testing and development.

## 9.0.0 - 2026-03-11
* The `ErrorResponse` type has been removed from the summary module. If your code references `phenoml.summary.ErrorResponse` or imports it directly, you'll need to update your error handling logic to use the appropriate error types for your specific use case.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "phenoml"
version = "9.0.0"
version = "9.1.0"
description = ""
readme = "README.md"
authors = []
Expand Down
8 changes: 8 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6689,6 +6689,14 @@ client.workflows.execute(
<dl>
<dd>

**preview:** `typing.Optional[bool]` — If true, create operations return mock resources instead of persisting to the FHIR server

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
Expand Down
4 changes: 2 additions & 2 deletions src/phenoml/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "phenoml/9.0.0",
"User-Agent": "phenoml/9.1.0",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "phenoml",
"X-Fern-SDK-Version": "9.0.0",
"X-Fern-SDK-Version": "9.1.0",
**(self.get_custom_headers() or {}),
}
token = self._get_token()
Expand Down
16 changes: 14 additions & 2 deletions src/phenoml/workflows/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def execute(
id: str,
*,
input_data: typing.Dict[str, typing.Any],
preview: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ExecuteWorkflowResponse:
"""
Expand All @@ -292,6 +293,9 @@ def execute(
input_data : typing.Dict[str, typing.Any]
Input data for workflow execution

preview : typing.Optional[bool]
If true, create operations return mock resources instead of persisting to the FHIR server

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -315,7 +319,9 @@ def execute(
},
)
"""
_response = self._raw_client.execute(id, input_data=input_data, request_options=request_options)
_response = self._raw_client.execute(
id, input_data=input_data, preview=preview, request_options=request_options
)
return _response.data


Expand Down Expand Up @@ -622,6 +628,7 @@ async def execute(
id: str,
*,
input_data: typing.Dict[str, typing.Any],
preview: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ExecuteWorkflowResponse:
"""
Expand All @@ -635,6 +642,9 @@ async def execute(
input_data : typing.Dict[str, typing.Any]
Input data for workflow execution

preview : typing.Optional[bool]
If true, create operations return mock resources instead of persisting to the FHIR server

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -666,5 +676,7 @@ async def main() -> None:

asyncio.run(main())
"""
_response = await self._raw_client.execute(id, input_data=input_data, request_options=request_options)
_response = await self._raw_client.execute(
id, input_data=input_data, preview=preview, request_options=request_options
)
return _response.data
10 changes: 10 additions & 0 deletions src/phenoml/workflows/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def execute(
id: str,
*,
input_data: typing.Dict[str, typing.Any],
preview: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[ExecuteWorkflowResponse]:
"""
Expand All @@ -556,6 +557,9 @@ def execute(
input_data : typing.Dict[str, typing.Any]
Input data for workflow execution

preview : typing.Optional[bool]
If true, create operations return mock resources instead of persisting to the FHIR server

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -569,6 +573,7 @@ def execute(
method="POST",
json={
"input_data": input_data,
"preview": preview,
},
headers={
"content-type": "application/json",
Expand Down Expand Up @@ -1162,6 +1167,7 @@ async def execute(
id: str,
*,
input_data: typing.Dict[str, typing.Any],
preview: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[ExecuteWorkflowResponse]:
"""
Expand All @@ -1175,6 +1181,9 @@ async def execute(
input_data : typing.Dict[str, typing.Any]
Input data for workflow execution

preview : typing.Optional[bool]
If true, create operations return mock resources instead of persisting to the FHIR server

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -1188,6 +1197,7 @@ async def execute(
method="POST",
json={
"input_data": input_data,
"preview": preview,
},
headers={
"content-type": "application/json",
Expand Down
4 changes: 4 additions & 0 deletions src/phenoml/workflows/types/execute_workflow_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class ExecuteWorkflowResponse(UniversalBaseModel):
"""

results: typing.Optional[ExecuteWorkflowResponseResults] = None
preview: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether the workflow was executed in preview mode
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
Loading