Code-first LangChain and LangGraph apps stay in your repo. Point the chat model at ValGuard. Canvas graphs are different: Langflow and Flowise JSON can become a playbook draft in the migration wizard.
Two paths
| Path | When to use |
|---|---|
OpenAI-compatible base_url and X-VG-Agent | Python or TypeScript chains and graphs with no canvas export |
| Migration wizard (Langflow or Flowise) | Visual graph JSON in a supported export |
There is no LangChain choice in the wizard. Pick Langflow or Flowise.
What imports
| Source concept | ValGuard mapping |
|---|---|
| LLM, chat, agent, and prompt-like node types | Agent role and agent step |
| HTTP, webhook, request, and API node types | HTTP stub step with a placeholder URL |
| Edges between LLM nodes | Routes: always, or expression when the handle includes false |
| Consecutive steps | Always and fallback routes when edges are sparse |
Converter ids: langflow/2026-08-v1 (langflow/flow-json/1.x) and flowise/2026-08-v1 (flowise/chatflow/1.x). n8n workflows that include LangChain LLM nodes use n8n/2026-08-v1.
What does not import (or needs rework)
- Python or TypeScript LangChain and LangGraph source (no JSON export for the wizard)
- Custom tools, retrievers, and memory that are not LLM or HTTP nodes
- Branch, router, and switch nodes (skipped, with a warning)
- Unknown node types (skipped manual tasks)
- Credentials and API keys (re-enter in Provider Vault / BYOK)
- LangChain Expression Language (LCEL) as a ValGuard runtime
Keep LangChain or LangGraph when the graph lives in code. Put ValGuard on the LLM hop. LangChain integration · LangGraph · stack map.
Mapping table (mental model)
flowchart LR
A[Langflow or Flowise JSON] --> W[Migration wizard]
W --> D[Playbook draft]
D --> V[Attach validators]
V --> S[Shadow]
S --> E[Enforce]
C[Code LangChain or LangGraph] --> P[OpenAI-compatible proxy]
P --> V
Run the importer
- Canvas: open the migration wizard, choose Langflow or Flowise, and upload the export JSON.
- Code: point
ChatOpenAI(or the equivalent client) at ValGuard. No upload step. Full setup is on the LangChain integration page.
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="openai/gpt-4o-mini",
base_url="https://api.valguard.ai/v1",
api_key=os.environ["VG_API_KEY"],
default_headers={"X-VG-Agent": "langchain-router"},
)
- Review migrated, stubbed, and skipped nodes in the report.
- Create or bind agents, then attach packs.
- Save as a draft. Do not enforce yet.
Post-import checklist
- Every LLM step has an agent slug and packs.
- Shadow mode on for a week of synthetic or sanitized traffic. Shadow mode.
- Fail-closed path defined for blocks. Fail-closed.
- Provider keys in the vault. No secrets left in the export file.
- Playbook export JSON backed up (
valguard-playbook-template/1). - Human escalation edges where high-risk actions need approval.
- For code graphs: every chat model client uses the ValGuard base URL and agent header.
Honest limits
- Import translates supported canvas exports. It is not a one-to-one LangChain runtime.
- Node types are classified by name: LLM, HTTP, or branch. Unknown types become skipped manual tasks.
- You still need ValGuard agents and validators. LangChain nodes are not policy.
- OpenAI-compatible request and response shapes stay stable. You do not have to rewrite LangChain to add checks.
- Org-wide policy file export is not available yet. Portability is per playbook and per agent. Trust.
Related
Next step
If you have a Langflow or Flowise export, run the wizard and attach one schema pack in shadow. If the graph is code only, swap the chat model base URL first. Enforce after shadow metrics look safe.