Skip to content

Use HTTP 204 status code to indicate still running workflow #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reference/workflow-version-execution-results.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions running-requests/promptlayer-run-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
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.