only run script when generate_script is true (#3491)
This commit is contained in:
@@ -1676,6 +1676,7 @@ class AgentDB:
|
||||
webhook_failure_reason: str | None = None,
|
||||
ai_fallback_triggered: bool | None = None,
|
||||
job_id: str | None = None,
|
||||
run_with: str | None = None,
|
||||
) -> WorkflowRun:
|
||||
async with self.Session() as session:
|
||||
workflow_run = (
|
||||
@@ -1698,6 +1699,8 @@ class AgentDB:
|
||||
workflow_run.script_run = {"ai_fallback_triggered": ai_fallback_triggered}
|
||||
if job_id:
|
||||
workflow_run.job_id = job_id
|
||||
if run_with:
|
||||
workflow_run.run_with = run_with
|
||||
await session.commit()
|
||||
await session.refresh(workflow_run)
|
||||
await save_workflow_run_logs(workflow_run_id)
|
||||
|
||||
@@ -308,6 +308,7 @@ def convert_to_workflow_run(
|
||||
script_run=ScriptRunResponse.model_validate(workflow_run_model.script_run)
|
||||
if workflow_run_model.script_run
|
||||
else None,
|
||||
run_with=workflow_run_model.run_with,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user