forked from temporalio/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflows.py
More file actions
22 lines (17 loc) · 703 Bytes
/
Copy pathworkflows.py
File metadata and controls
22 lines (17 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from datetime import timedelta
from temporalio import common, workflow
TASK_QUEUE = "serverless-task-queue-python"
with workflow.unsafe.imports_passed_through():
from activities import hello_activity
@workflow.defn(versioning_behavior=common.VersioningBehavior.PINNED)
class SampleWorkflow:
@workflow.run
async def run(self, name: str) -> str:
workflow.logger.info("SampleWorkflow started with name: %s", name)
result = await workflow.execute_activity(
hello_activity,
name,
start_to_close_timeout=timedelta(seconds=10),
)
workflow.logger.info("SampleWorkflow completed with result: %s", result)
return result