Files
bin/projekt-matching/components/pm_crm.py
tlg e1be3ff17e fix(projekt-matching): rename component input ctx -> ctx_in (Langflow reserves Component.ctx)
Langflow 1.10's Component base class defines ctx as a @property returning
the flow-level graph.context store; a DataInput named ctx is silently
shadowed at attribute access, so the edge-delivered payload never reaches
build_out(). Renamed the field in the five downstream Flow-2 wrappers;
build_flows.py edges target ctx_in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 13:00:06 +02:00

34 lines
1.2 KiB
Python

import sys
if "/app/langflow" not in sys.path:
sys.path.insert(0, "/app/langflow")
from langflow.custom import Component
from langflow.io import DataInput, MessageTextInput, Output, SecretStrInput
from langflow.schema import Data
from projektmatch import stages
from projektmatch.config import Cfg
class PMCrm(Component):
display_name = "PM 5 CRM"
description = "EspoCRM: Team, Firma, Kontakt, Verkaufschance + Verify"
inputs = [
DataInput(name="ctx_in", display_name="Context"),
MessageTextInput(name="espo_base", display_name="Espo Base",
value="PM_ESPO_BASE", load_from_db=True,
advanced=True),
SecretStrInput(name="espo_api_key", display_name="Espo API Key",
value="PM_ESPO_API_KEY", load_from_db=True,
advanced=True),
]
outputs = [Output(name="out", display_name="Context", method="build_out")]
def build_out(self) -> Data:
cfg = Cfg(espo_base=self.espo_base, espo_api_key=self.espo_api_key)
ctx = stages.run_stage("crm", stages.stage_crm,
dict(self.ctx_in.data), cfg)
self.status = ctx.get("status", "")
return Data(data=ctx)