Skip to main content

Overview

The MockData block returns static data defined in its configuration. Perfect for testing pipelines without making real HTTP requests or for providing test fixtures.

Input Parameters

None. MockData doesn’t take any inputs.

Configuration

ParameterTypeDescription
dataobjectThe data to return (can be any structure)

Output Fields

The block returns whatever fields are defined in config.data.

Examples

Basic Mock Data

Output:

Mock User Object

Mock API Response

This mimics an HttpRequest output, allowing you to test without making real requests.

Mock Array Data

Common Patterns

Testing Validation Logic

Testing LLM Judge

Mock Multiple Blocks

Progressive Enhancement

Start with mock data, then replace with real requests:

Full Example

Tips

Mock data is perfect for testing validation logic without external dependencies:
Structure mock data to match real API responses:
Create mocks for edge cases and error scenarios:
Mix mock and real blocks to test specific parts of your pipeline:

When to Use

Use MockData when:
  • Testing validation logic without external APIs
  • Creating reproducible test fixtures
  • Developing tests before APIs are available
  • Testing edge cases and error scenarios
  • Running tests without network access
Don’t use when:
  • Testing actual API integration (use HttpRequest)
  • Verifying real system behavior
  • Load testing or performance testing

Next Steps

ValidateContent

Validate mock data

LLMJudge

Use AI to validate mock responses