JSONata Mapper icon

JSONata Mapper

Map JSON documents using JSONata, optional field transforms, JSON Schema validation, and AI auto-map suggestions

Generate AI Prompt Only

AI-generated

Summary

Generate a JSON-formatted AI prompt that instructs a language model to create JSONata mapping configurations from given source and target JSON data and schemas, without making the actual AI call.

Inputs

  • Source Document Mode (required) — Select the mode to specify the source JSON document: either use the incoming n8n item JSON or paste a source JSON document directly.
  • Source Field — Field path within the incoming item JSON that contains the source JSON, used only if Source Document Mode is 'Use Incoming Item JSON'. Defaults to 'json' for the whole item JSON.
  • Source JSON Document — A pasted source JSON document to use instead of incoming item JSON, shown only when Source Document Mode is 'Paste Source JSON Document'.
  • Use Source JSON Schema — Toggle to provide a source JSON Schema for validation and AI context.
  • Source JSON Schema — JSON Schema describing the source document. Required to be meaningful if 'Use Source JSON Schema' is enabled.
  • Use Target JSON Schema — Toggle to provide a target JSON Schema for output validation and AI context.
  • Target JSON Schema — JSON Schema describing the required target document, used if 'Use Target JSON Schema' is enabled.
  • Target Sample JSON (required) — Sample target JSON structure used as AI context when no target schema is supplied.
  • Return Debug Info — Optionally include debug information along with the generated prompt.

Output shape

a single item containing a JSON object with the AI prompt string under the key 'prompt'

The output JSON includes only the generated AI prompt used to instruct a language model to produce a JSONata mapping configuration, without calling the AI service itself. The output is paired with the corresponding input item index. If 'Return Debug Info' is enabled, debug data is included when generating mappings, but not for this operation.

Examples

Example 1: User wants to generate an AI prompt based on a pasted JSON source document and a sample target JSON to use with an LLM in a separate step.

Source Document Mode is set to 'Paste Source JSON Document', with a pasted JSON and sample target JSON provided; optionally source and target schemas can be supplied to enrich the prompt.

Links

Discussion