Learn how data flows between nodes in workflows and handle data types correctly to avoid runtime errors.
Overview
In workflows, data flows from one node to the next by referencing outputs from previous nodes or workflow inputs. You control this data flow using {{...}} reference syntax. Each field has a specific data type, and type compatibility is critical for successful workflow execution.
Key Concepts:
Workflow inputs and node outputs have defined types
Node inputs expect specific types
Type mismatches cause workflow failures at runtime
Type conversion nodes help transform data between incompatible types
How Data Flows in Workflows
Understanding how data moves through your workflow is essential for building reliable automations.
Workflow Execution Flow
Workflows execute linearly from top to bottom, with data passing from one node to the next:
β Workflows execute top-to-bottom, data flows linearly between nodes
β Each node can access workflow inputs and outputs from previous nodes
β Use {{...}} syntax to reference data from inputs and previous nodes
Type Handling: 4. β All fields in workflow inputs, node inputs, and node outputs have defined types 5. β Types must match when passing values between nodes 6. β Type mismatches cause runtime errors, not design-time warnings 7. β Check node detail pages to see input/output types
Automatic Conversions: 8. β When embedded in strings, all values auto-convert to strings 9. β Objects and arrays become JSON strings: "Data: {{obj}}" works 10. β Numbers become text: "Count: {{num}}" works
Manual Conversions: 11. β Use string_to_json to parse JSON strings to objects/arrays 12. β Use run_javascript or run_python_code for complex transformations 13. β Use dot notation and array indexing to extract specific values
Best Practices: 14. β Test workflows incrementally to catch type errors early 15. β Use explicit field access: {{api.response.data.id}} vs {{api.response}}
Remember: When in doubt, check the node's detail page for exact input/output types!
{
"message": "Hello {{user_name}}, your order #{{order_id}} is ready!",
"subject": "Analysis complete: {{analyzer.status}}",
"body": "Found {{search_results.count}} results for {{query}}"
}
# Input: items (array)
# Output: formatted_list (string)
formatted = '\n'.join([f"- {item}" for item in items])
return formatted
// API returns: {"status": "success", "message": "Done"}
// Email expects: string
{
"email_body": "{{api_call.response}}" // β οΈ May not be what you want
}
{
"name": "analyze_user",
"node_type_name": "claude_ask",
"input_config": {
"prompt": "Analyze this user data: Name is {{fetch_data.response_body.name}}, status is {{fetch_data.response_body.status}}",
"model": "claude-3-5-sonnet-latest",
"max_tokens": 500
}
}
{
"prompt": "Analyze this user data: Name is John Doe, status is active",
"model": "claude-3-5-sonnet-latest",
"max_tokens": 500
}
{
"content": "This user John Doe appears to be an active account holder in good standing."
}
{
"inputs": {
"api_url": "https://api.example.com/users/123",
"recipient_email": "[email protected]"
},
"nodes": {
"fetch_data": {
"status_code": 200,
"response_body": {
"id": 123,
"name": "John Doe",
"email": "[email protected]",
"status": "active"
}
},
"analyze_user": {
"content": "This user John Doe appears to be an active account holder in good standing."
}
}
}
{
"recipient_emails": ["[email protected]"],
"subject": "User Analysis Report",
"body": "Analysis for John Doe:\n\nThis user John Doe appears to be an active account holder in good standing."
}
{
"message": "Email sent successfully",
"email_id": "msg_abc123xyz"
}
{
"inputs": {
"api_url": "https://api.example.com/users/123",
"recipient_email": "[email protected]"
},
"nodes": {
"fetch_data": {
"status_code": 200,
"response_body": {
"id": 123,
"name": "John Doe",
"email": "[email protected]",
"status": "active"
}
},
"analyze_user": {
"content": "This user John Doe appears to be an active account holder in good standing."
},
"send_report": {
"message": "Email sent successfully",
"email_id": "msg_abc123xyz"
}
}
}
{
"message": "Email sent successfully",
"email_id": "msg_abc123xyz"
}
{
"user_name": "John Doe",
"analysis": "This user John Doe appears to be an active account holder in good standing.",
"email_status": "Email sent successfully"
}
After Node 1: Can reference β inputs + fetch_data
After Node 2: Can reference β inputs + fetch_data + analyze_user
After Node 3: Can reference β inputs + fetch_data + analyze_user + send_report