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

# Profiles and Presets

> Using configuration profiles and presets for multi-environment workflows.

# Profiles and Presets

Profiles and presets allow you to run the same workflow across different environments without changing the workflow file.

## Profiles

Profiles are named environment configurations in your `replay.yaml`. Activate a profile with `--profile`.

### Definition

```yaml theme={null}
# replay.yaml
config:
  http:
    base_url: http://localhost:3000

profiles:
  staging:
    config:
      http:
        base_url: https://staging.example.com
      postgres:
        dsn: postgres://user:pass@staging-db:5432/db

  production:
    config:
      http:
        base_url: https://api.example.com
      postgres:
        dsn: postgres://readonly:pass@prod-db:5432/db
```

### Usage

```bash theme={null}
# Local development (uses default config)
replay run smoke-test.yaml

# Staging
replay run smoke-test.yaml --profile staging

# Production
replay run smoke-test.yaml --profile production
```

### Use Case

Run the same smoke tests against every environment in your CI pipeline:

```yaml theme={null}
# GitHub Actions
strategy:
  matrix:
    environment: [dev, staging, production]
steps:
  - run: replay run smoke.yaml --profile ${{ matrix.environment }}
```

## Presets

Presets are reusable configuration bundles that a workflow can opt into.

### Definition

```yaml theme={null}
# replay.yaml
presets:
  auth-test:
    config:
      vars:
        test_email: qa@example.com
        test_role: admin

  cleanup:
    config:
      vars:
        delete_after: true
```

### Activation in Workflow

Workflows activate presets via `vars.presets`:

```yaml theme={null}
name: user-creation-test
config:
  vars:
    presets:
      - auth-test
steps:
  - name: check-email
    type: http
    request:
      method: GET
      url: /users/{{ test_email }}
```

### Multiple Presets

```yaml theme={null}
config:
  vars:
    presets:
      - auth-test
      - cleanup
```

Presets are merged in order — later presets override earlier ones.

## Combining Profiles and Presets

You can use both together:

```bash theme={null}
replay run my-workflow.yaml --profile staging
```

The merge order is: config default → profile → presets → workflow config.

## What's Next?

* Review the [CLI reference](/replay/cli-reference/index)
* Check [troubleshooting](/replay/troubleshooting)
