> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoint on Maxim

> Learn how to test AI agents using workflows stored on the Maxim platform using the Maxim SDK

## How to test workflows on Maxim?

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.

<Note>
  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.
</Note>

## Basic Workflow Testing

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

<CodeGroup>
  ```python Python theme={null}
  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}")

  ```

  ```typescript JS/TS theme={null}
  import { Maxim } from '@maximai/maxim-js';

  // Initialize Maxim SDK
  const maxim = new Maxim({
    apiKey: 'your-api-key',
  });

  // Create and run the test using a Maxim workflow
  const result = await maxim
    .createTestRun('Agent Workflow Test', 'your-workspace-id')
    .withDataStructure({
      Input: 'INPUT',
      'Expected Output': 'EXPECTED_OUTPUT',
    })
    .withData('your-test-data-id')
    .withEvaluators('Bias')
    .withWorkflowId('your-workflow-id')
    .run();

  console.log(`Test run completed! View results: ${result.testRunResult.link}`);
  ```
</CodeGroup>

## Using Presets

If you have saved test configuration presets on the Maxim platform, you can use them to automatically load datasets, evaluators, and other settings without specifying them manually:

```python Python theme={null}
from maxim import Maxim

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

# Test using a saved preset — dataset, evaluators, and context
# settings are loaded from the preset automatically
result = (
    maxim.create_test_run(
        name="Workflow Test with Preset",
        in_workspace_id="your-workspace-id",
    )
    .with_workflow_id("your-workflow-id")
    .with_preset("My Saved Preset")
    .run()
)

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

Any values you set explicitly via other builder methods will take priority over the preset defaults:

```python Python theme={null}
result = (
    maxim.create_test_run(
        name="Workflow Test with Preset Override",
        in_workspace_id="your-workspace-id",
    )
    .with_workflow_id("your-workflow-id")
    .with_preset("My Saved Preset")
    .with_data("different-dataset-id")  # Overrides the preset's dataset
    .run()
)
```

<Note>
  If the preset includes human evaluators, you must also call `with_human_evaluation_config` to provide the reviewer emails.
</Note>

## Next Steps

* [Local Endpoint Testing](/offline-evals/via-sdk/agent-http/local-endpoint) - Test agents with custom HTTP endpoints
* [CI/CD Integration](/offline-evals/via-sdk/agent-http/ci-cd-integration) - Automate workflow testing in your CI/CD pipeline
