From 5a4ea0932a398fdeadf1618634c6c81192902328 Mon Sep 17 00:00:00 2001 From: takatost Date: Tue, 2 Apr 2024 21:13:00 +0800 Subject: [PATCH] add inputs for workflow_started event --- api/core/app/entities/task_entities.py | 1 + api/core/app/task_pipeline/workflow_cycle_manage.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/api/core/app/entities/task_entities.py b/api/core/app/entities/task_entities.py index 29ea7bc935..5de8793cfb 100644 --- a/api/core/app/entities/task_entities.py +++ b/api/core/app/entities/task_entities.py @@ -179,6 +179,7 @@ class WorkflowStartStreamResponse(StreamResponse): id: str workflow_id: str sequence_number: int + inputs: dict created_at: int event: StreamEvent = StreamEvent.WORKFLOW_STARTED diff --git a/api/core/app/task_pipeline/workflow_cycle_manage.py b/api/core/app/task_pipeline/workflow_cycle_manage.py index 8c532d4a5d..42ea3ca780 100644 --- a/api/core/app/task_pipeline/workflow_cycle_manage.py +++ b/api/core/app/task_pipeline/workflow_cycle_manage.py @@ -267,6 +267,8 @@ class WorkflowCycleManage: :param workflow_run: workflow run :return: """ + inputs = {variable: value for variable, value in workflow_run.inputs_dict.items() + if variable != 'sys.conversation'} return WorkflowStartStreamResponse( task_id=task_id, workflow_run_id=workflow_run.id, @@ -274,6 +276,7 @@ class WorkflowCycleManage: id=workflow_run.id, workflow_id=workflow_run.workflow_id, sequence_number=workflow_run.sequence_number, + inputs=inputs, created_at=int(workflow_run.created_at.timestamp()) ) )