---
title: "axiom flow mock add"
description: "Add or replace a node's mock fixture"
category: reference
surfaces: [cli]
related: [reference/cli/axiom-flow-mock]
last_reviewed: 2026-06-06
---

<!-- GENERATED by docs/scripts/gen-cli-reference — DO NOT EDIT.
     Source of truth: the cobra command definitions in cmd/axiom/cmd/.
     Regenerate from the repo root with: go run ./docs/scripts/gen-cli-reference -->

# axiom flow mock add

Add or replace a node's mock fixture

Add (or replace) the mock for a node alias. The fixture comes from exactly one
source:

```text
--data '<json>'            inline response JSON (the node's output message)
--file <path>              an existing JSON fixture file
--error CODE[:message]     a typed failure (USER|TIMEOUT|TRANSPORT|PANIC|CANCELLED)
                           to exercise retry / on_error / rollback edges
--from-execution <id>      capture the alias's recorded output from a past
                           execution (one deliberate live run seeds the fixture)
```

--data and --from-execution write mocks/<alias>.json next to flow.yaml and
reference it with file:; --file references the given path as-is.

## Usage

```sh
axiom flow mock add <alias> [flow.yaml] [flags]
```

## Flags

| Flag | Shorthand | Type | Default | Description |
|---|---|---|---|---|
| `--data` |  | string |  | Inline response JSON |
| `--error` |  | string |  | Typed failure as CODE or CODE:message |
| `--file` |  | string |  | Path to a JSON fixture file |
| `--from-execution` |  | string |  | Execution id to capture the alias's recorded output from |
| `--help` | `-h` | bool |  | help for add |

## See also

- [axiom flow mock](./axiom-flow-mock.md) — Manage the flow's authoring mocks (ADR-176)
