diff --git a/api-reference/workflow/overview.mdx b/api-reference/workflow/overview.mdx index 6a453edf..c9194f5d 100644 --- a/api-reference/workflow/overview.mdx +++ b/api-reference/workflow/overview.mdx @@ -1736,7 +1736,7 @@ the `POST` method to call the `/workflows//run` endpoint (for `curl asyncio.run(run_workflow()) ``` - + ```bash curl --request 'POST' --location \ "$UNSTRUCTURED_API_URL/workflows//run" \ @@ -1744,7 +1744,33 @@ the `POST` method to call the `/workflows//run` endpoint (for `curl --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" ``` - + + To run a workflow that uses a local source and local destination, the workflow must have already been created to use a local source and a local destination. Also, + the workflow must have already been created as a custom worklow, and the workflow cannot have been created to run on a schedule. + + The workflow's source and destination must both be local. You cannot run a workflow that specifies a local source and a remote destination, nor can you run a worklow that specifies a remote source + and a local destination. + + The Unstructured user interface (UI) and the Unstructured Python SDK currently do not support running workflows that use a local source + and a local destination. + + In the following command, replace: + + - `` with the full path to the local file to upload. + - `` with the filename of the local file to upload. + - `` with the local file's media type. For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). + + ```bash + curl --request 'POST' --location \ + "$UNSTRUCTURED_API_URL/workflows//run" \ + --header 'accept: application/json' \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \ + --form "input_files=@" \ + --form "filename=" \ + --form "type=" \ + ``` + + 1. In the method drop-down list, select **POST**. 2. In the address box, enter the following URL: @@ -1759,6 +1785,38 @@ the `POST` method to call the `/workflows//run` endpoint (for `curl 4. Click **Send**. + + To run a workflow that uses a local source and local destination, the workflow must have already been created to use a local source and a local destination. Also, + the workflow must have already been created as a custom worklow, and the workflow cannot have been created to run on a schedule. + + The workflow's source and destination must both be local. You cannot run a workflow that specifies a local source and a remote destination, nor can you run a worklow that specifies a remote source + and a local destination. + + The Unstructured user interface (UI) and the Unstructured Python SDK currently do not support running workflows that use a local source + and a local destination. + + 1. In the method drop-down list, select **POST**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/workflows//run + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. On the **Body** tab, select **form-data**, and specify the settings for the workflow run: + + - **Key**: `input_files`, **File**, **Value**: Click the **Value** box, then click **New file from local machine**, and select the file to upload. + - **Key**: `filename`, **Text**, **Value**: Type the name of the file that you just uploaded. + - **Key**: `type`, **Text**, **Value**: `` + + For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). + + 5. Click **Send**. + To run a workflow on a schedule instead, specify the `schedule` setting in the request body when you create or update a @@ -2284,3 +2342,51 @@ the `POST` method to call the `/jobs//cancel` endpoint (for `curl` or Po 4. Click **Send**. + +### Download a processed local file from a job + +This applies only to jobs that use a workflow with a local source and a local destination. + +To download a processed local file from a completed job, use `GET` to call the `/jobs//download` endpoint, replacing +`` with the job's unique ID. To get this ID, see [List jobs](#list-jobs). + +You must also provide Unstructured's IDs for the file to download and the workflow's output node. To get these IDs, see [Get a job](#get-a-job). In the +response: + +- Unstructured's IDs for the file to download and the workflow's output node are in the `output_node_files` array. +- The ID for the file to download is in the `output_node_files` array's `file_id` field. +- The ID for the workflow's output node is in the `output_node_files` array's `node_id` field. + +Currently, you cannot use the Unstructured user interface (UI) or the Unstructured Python SDK to download a file from a job that uses a +workflow with a local source and a local destination. + + + + ```bash + curl --request 'GET' --location \ + "$UNSTRUCTURED_API_URL/jobs//download?file_id=&node_id=" \ + --header 'accept: application/json' \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" + ``` + + + 1. In the method drop-down list, select **GET**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/jobs//download + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. On the **Params** tab, enter the following query parameters: + + - **Key**: `file_id`, **Value**: `` + - **Key**: `node_id`, **Value**: `` + + 5. Click **Send**. + + \ No newline at end of file diff --git a/api-reference/workflow/workflows.mdx b/api-reference/workflow/workflows.mdx index 643a8ec6..8ff5d64b 100644 --- a/api-reference/workflow/workflows.mdx +++ b/api-reference/workflow/workflows.mdx @@ -193,7 +193,7 @@ specify the settings for the workflow, as follows: asyncio.run(create_workflow()) ``` - + ```bash curl --request 'POST' --location \ "$UNSTRUCTURED_API_URL/workflows" \ @@ -222,7 +222,41 @@ specify the settings for the workflow, as follows: }' ``` - + + To use a local source and a local destination, do not specify a `source_id` or `destination_id` value. Also, the `workflow_type` must be set to `custom`. + + The source and destination must both be local. You cannot specify a local source and a remote destination, nor can you specify a remote source + and a local destination. + + The Unstructured user interface (UI) and the Unstructured Python SDK currently do not support creating a workflow with a local source + and a local destination. + + ```bash + curl --request 'POST' --location \ + "$UNSTRUCTURED_API_URL/workflows" \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \ + --header 'accept: application/json' \ + --data \ + '{ + "name": "", + "workflow_type": "custom", + "workflow_nodes": [ + { + "name": "", + "type": "", + "subtype": "", + "settings": { + "...": "..." + } + }, + { + "...": "..." + } + ] + }' + ``` + + 1. In the method drop-down list, select **POST**. 2. In the address box, enter the following URL: @@ -262,6 +296,51 @@ specify the settings for the workflow, as follows: 5. Click **Send**. + + To use a local source and a local destination do not specify a `source_id` or `destination_id` value. Also, the `workflow_type` must be set to `custom`. + + The source and destination must both be local. You cannot specify a local source and a remote destination, nor can you specify a remote source + and a local destination. + + The Unstructured user interface (UI) and the Unstructured Python SDK currently do not support creating a workflow with a local source + and a local destination. + + 1. In the method drop-down list, select **POST**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/workflows + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. On the **Body** tab, select **raw** and **JSON**, and specify the settings for the workflow: + + ```json + { + "name": "", + "workflow_type": "custom", + "workflow_nodes": [ + { + "name": "", + "type": "", + "subtype": "", + "settings": { + "...": "..." + } + }, + { + "...": "..." + } + ] + } + ``` + + 5. Click **Send**. + Replace the preceding placeholders as follows: