hatchet-dev / hatchet-python

Hatchet Python SDK for Interacting with the Hatchet Engine
16 stars 9 forks source link

feat: expose event list and replay #91

Closed grutt closed 1 month ago

grutt commented 1 month ago

Exposes event list and event replay apis to allow users to create scripts to programmatically replay events. Example usage:

from dotenv import load_dotenv

from hatchet_sdk import Hatchet
from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus

load_dotenv()

hatchet = Hatchet(debug=True)

if __name__ == "__main__":
    # Look up the failed workflow runs
    failed = hatchet.client.rest.events_list(
        statuses=[WorkflowRunStatus.FAILED], limit=3
    )

    # Replay the failed workflow runs
    retried = hatchet.client.rest.events_replay(failed)