diff --git a/python-sdk/examples/manual_trigger/trigger-generator.py b/python-sdk/examples/manual_trigger/trigger-generator.py deleted file mode 100644 index 54674f5cb..000000000 --- a/python-sdk/examples/manual_trigger/trigger-generator.py +++ /dev/null @@ -1,32 +0,0 @@ -from hatchet_sdk import Hatchet -from dotenv import load_dotenv -import json - -class StepRunEventType: - STEP_RUN_EVENT_TYPE_STARTED = 'STEP_RUN_EVENT_TYPE_STARTED' - STEP_RUN_EVENT_TYPE_COMPLETED = 'STEP_RUN_EVENT_TYPE_COMPLETED' - STEP_RUN_EVENT_TYPE_FAILED = 'STEP_RUN_EVENT_TYPE_FAILED' - STEP_RUN_EVENT_TYPE_CANCELLED = 'STEP_RUN_EVENT_TYPE_CANCELLED' - STEP_RUN_EVENT_TYPE_TIMED_OUT = 'STEP_RUN_EVENT_TYPE_TIMED_OUT' - -load_dotenv() - -hatchet = Hatchet().client - -workflowRunId = hatchet.admin.run_workflow("ManualTriggerWorkflow", { - "test": "test" -}) - -listener = hatchet.listener.stream(workflowRunId) - -for event in listener: - # TODO FIXME step run is not exported easily from the hatchet_sdk and event type and event.step is not defined on - # the event object, so fix this before merging... - - # if event.step == 'step2' and event.type == StepRunEventType.STEP_RUN_EVENT_TYPE_COMPLETED: - # listener.abort() - - if event.type == StepRunEventType.STEP_RUN_EVENT_TYPE_COMPLETED: - print('Step completed: ' + json.dumps(event.payload)) - -print('Workflow finished') \ No newline at end of file diff --git a/python-sdk/examples/manual_trigger/trigger-on.py b/python-sdk/examples/manual_trigger/trigger-on.py index 1a4e61d35..16e675f81 100644 --- a/python-sdk/examples/manual_trigger/trigger-on.py +++ b/python-sdk/examples/manual_trigger/trigger-on.py @@ -12,5 +12,3 @@ client.listener.on(workflowRunId, lambda event: print( 'EVENT: ' + event.type + ' ' + json.dumps(event.payload))) - -# TODO - need to hangup the listener if the workflow is completed