This commit is contained in:
Shuchang Zheng
2026-02-17 20:30:55 -08:00
committed by GitHub
parent fd8c33e0af
commit fc41285f96
30 changed files with 4013 additions and 2733 deletions

View File

@@ -43,8 +43,10 @@ from .types.totp_code import TotpCode
from .types.upload_file_response import UploadFileResponse
from .types.workflow import Workflow
from .types.workflow_create_yaml_request import WorkflowCreateYamlRequest
from .types.workflow_run import WorkflowRun
from .types.workflow_run_request_proxy_location import WorkflowRunRequestProxyLocation
from .types.workflow_run_response import WorkflowRunResponse
from .types.workflow_run_status import WorkflowRunStatus
from .types.workflow_run_timeline import WorkflowRunTimeline
from .types.workflow_status import WorkflowStatus
@@ -549,10 +551,10 @@ class Skyvern:
only_templates : typing.Optional[bool]
search_key : typing.Optional[str]
Unified search across workflow title, folder name, and parameter metadata (key, description, default_value).
Case-insensitive substring search across: workflow title, folder name, and parameter metadata (key, description, default_value). A workflow is returned if any of these fields match. Soft-deleted parameter definitions are excluded. Takes precedence over the deprecated `title` parameter.
title : typing.Optional[str]
Deprecated: use search_key instead.
Deprecated: use search_key instead. Falls back to title-only search if search_key is not provided.
folder_id : typing.Optional[str]
Filter workflows by folder ID
@@ -878,6 +880,95 @@ class Skyvern:
_response = self._raw_client.get_run_timeline(run_id, request_options=request_options)
return _response.data
def get_workflow_runs(
self,
*,
page: typing.Optional[int] = None,
page_size: typing.Optional[int] = None,
status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None,
search_key: typing.Optional[str] = None,
error_code: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[WorkflowRun]:
"""
List workflow runs across all workflows for the current organization.
Results are paginated and can be filtered by **status**, **search_key**, and **error_code**. All filters are combined with **AND** logic — a run must match every supplied filter to be returned.
### search_key
A case-insensitive substring search that matches against **any** of the following fields:
| Searched field | Description |
|---|---|
| `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
| Parameter **key** | The `key` of any workflow parameter definition associated with the run |
| Parameter **description** | The `description` of any workflow parameter definition |
| Run parameter **value** | The actual value supplied for any parameter when the run was created |
| `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
### error_code
An **exact-match** filter against the `error_code` field inside each task's `errors` JSON array. A run matches if **any** of its tasks contains an error object with a matching `error_code` value. Error codes are user-defined strings set during workflow execution (e.g. `INVALID_CREDENTIALS`, `LOGIN_FAILED`, `CAPTCHA_DETECTED`).
### Combining filters
All query parameters use AND logic:
- `?status=failed` — only failed runs
- `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
- `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
Parameters
----------
page : typing.Optional[int]
Page number for pagination.
page_size : typing.Optional[int]
Number of runs to return per page.
status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]]
Filter by one or more run statuses.
search_key : typing.Optional[str]
Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. A run is returned if any of these fields match. Soft-deleted parameter definitions are excluded from key/description matching.
error_code : typing.Optional[str]
Exact-match filter on the error_code field inside each task's errors JSON array. A run matches if any of its tasks contains an error with a matching error_code. Error codes are user-defined strings set during workflow execution.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkflowRun]
Successful Response
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.get_workflow_runs(
page=1,
page_size=1,
search_key="search_key",
error_code="error_code",
)
"""
_response = self._raw_client.get_workflow_runs(
page=page,
page_size=page_size,
status=status,
search_key=search_key,
error_code=error_code,
request_options=request_options,
)
return _response.data
def get_workflow(
self,
workflow_permanent_id: str,
@@ -1482,6 +1573,66 @@ class Skyvern:
)
return _response.data
def update_credential(
self,
credential_id: str,
*,
name: str,
credential_type: SkyvernForgeSdkSchemasCredentialsCredentialType,
credential: CreateCredentialRequestCredential,
request_options: typing.Optional[RequestOptions] = None,
) -> CredentialResponse:
"""
Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
Parameters
----------
credential_id : str
The unique identifier of the credential to update
name : str
Name of the credential
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType
Type of credential to create
credential : CreateCredentialRequestCredential
The credential data to store
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
CredentialResponse
Successful Response
Examples
--------
from skyvern import NonEmptyPasswordCredential, Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.update_credential(
credential_id="cred_1234567890",
name="My Credential",
credential_type="password",
credential=NonEmptyPasswordCredential(
password="newpassword123",
username="user@example.com",
),
)
"""
_response = self._raw_client.update_credential(
credential_id,
name=name,
credential_type=credential_type,
credential=credential,
request_options=request_options,
)
return _response.data
def delete_credential(self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
"""
Deletes a specific credential by its ID
@@ -2684,10 +2835,10 @@ class AsyncSkyvern:
only_templates : typing.Optional[bool]
search_key : typing.Optional[str]
Unified search across workflow title, folder name, and parameter metadata (key, description, default_value).
Case-insensitive substring search across: workflow title, folder name, and parameter metadata (key, description, default_value). A workflow is returned if any of these fields match. Soft-deleted parameter definitions are excluded. Takes precedence over the deprecated `title` parameter.
title : typing.Optional[str]
Deprecated: use search_key instead.
Deprecated: use search_key instead. Falls back to title-only search if search_key is not provided.
folder_id : typing.Optional[str]
Filter workflows by folder ID
@@ -3079,6 +3230,103 @@ class AsyncSkyvern:
_response = await self._raw_client.get_run_timeline(run_id, request_options=request_options)
return _response.data
async def get_workflow_runs(
self,
*,
page: typing.Optional[int] = None,
page_size: typing.Optional[int] = None,
status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None,
search_key: typing.Optional[str] = None,
error_code: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[WorkflowRun]:
"""
List workflow runs across all workflows for the current organization.
Results are paginated and can be filtered by **status**, **search_key**, and **error_code**. All filters are combined with **AND** logic — a run must match every supplied filter to be returned.
### search_key
A case-insensitive substring search that matches against **any** of the following fields:
| Searched field | Description |
|---|---|
| `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
| Parameter **key** | The `key` of any workflow parameter definition associated with the run |
| Parameter **description** | The `description` of any workflow parameter definition |
| Run parameter **value** | The actual value supplied for any parameter when the run was created |
| `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
### error_code
An **exact-match** filter against the `error_code` field inside each task's `errors` JSON array. A run matches if **any** of its tasks contains an error object with a matching `error_code` value. Error codes are user-defined strings set during workflow execution (e.g. `INVALID_CREDENTIALS`, `LOGIN_FAILED`, `CAPTCHA_DETECTED`).
### Combining filters
All query parameters use AND logic:
- `?status=failed` — only failed runs
- `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
- `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
Parameters
----------
page : typing.Optional[int]
Page number for pagination.
page_size : typing.Optional[int]
Number of runs to return per page.
status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]]
Filter by one or more run statuses.
search_key : typing.Optional[str]
Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. A run is returned if any of these fields match. Soft-deleted parameter definitions are excluded from key/description matching.
error_code : typing.Optional[str]
Exact-match filter on the error_code field inside each task's errors JSON array. A run matches if any of its tasks contains an error with a matching error_code. Error codes are user-defined strings set during workflow execution.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkflowRun]
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.get_workflow_runs(
page=1,
page_size=1,
search_key="search_key",
error_code="error_code",
)
asyncio.run(main())
"""
_response = await self._raw_client.get_workflow_runs(
page=page,
page_size=page_size,
status=status,
search_key=search_key,
error_code=error_code,
request_options=request_options,
)
return _response.data
async def get_workflow(
self,
workflow_permanent_id: str,
@@ -3797,6 +4045,74 @@ class AsyncSkyvern:
)
return _response.data
async def update_credential(
self,
credential_id: str,
*,
name: str,
credential_type: SkyvernForgeSdkSchemasCredentialsCredentialType,
credential: CreateCredentialRequestCredential,
request_options: typing.Optional[RequestOptions] = None,
) -> CredentialResponse:
"""
Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
Parameters
----------
credential_id : str
The unique identifier of the credential to update
name : str
Name of the credential
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType
Type of credential to create
credential : CreateCredentialRequestCredential
The credential data to store
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
CredentialResponse
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern, NonEmptyPasswordCredential
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.update_credential(
credential_id="cred_1234567890",
name="My Credential",
credential_type="password",
credential=NonEmptyPasswordCredential(
password="newpassword123",
username="user@example.com",
),
)
asyncio.run(main())
"""
_response = await self._raw_client.update_credential(
credential_id,
name=name,
credential_type=credential_type,
credential=credential,
request_options=request_options,
)
return _response.data
async def delete_credential(
self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> None: