diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index afa3cb63a9..2887c2129d 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -2569,7 +2569,7 @@ async def create_automation( return json.dumps({'error': 'User not found'}) # Always use the calling model for the automation - model_id = (__metadata__ or {}).get('model_id') + model_id = (__metadata__ or {}).get('model', {}).get('id') if not model_id: return json.dumps({'error': 'Could not detect current model'})