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

# Handoff

Hand the journey to a second device: presents a QR code, deep link and/or short code, then resolves as presented, abandoned (TTL elapsed) or failed. The steps that run on the joined device are the ones you place on the presented branch.

This page documents the **Handoff** module, including its variants, capabilities, and the result values it returns.

## Handoff: Handoff

Hands the journey to a second device. On a page-mode journey it presents the origin HandoffCard (QR code, deep link and/or short code) on the device the user started on, then resolves as presented (a device joined), abandoned (the TTL elapsed with no join) or failed (not page mode / no surface enabled / instance unresolved). The originating device keeps polling and resumes when the handed-off stretch completes (ADR-139 decision 1). Flow-control module — no external provider.

### Capabilities

The module returns the following capabilities.

#### Handoff status

Terminal disposition of the handoff step.

| Code | Label | Description |
| - | - | - |
| `PRESENTED` | Presented | The handoff surface was presented and a second device joined the journey. |
| `ABANDONED` | Abandoned | The configured TTL elapsed with no device joining. |
| `FAILED` | Failed | The handoff could not be offered (see Failure Reason). |

#### Failure reason

Why the handoff failed; NONE when it did not fail.

| Code | Label | Description |
| - | - | - |
| `NONE` | None | No failure. |
| `NOT_PAGE_MODE` | Not page mode | Journey delivered in api/headless mode; no user-facing surface to present. |
| `INSTANCE_URL_UNRESOLVED` | Instance URL unresolved | The journey instance could not be resolved, so no handoff URL could be minted. |
| `NO_SURFACE_ENABLED` | No surface enabled | Configuration enabled no renderable handoff surface. Both showQr and showDeepLink are false. showShortcode does not satisfy this on its own: the short-code surface is not implemented yet (GGO-15730), so a shortcode-only configuration would present a card the end user cannot act on. |

### Default outcomes

The following default outcomes are available for evaluation and routing in the Journey builder.

| Outcome | Condition | Description |
| - | - | - |
| `presented` | Handoff Status is `PRESENTED` | — |
| `abandoned` | Handoff Status is `ABANDONED` | — |
| `failed` | Handoff Status is `FAILED` | — |
| `Error` | Default, when no conditions matched | — |

### Input payload

The following is a sample payload used to submit data to the **Handoff** module for processing.

```json JSON theme={null}
{
  "context": {
    "config": {
      "showQr": true,
      "showDeepLink": false,
      "showShortcode": false,
      "ttlMinutes": 1
    },
    "process": {
      "instance": {
        "id": "inst-abc-456"
      }
    },
    "subject": {
      "identity": {}
    }
  }
}
```

### Sample response

The following is a sample response returned by the module.

```json JSON theme={null}
{
  "response": {
    "advice": {
      "handoffStatus": "ABANDONED",
      "failureReason": "NONE"
    },
    "outcome": "abandoned"
  }
}
```
