diff --git a/src/backend/base/langflow/custom/custom_component/component.py b/src/backend/base/langflow/custom/custom_component/component.py index 58a387f1b..3d6bcef42 100644 --- a/src/backend/base/langflow/custom/custom_component/component.py +++ b/src/backend/base/langflow/custom/custom_component/component.py @@ -114,6 +114,12 @@ class Component(CustomComponent): if not isinstance(custom_repr, str): custom_repr = str(custom_repr) raw = result + if self.status is None: + artifact_value = raw + else: + artifact_value = self.status + raw = self.status + if hasattr(raw, "data") and raw is not None: raw = raw.data if raw is None: @@ -123,11 +129,6 @@ class Component(CustomComponent): raw = raw.model_dump() if raw is None and isinstance(result, (dict, Data, str)): raw = result.data if isinstance(result, Data) else result - if self.status is None: - artifact_value = raw - else: - artifact_value = self.status - raw = self.status artifact_type = get_artifact_type(artifact_value, result) raw = post_process_raw(raw, artifact_type) artifact = {"repr": custom_repr, "raw": raw, "type": artifact_type}