LangflowAgent

Langflow Agent

langbot-team / LangflowAgent
Plugin0 downloadsAgent Runner1

Run a Langflow flow as a LangBot AgentRunner.

Langflow Agent

Run a Langflow flow as a LangBot AgentRunner.

Runner ID

plugin:langbot-team/LangflowAgent/default

Configuration

FieldTypeRequiredDefaultDescription
base-urlstringyeshttp://localhost:7860Langflow server URL
api-keysecretyes''Langflow API key
flow-idstringyes''Flow ID
input-typestringnochatInput type
output-typestringnochatOutput type
tweaksjsonno{}Flow tweaks
langbot-assets-enabledbooleannofalseRegister a short-lived LangBot asset token for each run and inject it into the flow via a tweak
langbot-assets-gateway-hoststringno0.0.0.0Host for the local LangBot Asset Gateway
langbot-assets-gateway-portintegerno8765Port for the local LangBot Asset Gateway
langbot-assets-gateway-request-timeoutintegerno60Timeout for individual gateway tool calls
langbot-assets-token-ttlintegerno3600Lifetime of each run token in seconds
langbot-assets-input-namestringnolangbot_asset_run_tokenFlow component (name/id) whose input_value receives the run token

LangBot Asset Callback Through Langflow MCP Tools

Langflow can call back into LangBot assets through the SDK Asset Gateway, the same mechanism the Dify runner uses. The gateway is a run-token-authorized MCP server (POST /mcp, JSON-RPC) exposing the run-authorized LangBot tools: langbot_list_assets, langbot_get_current_event, langbot_history_page, langbot_retrieve_knowledge, langbot_get_tool_detail, and langbot_call_tool.

How it works

  1. When langbot-assets-enabled is true, this runner registers a short-lived, run-scoped token before calling the flow and injects it into the run via a tweak: it sets the input_value of the component named by langbot-assets-input-name (default langbot_asset_run_token) to the token.
  2. The flow's Agent reads that value and passes it as the run_token argument on every LangBot MCP tool call.
  3. The runner removes the token when the run ends. Tool calls without a valid token are rejected by the gateway.

The gateway accepts the token via an Authorization: Bearer header or via a run_token tool-call argument. Use the run_token argument approach here.

Build the flow

  1. Add a Text Input (or similar) component whose name/id matches langbot-assets-input-name. The runner sets its input_value to the token each run. (Leave its value empty by default.)

  2. Add an MCP Tools / MCP Connection component:

    • Transport: streamable HTTP.
    • URL: the public URL routing to the gateway /mcp, e.g. https://example.com/mcp.
  3. Add an Agent component, attach the MCP Tools, and wire the token component into the Agent so its instructions pass run_token on every LangBot tool call, for example:

    For every LangBot MCP tool call, set run_token exactly to the provided
    LangBot run token. Call langbot_list_assets first to discover available
    LangBot assets for the current run.
    

Configure LangBot

Select the Langflow runner and set:

base-url = http://localhost:7860
api-key = <Langflow API key>
flow-id = <flow id>
langbot-assets-enabled = true
langbot-assets-gateway-host = 0.0.0.0
langbot-assets-gateway-port = 8765
langbot-assets-token-ttl = 3600
langbot-assets-input-name = langbot_asset_run_token

The public MCP URL in the flow's MCP component must route to this same gateway instance. The runner only injects the short-lived token into the flow tweak; it does not create or update the flow's MCP component.

Limitations

  • A remote/cloud Langflow that cannot reach localhost needs a public HTTPS URL for the gateway /mcp endpoint.
  • The run token is short-lived and run-scoped; the flow must complete its asset callbacks within the flow run.
  • The gateway exposes only the assets permitted by the current run: current event, history page, knowledge retrieval, tool detail, and tool call.
  • The flow must have a component whose name/id matches langbot-assets-input-name for the tweak injection to land; otherwise the token never reaches the Agent. Verify the tools/list handshake against your gateway when setting this up.

Legacy Runner

Migrated from langflow-api in LangBot.

Use Langflow Agent in Feishu/Lark bots, DingTalk bots, WeCom bots, WeChat bots, QQ bots, Slack bots, Discord bots, Telegram bots, LINE Bots, and Matrix Bots.

Host your bot on LangBot Cloud and connect this extension to the collaboration platforms your team already uses.

Open LangBot Cloud

Comments