From a85bd21d9bfe89f3f4333b5c39680f8a9ed5ee70 Mon Sep 17 00:00:00 2001 From: Dmitry Mugtasimov Date: Tue, 6 May 2025 19:48:43 +0300 Subject: [PATCH] Use HTTP 204 status code to indicate still running workflow --- reference/workflow-version-execution-results.mdx | 2 +- running-requests/promptlayer-run-agent.mdx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/workflow-version-execution-results.mdx b/reference/workflow-version-execution-results.mdx index 215cd7b..9a8749c 100644 --- a/reference/workflow-version-execution-results.mdx +++ b/reference/workflow-version-execution-results.mdx @@ -5,6 +5,6 @@ openapi: "GET /workflow-version-execution-results" Retrieve the execution results of a specific Agent version. You can include all output nodes by setting the `return_all_outputs` query parameter to `true`. -This endpoint returns a status code of `200` when the agent has finished execution. If the agent is still in the process of running, it will return a status code of `202`. +This endpoint returns a status code of `200` when the agent has finished execution. If the agent is still in the process of running, it will return a status code of `204` and empty body. Please note that this feature was previously called "Workflows" and is now called "Agents". Some references to "Workflows" remain in our SDK and will be updated before the feature exits beta. \ No newline at end of file diff --git a/running-requests/promptlayer-run-agent.mdx b/running-requests/promptlayer-run-agent.mdx index bb2e0ef..9904c59 100644 --- a/running-requests/promptlayer-run-agent.mdx +++ b/running-requests/promptlayer-run-agent.mdx @@ -160,7 +160,7 @@ Start by making a request to ["POST /workflows/agentName/run"](/reference/run-wo This request requires: - `input_variables` – JSON object with the variables the agent needs - `metadata` – *optional* JSON for extra metadata -- `return_all_outputs` – Set to `true` if you want to include all intermediate node results +- `return_all_outputs` – Set to `true` if you want to include all intermediate node results for debugging purposes The response will contain a `workflow_version_execution_id` that you'll need for the next step. @@ -175,7 +175,7 @@ Include these query parameters: When polling (suggestion): - Check every **5000 ms** -- A **200** status code means the run is complete, while **202** indicates it's still running +- A **200** status code means the run is complete, while **204** (with empty body) indicates it's still running - Consider timing out after about 10 minutes -Depending on if you set `return_all_outputs` or not, you will either return the output value or all node values on completion. \ No newline at end of file +If you set `return_all_outputs` then all node values available by the moment will be returned with *200* status code even if workflow has not completed yet. \ No newline at end of file