fix: prevent SQLite error in advanced run flow API (#8576)

* fix: prevent SQLite error in advanced run flow API

Passing the flow ID as a string causes a SQLAlchemy error when running
on databases without a dedicated UUID data type. Passing a UUID object
works consistently across both SQLite and PostgreSQL.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Reid Beels 2025-06-17 04:39:56 -07:00 committed by GitHub
commit 1950116916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5616 additions and 3890 deletions

View file

@ -544,7 +544,7 @@ async def experimental_run_flow(
try:
# Get the flow that matches the flow_id and belongs to the user
# flow = session.query(Flow).filter(Flow.id == flow_id).filter(Flow.user_id == api_key_user.id).first()
stmt = select(Flow).where(Flow.id == flow_id_str).where(Flow.user_id == api_key_user.id)
stmt = select(Flow).where(Flow.id == flow_id).where(Flow.user_id == api_key_user.id)
flow = (await session.exec(stmt)).first()
except sa.exc.StatementError as exc:
# StatementError('(builtins.ValueError) badly formed hexadecimal UUID string')

9504
uv.lock generated

File diff suppressed because it is too large Load diff