Joerg Hiller
Jan 20, 2026 16:43
World HR platform Distant constructed a Code Execution Agent utilizing LangChain and LangGraph to rework handbook information migrations into automated workflows.
Distant, the worldwide employment platform, has deployed an AI-powered Code Execution Agent constructed on LangChain and LangGraph to automate buyer information migrations that beforehand required handbook scripting for every new shopper.
The system addresses a basic constraint in enterprise AI: context home windows. Even GPT-5’s 400,000-token restrict falls far in need of what’s wanted to course of giant payroll spreadsheets, which may exceed 50MB. Feeding that information immediately into an LLM produces hallucinations—a non-starter for a platform dealing with delicate employment and compliance information throughout a number of jurisdictions.
Separating Reasoning From Execution
Distant’s answer splits the workload. The LLM handles reasoning and process planning by way of LangChain’s tool-calling interface. Precise information manipulation occurs in a sandboxed Python surroundings operating WebAssembly, the place Pandas handles the heavy lifting.
“Massive intermediate outcomes by no means move again to the mannequin, holding the context small,” wrote José Mussa, Workers Software program Engineer at Distant, in a technical breakdown of the system.
The workflow runs like this: clients add uncooked information exports, the agent maps out transformation steps, sandboxed code executes these transformations, and the agent iterates till output matches Distant’s worker schema. The proof of idea processed a 5,000-row Excel file, mapping entries to schema and answering queries by operating code relatively than producing textual content.
Why Graph-Based mostly Orchestration
LangGraph’s node-and-edge structure proved crucial for managing multi-step migrations. Every workflow stage—ingestion, mapping, execution, validation—turns into a discrete node with express transitions for fulfillment, failure, or retry. This makes agent state clear and recoverable, borrowing patterns from distributed techniques engineering.
The framework selection aligns with broader business adoption. In line with LangChain’s 2024 state of AI report, 43% of LangSmith organizations now run LangGraph traces. The Python and JavaScript variations have crossed 130 million mixed downloads.
Manufacturing Outcomes
Distant’s onboarding groups now not write customized scripts per buyer. The agent transforms numerous codecs into constant JSON schemas in hours as an alternative of days. As a result of transformation logic executes as auditable code relatively than LLM-generated textual content, the output is repeatable—important for regulatory compliance throughout employment jurisdictions.
The crew extracted a number of operational ideas from the construct. LLMs operate greatest as planners, not information processors. Graph-based workflow construction simplifies debugging. Context tokens ought to be handled as scarce assets, with giant intermediate outcomes staying within the execution surroundings.
Increasing the Sample
Distant is now abstracting comparable patterns into reusable brokers throughout the corporate. A current prototype combines doc parsing with agentic workflows for OCR-to-JSON conversion, reportedly outperforming fundamental OCR by a big margin.
The corporate plans to contribute generic enhancements again to LangChain’s open-source ecosystem. For enterprise AI groups wrestling with comparable information transformation challenges, Distant’s structure affords a template: let fashions suppose, let code execute, and preserve the 2 cleanly separated.
Picture supply: Shutterstock








