diff --git a/docs/docs/guidelines/async-api.mdx b/docs/docs/guidelines/async-api.mdx deleted file mode 100644 index 4b40f2c1d..000000000 --- a/docs/docs/guidelines/async-api.mdx +++ /dev/null @@ -1,73 +0,0 @@ -import Admonition from "@theme/Admonition"; - -# Asynchronous Processing - -## Introduction - -Starting from version 0.5, Langflow introduces a new feature to its API: the _`sync`_ flag. This flag allows users to opt for asynchronous processing of their flows, freeing up resources and enabling better control over long-running tasks. -This feature supports running tasks in a Celery worker queue and AnyIO task groups for now. - - - This is an experimental feature. The default behavior of the API is still - synchronous processing. The API may change in the future. - - -## The _`sync`_ Flag - -The _`sync`_ flag can be included in the payload of your POST request to the _`/api/v1/run/`_ endpoint. -When set to _`false`_, the API will initiate an asynchronous task instead of processing the flow synchronously. - -### API Request with _`sync`_ flag - -```bash -curl -X POST \ - http://localhost:3000/api/v1/run/ \ - -H 'Content-Type: application/json' \ - -H 'x-api-key: ' \ - -d '{"input_value": "Message", "tweaks": {}, "sync": false}' -``` - -Response: - -```json -{ - "result": { - "output": "..." - }, - "task": { - "id": "...", - "href": "api/v1/task/" - }, - "session_id": "...", - "backend": "..." // celery or anyio -} -``` - -## Checking Task Status - -You can check the status of an asynchronous task by making a GET request to the `/task/{task_id}` endpoint. - -```bash -curl -X GET \ - http://localhost:3000/api/v1/task/ \ - -H 'x-api-key: ' -``` - -### Response - -The endpoint will return the current status of the task and, if completed, the result of the task. Possible statuses include: - -- _`PENDING`_: The task is waiting for execution. -- _`SUCCESS`_: The task has completed successfully. -- _`FAILURE`_: The task has failed. - -Example response for a completed task: - -```json -{ - "status": "SUCCESS", - "result": { - "output": "..." - } -} -``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 029ccf94e..07af44af3 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -73,7 +73,6 @@ module.exports = { items: [ "guidelines/login", "guidelines/api", - "guidelines/async-api", "guidelines/components", "guidelines/features", "guidelines/collection",