add inputs for workflow_started event

This commit is contained in:
takatost 2024-04-02 21:13:00 +08:00
parent f7e4f0a988
commit 5a4ea0932a
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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())
)
)