Skip to content

Commit e0494a6

Browse files
authored
Merge branch 'main' into release/v2.2.6
2 parents 46151f6 + ab9aed3 commit e0494a6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libs/agno/agno/workflow/workflow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ def __init__(
237237
self.num_history_runs = num_history_runs
238238
self._workflow_session: Optional[WorkflowSession] = None
239239

240+
# Warn if workflow history is enabled without a database
241+
if self.add_workflow_history_to_steps and self.db is None:
242+
log_warning(
243+
"Workflow history is enabled (add_workflow_history_to_steps=True) but no database is configured. "
244+
"History won't be persisted. Add a database to persist runs across executions. "
245+
)
246+
240247
def set_id(self) -> None:
241248
if self.id is None:
242249
if self.name is not None:
@@ -3629,6 +3636,12 @@ def _prepare_steps(self):
36293636
step_name = step.name or f"step_{i + 1}"
36303637
log_debug(f"Step {i + 1}: Team '{step_name}' with {len(step.members)} members")
36313638
prepared_steps.append(Step(name=step_name, description=step.description, team=step))
3639+
if isinstance(step, Step) and step.add_workflow_history is True and self.db is None:
3640+
log_warning(
3641+
f"Step '{step.name or f'step_{i+1}'}' has add_workflow_history=True "
3642+
"but no database is configured in the Workflow. "
3643+
"History won't be persisted. Add a database to persist runs across executions."
3644+
)
36323645
elif isinstance(step, (Step, Steps, Loop, Parallel, Condition, Router)):
36333646
step_type = type(step).__name__
36343647
step_name = getattr(step, "name", f"unnamed_{step_type.lower()}")

0 commit comments

Comments
 (0)