AgentRecipes
Recipes › Team operations

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)

Team operationsLangChain + LangGraph✓ Confirmed by source

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

Step-by-step recipe

  1. 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.
  2. 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.
  3. 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.
  4. Cap console output to a preview (first N rows, counts, errors) so large intermediate results never flow back into the model's context.
  5. 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.
  6. Store the final validated JSON for ingestion and keep the generated code with the run, so each migration is repeatable and auditable.

Copyable prompt

Prompt template
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

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

Replace daily standups with async updates and AI summaries (Zapier Agents)Daily standups take a lot of team time for information that could be written down in a minute.Zapier Agents✓ Confirmed by sourceWrite end-of-sprint changelogs from completed Linear tickets with Claude CoworkWriting release notes every sprint means rereading every finished ticket and translating it into user-facing language.Claude Cowork✓ Confirmed by sourceSort hundreds of PDFs into folders with Claude CoworkA folder of hundreds of unsorted PDFs is useless until someone opens each file and files it.Claude Cowork✓ Confirmed by source

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.