data structure
When you connect blocks, the output data structure from the source block determines what values are available in the destination block. Each block type produces a specific output structure that you can reference in downstream blocks.
Block Output Structures
Different block types produce different output structures. Here's what you can expect from each block type:
{
"content": "The generated text response",
"model": "gpt-4o",
"tokens": {
"prompt": 120,
"completion": 85,
"total": 205
},
"toolCalls": [...],
"cost": [...],
"usage": [...]
}Agent Block Output Fields
content: The main text response generated by the agent
model: The AI model used (e.g., "gpt-4o", "claude-3-opus")
tokens: Token usage statistics
prompt: Number of tokens in the prompt
completion: Number of tokens in the completion
total: Total tokens used
toolCalls: Array of tool calls made by the agent (if any)
cost: Array of cost objects for each tool call (if any)
usage: Token usage statistics for the entire response
Condition Block Output Fields
content: The original content passed through
conditionResult: Boolean result of the condition evaluation
selectedPath: Information about the selected path
blockId: ID of the next block in the selected path
blockType: Type of the next block
blockTitle: Title of the next block
selectedConditionId: ID of the selected condition
Custom Output Structures
Some blocks may produce custom output structures based on their configuration:
Agent Blocks with Response Format: When using a response format in an Agent block, the output structure will match the defined schema instead of the standard structure.
Function Blocks: The
resultfield can contain any data structure returned by your function code.API Blocks: The
datafield will contain whatever the API returns, which could be any valid JSON structure.
Always check the actual output structure of your blocks during development to ensure you're referencing the correct fields in your connections.
Nested Data Structures
Many block outputs contain nested data structures. You can access these using dot notation in connection tags:
For example:
<agent1.tokens.total>- Access the total tokens from an Agent block<api1.data.results[0].id>- Access the ID of the first result from an API response<function1.result.calculations.total>- Access a nested field in a Function block's result
Was this helpful?
