server.web.routes.v3.fsm.workflow_run ===================================== .. py:module:: server.web.routes.v3.fsm.workflow_run .. autoapi-nested-parse:: Routes for WorkflowRuns. Attributes ---------- .. autoapisummary:: server.web.routes.v3.fsm.workflow_run.logger Functions --------- .. autoapisummary:: server.web.routes.v3.fsm.workflow_run.add_workflow_run server.web.routes.v3.fsm.workflow_run.terminate_workflow_run server.web.routes.v3.fsm.workflow_run.log_workflow_run_heartbeat server.web.routes.v3.fsm.workflow_run.log_workflow_run_status_update server.web.routes.v3.fsm.workflow_run.task_instances_status_check server.web.routes.v3.fsm.workflow_run.set_status_for_triaging Module Contents --------------- .. py:data:: logger .. py:function:: add_workflow_run(request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Add a workflow run to the db. .. py:function:: terminate_workflow_run(workflow_run_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Terminate task instances for a workflow run being resumed. - QUEUED/INSTANTIATED: Set directly to ERROR_FATAL (no worker exists to clean up) - LAUNCHED/RUNNING: Set to KILL_SELF (worker will detect and clean up) - HOT_RESUME: Preserve RUNNING tasks (let them finish) - COLD_RESUME: Kill everything including RUNNING tasks .. py:function:: log_workflow_run_heartbeat(workflow_run_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Log a heartbeat for the workflow run to show that the client side is still alive. .. py:function:: log_workflow_run_status_update(workflow_run_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Update the status of the workflow run. .. py:function:: task_instances_status_check(workflow_run_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Sync status of given task intance IDs. .. py:function:: set_status_for_triaging(workflow_run_id: int, request: fastapi.Request, db: sqlalchemy.orm.Session = Depends(get_db)) -> Any :async: Two triaging related status sets with improved deadlock prevention. Query all task instances that are submitted to distributor or running which haven't reported as alive in the allocated time, and set them for Triaging(from Running) and NO_HEARTBEAT(from Launched).