File transforms agent

Use an AI agent to write and run custom code that transforms files or lists.

File transforms agent hands your input files or lists to an AI agent along with plain-language instructions. The agent writes code that performs the transformation, then runs that code to produce output files. You can review and edit the generated code at any time, so you get the speed of an AI agent with the transparency of custom code.

Availability: Requires the WorkflowsFileTransformAgent feature. Contact your OneSchema support representative if you do not see this transform.

What it does

  • Input: files or lists.
  • Output: one or more files, produced by AI-generated code.
  • The agent generates a code snippet based on your prompt and the shape of the input. The snippet runs against every file or list that flows through the node.

When to use it

  • You need bespoke file manipulation — merging, splitting, extracting sections, reformatting — that doesn't fit a built-in transform.
  • You want the flexibility of custom code without writing it yourself for every one-off request.
  • You're prototyping a transformation and want to iterate quickly on a prompt before locking in code.

How to configure it

Add a File transforms agent node after the node that produces the files or lists you want to transform. Open the node and describe the transformation you want in the chat prompt. The agent uses the prompt to generate the Code.

Settings

SettingDescriptionDefault
PromptThe transformation instructions you type in the agent chat. The agent uses them to generate the Code.Empty
CodeThe code the agent generated to perform the transformation. Starts as a pass-through snippet that returns the input unchanged; edit it directly or ask the agent to regenerate it.Pass-through code snippet
Agent planA saved plan the agent can reuse instead of generating a new approach each time. Leave unset to let the agent plan fresh from your prompt.None (not set)

Example

Input

A batch of vendor CSV files with inconsistent header casing and stray empty columns.

Prompt

"Remove empty columns and standardize all headers to snake_case."

Output

Cleaned files with empty columns removed and headers like invoice_number, line_total.

Troubleshooting

Output doesn't match what you asked for

  • Make the prompt more specific about the exact transformation and expected shape.
  • Ask the agent to regenerate the code rather than editing it by hand first.

Code fails partway through a run

  • Check the run logs for the error and share it with the agent to get a fix.
  • If the error is minor, edit the generated code directly.

See also


Did this page help you?