mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-30 14:39:56 -05:00
Fix: Python docs examples (#2255)
* feat: client example * fix: batch i * fix: batch ii * fix: batch iii * fix: batch iv
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# > Schedule a Task
|
||||
from examples.simple.worker import simple
|
||||
from datetime import datetime
|
||||
|
||||
schedule = simple.schedule([datetime(2025, 3, 14, 15, 9, 26)])
|
||||
|
||||
## 👀 do something with the id
|
||||
print(schedule.id)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from examples.simple.worker import simple
|
||||
from hatchet_sdk import TriggerWorkflowOptions
|
||||
|
||||
# > Trigger with metadata
|
||||
simple.run(
|
||||
options=TriggerWorkflowOptions(
|
||||
additional_metadata={"source": "api"} # Arbitrary key-value pair
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
from hatchet_sdk import Hatchet
|
||||
|
||||
hatchet = Hatchet()
|
||||
|
||||
# > Define a workflow
|
||||
simple = hatchet.workflow(name="example-workflow")
|
||||
Reference in New Issue
Block a user