(workflows)
- create_workflow - Create Workflow
- delete_workflow - Delete Workflow
- get_workflow - Get Workflow
- list_workflows - List Workflows
- run_workflow - Run Workflow
- update_workflow - Update Workflow
Create a new workflow, either custom or auto, and configure its settings.
from unstructured_client import UnstructuredClient
from unstructured_client.models import shared
with UnstructuredClient() as uc_client:
res = uc_client.workflows.create_workflow(request={
"create_workflow": {
"name": "<value>",
"workflow_type": shared.WorkflowType.ADVANCED,
},
})
assert res.workflow_information is not None
# Handle response
print(res.workflow_information)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CreateWorkflowRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.CreateWorkflowResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete a workflow by its ID.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.workflows.delete_workflow(request={
"workflow_id": "3e61b8a6-32b6-47cf-bce7-6d13357b30eb",
})
assert res.any is not None
# Handle response
print(res.any)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteWorkflowRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DeleteWorkflowResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Retrieve detailed information for a specific workflow by its ID.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.workflows.get_workflow(request={
"workflow_id": "d031b0e5-7ca7-4a2b-b3cc-d869d2df3e76",
})
assert res.workflow_information is not None
# Handle response
print(res.workflow_information)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetWorkflowRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkflowResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Retrieve a list of workflows, optionally filtered by source, destination, state, name, date range, and supports pagination and sorting.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.workflows.list_workflows(request={})
assert res.response_list_workflows is not None
# Handle response
print(res.response_list_workflows)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListWorkflowsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.ListWorkflowsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Run a workflow by triggering a new job if none is currently active.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.workflows.run_workflow(request={
"workflow_id": "e7054f23-ce92-4bf1-a1d7-7cf9cb14d013",
})
assert res.job_information is not None
# Handle response
print(res.job_information)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.RunWorkflowRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.RunWorkflowResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update an existing workflow's name, connectors, schedule, or workflow type.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.workflows.update_workflow(request={
"update_workflow": {},
"workflow_id": "b9b7e688-353f-4ff2-bcd7-a49b5fa5f6c7",
})
assert res.workflow_information is not None
# Handle response
print(res.workflow_information)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateWorkflowRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.UpdateWorkflowResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |