← Lesson
When Not to Agent
Joeven
Run
Reset
Python loads on first run
def workflow_invoice(row, skip_validation=False): steps = ["validate", "tax", "send"] if skip_validation: steps = ["tax", "send"] out = [] for s in steps: out.append(s) return out def agent_should_run(goal, tools, has_eval): if not tools: return False, "no tools — use a template" if goal == "fixed_invoice": return False, "checklist — use a workflow" if not has_eval: return False, "cannot score done" return True, "branching work" print("invoice", workflow_invoice({"id": 1})) print("skip in code", workflow_invoice({"id": 1}, skip_validation=True)) print(agent_should_run("fixed_invoice", ["send"], True)) print(agent_should_run("debug prod", [], True)) print(agent_should_run("debug prod", ["logs", "finish"], True)) print(agent_should_run("be clever", ["search"], False))
Run to execute this in your browser. Nothing is sent to a server.