forked from temporalio/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstarter.py
More file actions
26 lines (19 loc) · 668 Bytes
/
starter.py
File metadata and controls
26 lines (19 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import asyncio
from temporalio.client import Client
from sentry.workflow import SentryExampleWorkflow, SentryExampleWorkflowInput
async def main():
# Connect client
client = await Client.connect("localhost:7233")
# Run workflow
try:
result = await client.execute_workflow(
SentryExampleWorkflow.run,
SentryExampleWorkflowInput(option="broken"),
id="sentry-workflow-id",
task_queue="sentry-task-queue",
)
print(f"Workflow result: {result}")
except Exception:
print("Workflow failed - check Sentry for details")
if __name__ == "__main__":
asyncio.run(main())