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

# module

> Invoke a reusable module file.

Invokes a module file with a path relative to the file containing the
invocation. The simplified form takes the path (or id) as a single string.

## Parameters

| Parameter | Type                    | Required | Description                                                 |
| --------- | ----------------------- | -------- | ----------------------------------------------------------- |
| `path`    | `string`                | Yes      | Relative path to the module file (or its id).               |
| `inputs`  | `Record<string, value>` | No       | Values bound to the module's parameters (see below).        |
| `saveAs`  | `string`                | No       | Variable to store this step's return value on `env.<name>`. |
| `retries` | `number`                | No       | Times to retry the step on failure before failing the test. |
| `skipped` | `boolean`               | No       | Skip this step at execution time.                           |

Each value in `inputs` is one of:

* A shorthand string. It is evaluated as a **JavaScript expression** (e.g.
  `env.QA_EMAIL`), not mustache templating.
* `{ string: ... }`: a literal string.
* `{ javascript: ... }`: the script's return value is bound to the parameter.

## Shorthand

Path as a single string when the module takes no inputs.

```yaml theme={null}
- module: ../modules/log-in.module.yaml
```

## Examples

```yaml theme={null}
- module:
    path: ../modules/log-in.module.yaml
    inputs: # map module parameters to values in the caller
      USERNAME: env.QA_EMAIL
      PASSWORD:
        javascript: "return env.QA_PASSWORD"
```

## Related

* [Test format](/core-concepts/test-format)
* [Modules](/core-concepts/modules)
