Files
langflow/src
Eric Hare c493c817d9 fix(api): parse multipart/form-data on /run so session_id is preserved (#13092)
* fix(api): parse multipart/form-data on /run so session_id is preserved

parse_input_request_from_body always parsed the request body as JSON,
so multipart/form-data requests to /api/v1/run/{flow_id} (e.g. uploading
a file inline alongside text and a session_id) silently failed to parse
and returned a default SimplifiedAPIRequest. The flow then executed with
no input_value, no files, and routed the conversation into the default
session keyed on the flow_id rather than the caller-supplied session_id.

Detect multipart bodies and parse them via request.form() instead, mapping
string-valued fields (input_value, input_type, output_type,
output_component, session_id) and JSON-decoded tweaks onto
SimplifiedAPIRequest. Non-string entries (e.g. UploadFile values) are
ignored so inline file uploads do not crash the parser. JSON requests
continue to go through the existing fast path.

Fixes #9859.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-15 21:31:39 +00:00
..