How to migrate messy customer HR and payroll spreadsheets into your onboarding schema with an agent that writes and runs Pandas code in a sandbox (LangChain + LangGraph, Remote)
Confirmed by source: Production workflow documented in a guest post by José Mussa (Staff Software Engineer, Remote) on the LangChain blog (19 Jan 2026): code-execution agent with a WebAssembly Python sandbox and LangGraph orchestration for customer data migrations, with 'hours instead of days' as the stated result. Different from the existing Remote IT help desk recipe (Zapier). Page checked live (HTTP 200) on 2026-11-28. Not run by BranoLabs. (checked 2026-11-28)
The problem
New customers of a global employment platform arrive with very different HR and payroll exports, sometimes thousands of spreadsheets or large SQL dumps. Writing a custom migration script per customer does not scale, and pasting a 50 MB spreadsheet into a model blows the context window and invites made-up values in compliance-critical data.
Tools needed
- LLM with LangChain tool calling (plans the mapping, never reads the full file)
- Python sandbox running in WebAssembly with Pandas
- LangGraph graph with nodes for ingestion, mapping, execution and validation plus retry edges
- Secure file storage for customer uploads (CSV, Excel, SQL exports)
- Target JSON schema for employee onboarding
Step-by-step recipe
- Have customers upload raw exports (CSV, Excel, SQL) to secure storage; the agent only gets a file reference and the target schema, not the data itself.
- Give the model a task such as 'convert this file into our employee onboarding schema' and let it plan the column-to-field mapping through tool calls.
- Run the Python/Pandas code the model writes inside an isolated sandbox (Remote uses a WebAssembly Python runtime), so the data stays in the execution environment.
- Cap console output to a preview (first N rows, counts, errors) so large intermediate results never flow back into the model's context.
- Loop: the agent checks the output against the schema, writes more code where fields fail, and repeats; model the steps as LangGraph nodes with explicit success, failure and retry transitions.
- Store the final validated JSON for ingestion and keep the generated code with the run, so each migration is repeatable and auditable.
Copyable prompt
You are a data migration agent. Input file: [FILE_REFERENCE] ([FORMAT]). Target: the [SCHEMA_NAME] JSON schema below. [SCHEMA] Rules: - Do not ask to see the whole file. Inspect it only by running Python in the sandbox (df.head([N]), df.dtypes, value counts). - Write Pandas code that maps source columns to schema fields; list every mapping and any assumption (date formats, currencies, country codes). - After each run, validate against the schema and report failing fields with row counts; fix and rerun. - Never invent values. Leave missing required fields empty and list them for [ONBOARDING_TEAM] review. Finish with: output path, rows converted, rows rejected with reasons, and the final code.
Original template written by our AI agent for AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.
What the builder reported
Remote says its onboarding teams no longer write custom scripts per customer: the Code Execution Agent turns diverse customer formats into a consistent JSON schema in hours instead of days, with the transformation running as repeatable, auditable code. Source: Remote guest post on the LangChain blog.
These are the source author's own claims. AgentRecipes has not run this recipe itself.
Watch out for
- Sandbox isolation matters: generated code touches sensitive payroll and employee data, so restrict network and file access.
- Validation against the schema is what catches bad mappings; ambiguous fields (e.g. date or salary formats) still need a human check before go-live.
- Keep output previews small, otherwise the model tries to read whole datasets and you lose the context-saving benefit.
- Guest post by a Remote engineer on the LangChain blog; the result is described qualitatively (hours instead of days), not with exact numbers.
Source
Original write-up: LangChain blog (customer case study) (2026-01-19) ↗
Found via LangChain customer stories: “How Remote uses LangChain and LangGraph to onboard thousands of customers with AI”. This recipe summarises the source in words written by our AI agent; read the original for the full details. Link last checked 2026-11-28.
More team operations recipes
New agent recipes in your inbox
A short email with the newest automation recipes, each linked to its real-world source. No spam. Every email has a one-click unsubscribe link.