Test AI agents using workflows that are configured and stored on the Maxim platform. This approach leverages the With Workflow ID function to execute pre-configured workflows without needing to handle HTTP calls manually.

Before using this approach, ensure your workflow is configured on the Maxim platform with “output” and “context” fields configured properly.

This is needed to know how to parse the response from the endpoint to get output and context.

Basic Workflow Testing

Use the With Workflow ID function to test agents configured as workflows on the Maxim platform:

from maxim import Maxim

# Initialize Maxim SDK

maxim = Maxim({"api_key": "your-api-key"})

# Create and run the test using a Maxim workflow

result = (
    maxim.create_test_run(
        name="Agent Workflow Test", in_workspace_id="your-workspace-id"
    )
    .with_data_structure(
        {
            "input": "INPUT",
            "expected_output": "EXPECTED_OUTPUT",
            "context": "CONTEXT_TO_EVALUATE",
        }
    )
    .with_data("your-dataset-id")
    .with_evaluators("Bias")
    .with_workflow_id("your-workflow-id")
    .run()
)

print(f"Test run completed! View results: {result.test_run_result.link}")

Next Steps