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.
sync flag can be included in the payload of your POST request to the
/api/v1/process/<your_flow_id> endpoint. When set to
false, the API will initiate an asynchronous task instead of processing the flow synchronously.
API Request with
Checking Task Status
You can check the status of an asynchronous task by making a GET request to the
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: