API reference

LLM and AI activities

Text, decision, image and retrieval-augmented generation activities.

Flow Current 4 min read Updated

Text, decision, image and retrieval-augmented generation activities. This page covers 4 activity types.

llm_decision#

LLM Decision. Prompt a language model to return a structured JSON decision. The response is validated against an output schema before mapping to activity outputs.

Input Type Required Description
prompt string Yes Decision prompt — may reference resolved inputs via {{variable}} interpolation
context string No Additional context to include with the prompt
model string No Override the configured model for this run
maxTokens number No Maximum output tokens
systemPrompt string No Override the system prompt for this run
Output Type Description
output.decision string Primary decision value (defined by outputSchema)
output.confidence number Confidence score 0–1 (when included in outputSchema)
output.reason string Reasoning behind the decision (when included in outputSchema)
output.riskLevel string Risk level classification (when included in outputSchema)
output.tokenUsage object Token usage breakdown

Config block example:

json
{
  "llm_decision": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "outputSchema": {
      "decision": "string",
      "confidence": "number"
    },
    "temperature": 0.2,
    "maxTokens": 512
  }
}

llm_image#

LLM Image. Analyse an image with a multimodal language model. Accepts a base64-encoded image or a publicly accessible image URL.

Input Type Required Description
prompt string Yes Instruction or question about the image
imageBase64 string No Base64-encoded image content (use imageBase64 or imageUrl, not both)
imageUrl string No Publicly accessible URL of the image (use imageBase64 or imageUrl, not both)
mimeType string No MIME type of the image: image/jpeg, image/png, image/gif, image/webp (required with imageBase64)
model string No Override the configured model for this run
maxTokens number No Maximum output tokens
systemPrompt string No Override the system prompt for this run
Output Type Description
output.description string Model's text response about the image
output.tokenUsage object Token usage breakdown

Config block example:

json
{
  "llm_image": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "maxTokens": 1024
  }
}

llm_rag#

LLM RAG. Retrieval-Augmented Generation — search a vector corpus for relevant context chunks and answer a query with grounded, cited responses

Input Type Required Description
query string Yes The user question or search query to answer using the corpus
documents array No Optional array of document objects to search at runtime instead of a stored corpus
model string No Override the configured model for this run
topK number No Number of context chunks to retrieve (default: 5)
systemPrompt string No Override the system prompt for this run
Output Type Description
output.answer string The model's grounded answer
output.context string The retrieved context chunks used to generate the answer
output.sources array Array of source chunk objects: {text, score, metadata}
output.chunkCount number Number of context chunks retrieved

Config block example:

json
{
  "llm_rag": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "corpusId": "my-corpus-v1",
    "topK": 5,
    "minScore": 0.75,
    "maxTokens": 2048
  }
}

llm_text#

LLM Text. Generate or transform text using a language model. Supports built-in operations (summarize, translate, extract, classify, sentiment, rewrite, qa) or a fully custom prompt.

Operations: custom, summarize, translate, extract, classify, sentiment, rewrite, qa. Set with the operation input.

Input Type Required Description
content string No Text content to process (required for all built-in operations) Used when operation is summarize, translate, extract, classify, sentiment, rewrite, qa.
prompt string Yes Custom prompt text (custom operation only; overrides the config block prompt) Used when operation is custom.
question string Yes Question to answer against the content (qa operation) Used when operation is qa.
model string No Override the configured model for this run
temperature number No Sampling temperature (default: 0.7)
maxTokens number No Maximum output tokens
systemPrompt string No Override the system prompt for this run Used when operation is custom.
Output Type Description
output.text string Generated or transformed text response
output.category string Assigned category label (classify operation)
output.sentiment string Sentiment result: positive, negative, neutral (sentiment operation)
output.reason string Reason or explanation for the sentiment/classification result
output.tokenUsage object Token usage breakdown: promptTokens, completionTokens, totalTokens

Config block example:

json
{
  "llm_text": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "operation": "summarize",
    "operationConfig": {
      "maxCharacters": 300,
      "format": "bullets"
    },
    "temperature": 0.3,
    "maxTokens": 1024
  }
}