You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api-reference/workflow/overview.mdx
+82-14Lines changed: 82 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1825,13 +1825,6 @@ the `POST` method to call the `/workflows/<workflow-id>/run` endpoint (for `curl
1825
1825
1826
1826
<AccordionGroup>
1827
1827
<Accordiontitle="Python SDK (remote source and remote destination)">
1828
-
<Note>
1829
-
If the target workflow was originally created programmatically by the Unstructured Python SDK or with a REST API client such as `curl` or Postman,
1830
-
and the workflow uses a local source connector, you can run the workflow only with a REST API client such as `curl` or Postman,
1831
-
as described later in this section.
1832
-
You cannot run the workflow with the Python SDK or the Unstructured user interface (UI), even though the workflow is visible in the UI.
1833
-
</Note>
1834
-
1835
1828
```python
1836
1829
import os
1837
1830
@@ -1852,13 +1845,6 @@ the `POST` method to call the `/workflows/<workflow-id>/run` endpoint (for `curl
1852
1845
```
1853
1846
</Accordion>
1854
1847
<Accordiontitle="Python SDK (async) (remote source and remote destination)">
1855
-
<Note>
1856
-
If the target workflow was originally created programmatically by the Unstructured Python SDK or with a REST API client such as `curl` or Postman,
1857
-
and the workflow uses a local source connector, you can run the workflow only with a REST API client such as `curl` or Postman,
1858
-
as described later in this section.
1859
-
You cannot run the workflow with the Python SDK or the Unstructured user interface (UI), even though the workflow is visible in the UI.
1860
-
</Note>
1861
-
1862
1848
```python
1863
1849
import os
1864
1850
import asyncio
@@ -1882,6 +1868,88 @@ the `POST` method to call the `/workflows/<workflow-id>/run` endpoint (for `curl
1882
1868
asyncio.run(run_workflow())
1883
1869
```
1884
1870
</Accordion>
1871
+
<Accordiontitle="Python SDK (local source and local or remote destination)">
1872
+
In the following code, replace `</path/to/input/file>` with a relative or absolute path to a local input file for Unstructured to process. You can add multiple files, with one entry per file.
1873
+
1874
+
```python
1875
+
import os
1876
+
1877
+
from unstructured_client import UnstructuredClient
1878
+
from unstructured_client.models.operations import RunWorkflowRequest
1879
+
from unstructured_client.models.shared import InputFiles
1880
+
1881
+
input_files = []
1882
+
1883
+
for filename in [
1884
+
"<path/to/input/file>",
1885
+
"<path/to/input/file>"
1886
+
]:
1887
+
withopen(filename, "rb") as f:
1888
+
input_files.append(
1889
+
InputFiles(
1890
+
content=f.read(),
1891
+
file_name=filename
1892
+
)
1893
+
)
1894
+
1895
+
with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as client:
1896
+
response = client.workflows.run_workflow(
1897
+
request={
1898
+
"workflow_id": "<workflow-id>"
1899
+
"body_run_workflow": {
1900
+
"input_files": input_files
1901
+
}
1902
+
}
1903
+
)
1904
+
1905
+
print(response.raw_response)
1906
+
```
1907
+
1908
+
For a local destination, to access the processed files' data, [download a processed local file](#download-a-processed-local-file-from-a-job) from the workflow's job run.
1909
+
</Accordion>
1910
+
<Accordiontitle="Python SDK (async) (local source and local or remote destination)">
1911
+
In the following code, replace `</path/to/input/file>` with a relative or absolute path to a local input file for Unstructured to process. You can add multiple files, with one entry per file.
1912
+
1913
+
```python
1914
+
import os
1915
+
import asyncio
1916
+
1917
+
from unstructured_client import UnstructuredClient
1918
+
from unstructured_client.models.operations import RunWorkflowRequest
1919
+
from unstructured_client.models.shared import InputFiles
Copy file name to clipboardExpand all lines: api-reference/workflow/workflows.mdx
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,9 +116,9 @@ specify the settings for the workflow, as follows:
116
116
A workflow with a local source has the following limitations:
117
117
118
118
- The workflow cannot be set to run on a repeating schedule.
119
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
120
-
even though the workflows is visible in the UI. However, you can
121
-
run the workflow with REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
119
+
- The workflow cannot be run from the Unstructured user interface (UI),
120
+
even though the workflow is visible in the UI. However, you can
121
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
122
122
</Note>
123
123
124
124
```python
@@ -198,9 +198,9 @@ specify the settings for the workflow, as follows:
198
198
A workflow with a local source has the following limitations:
199
199
200
200
- The workflow cannot be set to run on a repeating schedule.
201
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
202
-
even though the workflows is visible in the UI. However, you can
203
-
run the workflow with REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
201
+
- The workflow cannot be run from the Unstructured user interface (UI),
202
+
even though the workflow is visible in the UI. However, you can
203
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
204
204
</Note>
205
205
206
206
```python
@@ -363,9 +363,9 @@ specify the settings for the workflow, as follows:
363
363
A workflow with a local source has the following limitations:
364
364
365
365
- The workflow cannot be set to run on a repeating schedule.
366
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
367
-
even though the workflows is visible in the UI. However, you can
368
-
run the workflow with REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
366
+
- The workflow cannot be run from the Unstructured user interface (UI),
367
+
even though the workflow is visible in the UI. However, you can
368
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
369
369
</Note>
370
370
371
371
```python
@@ -449,9 +449,9 @@ specify the settings for the workflow, as follows:
449
449
A workflow with a local source has the following limitations:
450
450
451
451
- The workflow cannot be set to run on a repeating schedule.
452
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
453
-
even though the workflows is visible in the UI. However, you can
454
-
run the workflow with REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
452
+
- The workflow cannot be run from the Unstructured user interface (UI),
453
+
even though the workflow is visible in the UI. However, you can
454
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` or Postman. [Learn how](/api-reference/workflow/overview#run-a-workflow).
455
455
</Note>
456
456
457
457
```python
@@ -565,9 +565,9 @@ specify the settings for the workflow, as follows:
565
565
A workflow with a local source has the following limitations:
566
566
567
567
- The workflow cannot be set to run on a repeating schedule.
568
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
569
-
even though the workflows is visible in the UI. However, you can
570
-
run the workflow with REST API clients such as `curl` (or Postman). [Learn how](/api-reference/workflow/overview#run-a-workflow).
568
+
- The workflow cannot be run from the Unstructured user interface (UI),
569
+
even though the workflow is visible in the UI. However, you can
570
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` (or Postman). [Learn how](/api-reference/workflow/overview#run-a-workflow).
571
571
</Note>
572
572
573
573
```bash
@@ -602,9 +602,9 @@ specify the settings for the workflow, as follows:
602
602
A workflow with a local source has the following limitations:
603
603
604
604
- The workflow cannot be set to run on a repeating schedule.
605
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
606
-
even though the workflows is visible in the UI. However, you can
607
-
run the workflow with REST API clients such as `curl` (or Postman). [Learn how](/api-reference/workflow/overview#run-a-workflow).
605
+
- The workflow cannot be run from the Unstructured user interface (UI),
606
+
even though the workflow is visible in the UI. However, you can
607
+
run the workflow with the Unstructured Python SDK, or REST API clients such as `curl` (or Postman). [Learn how](/api-reference/workflow/overview#run-a-workflow).
608
608
</Note>
609
609
610
610
```bash
@@ -680,9 +680,9 @@ specify the settings for the workflow, as follows:
680
680
A workflow with a local source has the following limitations:
681
681
682
682
- The workflow cannot be set to run on a repeating schedule.
683
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
684
-
even though the workflows is visible in the UI. However, you can
685
-
run the workflow with REST API clients such as Postman (or `curl`). [Learn how](/api-reference/workflow/overview#run-a-workflow).
683
+
- The workflow cannot be run from the Unstructured user interface (UI),
684
+
even though the workflow is visible in the UI. However, you can
685
+
run the workflow with the Unstructured Python SDK, or REST API clients such as Postman (or `curl`). [Learn how](/api-reference/workflow/overview#run-a-workflow).
686
686
</Note>
687
687
688
688
1. In the method drop-down list, select **POST**.
@@ -728,9 +728,9 @@ specify the settings for the workflow, as follows:
728
728
A workflow with a local source has the following limitations:
729
729
730
730
- The workflow cannot be set to run on a repeating schedule.
731
-
- The workflow cannot be run with the Unstructured Python SDK or from the Unstructured user interface (UI),
732
-
even though the workflows is visible in the UI. However, you can
733
-
run the workflow with REST API clients such as Postman (or `curl`). [Learn how](/api-reference/workflow/overview#run-a-workflow).
731
+
- The workflow cannot be run from the Unstructured user interface (UI),
732
+
even though the workflow is visible in the UI. However, you can
733
+
run the workflow with the Unstructured Python SDK, or REST API clients such as Postman (or `curl`). [Learn how](/api-reference/workflow/overview#run-a-workflow).
0 commit comments