Waiting for engine...
Skip to main content

useFetchAiTransformations()

useFetchAiTransformations():

{ result, isLoading, error, +14 more }

Generates Boomi-compatible transformation functions via OpenAI:

  1. Reads AI config (enabled, model, apiKey) from context.
  2. Sends a structured prompt to produce name, script, inputs, outputs.
  3. Validates the response against AiTransformation (zod).
  4. Shapes the result into Boomi MapExtensionsFunction format.

Throws

When AI is enabled but model or apiKey is missing in context.

Returns

Hook API with the latest generated result, loading/error state, and an invoker.

result
any

isLoading
boolean

error
string

fetchTransformation()

Requests an AI-generated transformation for a natural-language prompt and adapts it to Boomi’s map extension function structure.

fetchTransformation: (userPrompt: string, id: string) => Promise<undefined | { id: string; type: type; cacheType: cacheType; Inputs: { Input: { key: string; name: string; }[]; }; Outputs: { Output: { key: string; name: string; }[]; }; Configuration: { Scripting: { language: language; Script: string; Inputs: { Input: { index: string; name: string; dataType: dataType; }[]; }; Outputs: { Output: { index: string; name: string; }[]; }; }; }; }>

Parameters

userPrompt
string Natural language description of the desired transformation.

id
string Identifier to assign to the resulting Boomi function.

Returns

Promise<undefined | { id: string; type: type; cacheType: cacheType; Inputs: { Input: { key: string; name: string; }[]; }; Outputs: { Output: { key: string; name: string; }[]; }; Configuration: { Scripting: { language: language; Script: string; Inputs: { Input: { index: string; name: string; dataType: dataType; }[]; }; Outputs: { Output: { index: string; name: string; }[]; }; }; }; }>

Resolves with the structured Boomi transformation object on success.

Throws

If AI is enabled but not fully configured (missing model or apiKey).

On this Page