Template transforms agent

Use an AI agent to draft a JSON template from sample files or lists.

Template transforms agent looks at sample files or lists and drafts a JSON template describing the columns, types, and validation rules it finds — the same kind of template you'd otherwise build by hand in the OneSchema template editor. Downstream transforms, like Sheet transforms, can then use that template to validate and reshape data.

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

What it does

  • Input: files or lists, used as sample data.
  • Output: a JSON template that defines the expected columns, types, and rules for downstream processing.
  • The agent inspects the sample data's structure and content, then generates code that emits a template matching what it observes.

When to use it

  • You're onboarding a new file type and want a starting-point template instead of building one from scratch.
  • You need to generate templates for many similar-but-distinct sources quickly.
  • You want a second opinion on which columns should be required, typed, or validated a certain way.

How to configure it

Add a Template transforms agent node after the node that produces representative sample files or lists. Open the node and describe what the template should capture in the chat prompt. The agent generates the Code that produces the template; review the generated output before using it downstream.

Settings

SettingDescriptionDefault
PromptThe instructions you type in the agent chat describing what the template should capture. The agent uses them to generate the Code.Empty
CodeThe code the agent generated to produce the JSON template. Starts as a pass-through snippet; edit it to adjust how the template is derived.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 sample CSV of customer records with columns like Name, Email, Signup Date.

Output

A JSON template defining Name (string, required), Email (string, required, email format), and Signup Date (date).

Troubleshooting

Generated template is missing fields

  • Provide a prompt that explicitly lists the columns you expect the template to cover.
  • Use a sample file that includes all the columns you care about.

Field types are wrong

  • Specify expected types in your prompt (e.g., "Signup Date should be a date").
  • Edit the generated template directly after it's created.

See also


Did this page help you?