@@ -325,3 +325,85 @@ For detailed examples and usage guidelines, see the [Parsian Payment Gateway Exa
325325options:
326326show_root_heading: true
327327show_source: true
328+
329+ ### Temporal {#temporal}
330+
331+ Temporal workflow orchestration adapter for durable workflow execution and activity coordination.
332+
333+ ``` python
334+ from archipy.adapters.temporal.adapters import TemporalAdapter
335+ from archipy.adapters.temporal.worker import TemporalWorkerManager
336+ from archipy.adapters.temporal.base import BaseWorkflow, BaseActivity
337+
338+ # Create a Temporal adapter
339+ temporal_adapter = TemporalAdapter() # Uses global config by default
340+
341+ # Start a workflow execution
342+ workflow_handle = await temporal_adapter.start_workflow(
343+ workflow = " MyWorkflow" ,
344+ arg = {" input" : " data" },
345+ workflow_id = " unique-workflow-id" ,
346+ task_queue = " my-task-queue"
347+ )
348+
349+ # Execute a workflow and wait for completion
350+ result = await temporal_adapter.execute_workflow(
351+ workflow = " MyWorkflow" ,
352+ arg = {" input" : " data" },
353+ workflow_id = " unique-workflow-id-2" ,
354+ task_queue = " my-task-queue"
355+ )
356+
357+ # Signal a workflow
358+ await temporal_adapter.signal_workflow(
359+ workflow_id = " unique-workflow-id" ,
360+ signal_name = " update_signal" ,
361+ arg = {" update" : " data" }
362+ )
363+
364+ # Query a workflow
365+ query_result = await temporal_adapter.query_workflow(
366+ workflow_id = " unique-workflow-id" ,
367+ query_name = " get_status"
368+ )
369+
370+ # Worker management
371+ worker_manager = TemporalWorkerManager()
372+
373+ # Start a worker
374+ worker_handle = await worker_manager.start_worker(
375+ task_queue = " my-task-queue" ,
376+ workflows = [MyWorkflow],
377+ activities = [my_activity_instance]
378+ )
379+ ```
380+
381+ For detailed examples and usage guidelines, see the [ Temporal Examples] ( ../examples/adapters/temporal.md ) .
382+
383+ #### Temporal Adapter
384+
385+ ::: archipy.adapters.temporal.adapters
386+ options:
387+ show_root_heading: true
388+ show_source: true
389+
390+ #### Temporal Ports
391+
392+ ::: archipy.adapters.temporal.ports
393+ options:
394+ show_root_heading: true
395+ show_source: true
396+
397+ #### Temporal Worker Manager
398+
399+ ::: archipy.adapters.temporal.worker
400+ options:
401+ show_root_heading: true
402+ show_source: true
403+
404+ #### Temporal Base Classes
405+
406+ ::: archipy.adapters.temporal.base
407+ options:
408+ show_root_heading: true
409+ show_source: true
0 commit comments