Add early-return optimizations so both backend and frontend avoid unnecessary URL extraction and disk scanning when a workflow has no nodes or contains no potential model references. Also tighten API input validation by rejecting non-object workflow_json.