Auto-start workflow if one isn't found to get rid of startup error

This commit is contained in:
Laine
2025-03-12 10:20:27 -04:00
parent b52cef0d05
commit 0306a5d726
2 changed files with 10 additions and 4 deletions

View File

@@ -113,10 +113,14 @@ async def get_conversation_history():
status_code=404, detail="Workflow worker unavailable or not found."
)
# For other Temporal errors, return a 500
raise HTTPException(
status_code=500, detail="Internal server error while querying workflow."
)
if "workflow not found" in error_message:
await start_workflow()
return []
else:
# For other Temporal errors, return a 500
raise HTTPException(
status_code=500, detail="Internal server error while querying workflow."
)
@app.get("/agent-goal")
async def get_agent_goal():