Skip to content

Conversation

Spatika-Ganesh
Copy link
Contributor

Copy link

linear bot commented Sep 18, 2024

WOR-640 Handle 429 retries in Python SDK

anya pierre for scheduling

Add an argument to the run function that gracefully handles 429.

Requires WOR-114 to understand when to retry

The backend now returns proper error status codes + detailed error messages. When the retry-after header is provided in a request, we should automatically retry client side.

The feature is already implemented in the TS SDK. See https://github.com/workflowai/workflowai-js/blob/main/packages/api/src/utils/retriableFetch.ts

  • add `max_retry_delay` and `max_retry_count` as an argument to the `run` function, defaults should match the TS SDK values
  • automatically retry a run call if the `retry-after` header is present in the response and if the retry conditions are met.

@Spatika-Ganesh Spatika-Ganesh marked this pull request as draft September 18, 2024 20:40
@Spatika-Ganesh Spatika-Ganesh marked this pull request as ready for review September 19, 2024 07:36
@Spatika-Ganesh Spatika-Ganesh marked this pull request as draft September 19, 2024 20:33
@Spatika-Ganesh Spatika-Ganesh marked this pull request as ready for review September 19, 2024 22:56
@guillaq guillaq merged commit bb66ad2 into main Sep 20, 2024
5 checks passed
@guillaq guillaq deleted the spatika/wor-640-handle-429-retries-in-python-sdk branch September 20, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants