Object Generation (ObjectGenerator)
Generate structured JSON data using LLMs. You define the shape, the LLM fills it in — guaranteed to match your schema or the step fails.
ObjectGenerator is usually the first step in a Flow. It’s perfect for generating product descriptions, recipe data, character sheets, marketing copy, or any structured content you need downstream.
You can also think of it as “structured prompting” — you give the LLM a description of what you want, a JSON Schema for the shape, and it returns exactly that.
Parameters
descriptionstringrequiredA system-like prompt describing what kind of JSON you want. This is effectively your system prompt — be specific about tone, format, and constraints. The more detailed, the better the output.
schemaobjectrequiredA JSON Schema describing the exact shape of the output. The root type must
be object. The LLM is forced to comply with this schema. You can use the
description field on individual properties to give the LLM more granular
instructions (e.g., “always write this field in Japanese”).
inputstringAdditional user prompt or context. Can be a direct string or a JSON Path
reference (e.g., $.input.topic). This becomes the user message in the LLM
conversation.
amountnumberHow many objects to generate. If amount > 1, the step returns an object with a list key containing multiple items matching the schema. If amount is 1 or omitted, it returns a single object. Be careful with large amounts and big schemas — costs can add up.
creativitynumber (0–20)Controls the LLM’s temperature. Maps to a 0.0–2.0 scale (so creativity: 10 =
temperature 1.0). Higher values produce more varied and surprising output;
lower values are more deterministic and focused. If omitted, defaults to
temperature 1.0.
contextIdstringThe ID of a previous ObjectGenerator step. That step’s results will be
included as context for this generation — useful when you need to split data
generation across multiple steps while maintaining coherence.
Example
{
id: 'recipesGenerator',
type: 'ObjectGenerator',
parameters: {
description: 'You are an experienced chef with vast knowledge of global cuisines. Generate creative recipes with detailed ingredients and step-by-step instructions.',
input: '$.input.recipeType',
amount: 5,
creativity: 12,
schema: {
type: 'object',
required: ['recipes'],
properties: {
recipes: {
type: 'array',
items: {
type: 'object',
required: ['name', 'ingredients', 'instructions'],
properties: {
name: {
type: 'string',
description: 'The recipe name — be creative and descriptive.',
},
ingredients: {
type: 'array',
items: { type: 'string' },
},
instructions: {
type: 'array',
items: { type: 'string' },
},
},
},
},
},
},
},
}
When the Flow runs, the step constructs a system prompt from description, includes the user’s input, and the LLM returns JSON matching the schema:
{
"recipes": [
{
"name": "Miso-Glazed Salmon with Pickled Ginger",
"ingredients": ["salmon fillet", "white miso paste", "..."],
"instructions": ["Preheat the oven to 200°C...", "..."]
}
]
}
After the step completes, you can reference this data in later steps via $.results.recipesGenerator.
Billing: ObjectGenerator is charged at $0.000025 per token (input +
output). If amount is large, the step makes iterative chunk calls — each
chunk adds to the token count. For best results, we use reasoning models, so
billed tokens may include reasoning tokens.
Best practices
- Be explicit in your schema — the more thorough it is, the better the LLM structures results. Use
descriptionon individual properties for granular control. - Start small — test with
amount: 2to verify the shape is correct before scaling up. - Refine your description — if outputs aren’t what you expect, iterate on the system prompt. Clear, specific descriptions produce the best results.
- Use
contextIdfor multi-step generation — if you need to generate related data across steps, chain them withcontextIdto maintain coherence. - Watch costs with large schemas — a big schema + high
amountcan generate a lot of tokens. Monitor your charges while iterating.