When you connect blocks, understanding the data structure of different block outputs is important because 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.
Understanding these data structures is essential for effectively using connection tags and accessing the right data in your workflows.
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": {
"input": 120,
"output": 85,
"total": 205
},
"toolCalls": {
"list": [],
"count": 0
},
"providerTiming": {
"duration": 1250,
"modelTime": 1250,
"toolsTime": 0,
"iterations": 1
},
"cost": {
"input": 0.0006,
"output": 0.001275,
"total": 0.001875
}
}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
- input: Number of input tokens consumed
- output: Number of output tokens generated
- total: Total tokens used
- toolCalls: Object containing the ordered tool-call list and its count
- providerTiming: Provider, model, and tool execution timing details
- cost: Estimated input, output, tool, and total provider costs
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 defined schema fields are returned at the output root alongside standard execution metadata such as
tokens,toolCalls,providerTiming, andcost. -
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:
<blockName.path.to.nested.data>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