Skip to content

ai.generate

Operation: ai.generate
Category: ai
Tags: text, llm, generation

Generate text or content via an AI provider with prompt templating

Type: AI Provider (routed via provider registry)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)

NameTypeRequiredDefaultDescription
promptStringNoInput prompt (or use prompt_template in config)
NameTypeDescription
contentStringGenerated content
finish_reasonStringWhy generation stopped
{
"modality": "text"
}
import { WorkflowBuilder } from "@fabric-platform/sdk";
const workflow = new WorkflowBuilder("my-workflow")
.node("ai-generate", "ai_invoke", (n) =>
n.config({
operation: "ai.generate",
// ... node-specific config
})
)
.build();
{
"key": "generate-script",
"operation": "ai.generate",
"config": {
"modality": "text",
"model": "gpt-4o-mini",
"prompt_template": "Write a short script about {{context.topic}}"
},
"outputs": [
{ "name": "content", "path": "$context.script" }
]
}

ai.generate requires a prompt (via prompt_template or input.prompt)

Section titled “ai.generate requires a prompt (via prompt_template or input.prompt)”

Cause: Neither prompt_template in config nor a prompt input binding was provided

Fix: Add a prompt_template to your node config, or bind the prompt input from an upstream node’s output

Cause: The prompt_template contains invalid Handlebars syntax or references a missing context variable

Fix: Check your template syntax — variables use {{context.key}} format. Ensure upstream nodes produce the referenced outputs