Skip to content

Add workflow#565

Open
awu0403 wants to merge 8 commits into
masterfrom
add-workflow
Open

Add workflow#565
awu0403 wants to merge 8 commits into
masterfrom
add-workflow

Conversation

@awu0403

@awu0403 awu0403 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread repo_workflow/workflow_executor.py Outdated
global_variables: Dict[str, Any] = None
node_executions: Dict[str, NodeExecution] = None

# def __post_init__(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里 两个 post_init 没用的话可以删掉, 同时在这里定义的类中增加一些简要的注释说明

Comment thread repo_workflow/workflow_executor.py Outdated
def _execute_trigger_node(self, context, node_data):
config_id = node_data.get('data', {}).get('config_id')
#TODO: handle other trigger types
if config_id == 'file_upload':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里触发节点改成 file_added, 不止是文件上传, 还有文件添加

Comment thread repo_workflow/workflow_executor.py Outdated
logger.info(f"Triggering workflow {workflow['id']} for file upload in repo {repo_id}")

trigger_data = {
'trigger_type': 'file_upload',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_upload--> file_added

Comment thread repo_workflow/workflow_task_handler.py Outdated
self._db_session_class = init_db_session_class()


def add_file_upload_workflow_task(self, record):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_file_added_workflow_task

@@ -0,0 +1,489 @@
import os

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo_workflow/utils.py 文件是空的,没用可以删掉

Comment thread repo_workflow/workflow_executor.py Outdated
# dependencies = graph.get_node_dependencies(node_id)
# if not all(dep in completed_nodes for dep in dependencies):
# execution_queue.append(node_id)
# continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没用的代码可以删掉

trigger_handler = WorkflowTriggerHandler(db_connection=session)
trigger_handler.handle_add_file_event(record)
except Exception as e:
logger.error(f"Error in file upload workflow event handler: {str(e)}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

出现错误之后需要 对workflow set_invalid, 否则会不断运行以及出错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants