> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/command-line-interface/refresh-links.md).

# Refresh links and impacted graph

Use `refresh_links` **after** a pipeline’s [Initial Build Map](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/command-line-interface/create-an-initial-build-map-for-your-pipeline.md) has completed successfully. It refreshes the SAP tables cache, Production history data (PHD), object links, and impacted graph without rebuilding the initial SeaLights build.

Typical patterns:

* Schedule it **once a week**.
* Run it proactively **before a test cycle**.

`refresh_links` is not a substitute for the first `buildmap run`. It does not run `generate_common` or `generate_buildmap`.

## Schedule a refresh

### `slabapcli refresh_links`

Registers (or updates) a Windows Scheduled Task named `REFRESH_LINKS_<pipeline>` that runs `watcher.exe REFRESH_LINKS <pipeline>` on a cron schedule. Both `--pipeline` and `--cron` are required; there is no default cron expression.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe refresh_links --pipeline <pipeline> --cron <cron>
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe refresh_links --pipeline <pipeline> --cron <cron>
```

{% endcode %}
{% endtab %}
{% endtabs %}

| Parameter    | Short flag | Required | Description                                                                           |
| ------------ | ---------- | -------- | ------------------------------------------------------------------------------------- |
| `--pipeline` | `-p`       | Yes      | The configured pipeline effective name (as shown in `pipeline list`).                 |
| `--cron`     | —          | Yes      | A 5-field cron expression (`minute hour day-of-month month day-of-week`). No default. |

{% hint style="info" %}
The cron expression uses 5 fields in standard Unix cron format. There is **no** product default. Example values:

* `0 2 * * 0` — every Sunday at 02:00 (recommended weekly example)
* `0 3 * * 1-5` — Monday through Friday at 03:00
* `0 1 * * *` — every day at 01:00
  {% endhint %}

#### Weekly example (Sunday 02:00)

The following expression is a **recommended example**, not a product default:

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe refresh_links --pipeline "MyPipeline" --cron "0 2 * * 0"
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe refresh_links --pipeline 'MyPipeline' --cron '0 2 * * 0'
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe refresh_links --pipeline 'MyPipeline' --cron '0 2 * * 0'
[2026-08-02 11:00:00.123+02:00] [info] Config pathname: C:\ProgramData\Tricentis\SeaLights\ABAP Agent\config\config.toml
Refresh links task scheduled for pipeline: 'MyPipeline'.
```

{% endcode %}

{% hint style="info" %}
Arrange the maintenance window so [Build Modifications](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/command-line-interface/monitor-your-pipeline-for-build-modifications.md) monitoring is stopped before you import transports and remains stopped until the refresh finishes. After a successful refresh, start Build Modifications so the imported transports are processed. If monitoring is enabled again, stop it before the next refresh window; otherwise the shared build-mode lock can cause watcher exit code `11`.
{% endhint %}

When registration succeeds, the CLI prints:

```
Refresh links task scheduled for pipeline: '<name>'.
```

You may also see these warnings:

* `settings.install` is set but that directory does not contain `watcher.exe` — set `settings.install` to the agent `bin` directory (the folder that contains `watcher.exe` and `slabapcli.exe`), or the scheduled task will fail when it runs.
* The ABAP Agent server is not reachable — the scheduled task cannot run until the server starts.

## What the task refreshes

When `REFRESH_LINKS` runs, the watcher executes these four stages in order:

| Order | Stage            | Result                                         |
| ----- | ---------------- | ---------------------------------------------- |
| 1     | `generate_cache` | Refreshes the SAP tables cache.                |
| 2     | `sync_phd`       | Synchronizes Production history data.          |
| 3     | `generate_links` | Rebuilds object links from cache and PHD data. |
| 4     | `generate_graph` | Rebuilds the impacted graph.                   |

`generate_common` and `generate_buildmap` are **not** part of this flow, so `refresh_links` does not replace or recreate the Initial Build Map.

## Recommended transport and test-cycle workflow

Do **not** leave Build Modifications monitoring (`BUILD_MODS`) running continuously across transport-import and links-refresh windows. Prefer this sequence:

1. Ensure Build Modifications monitoring is not running — `slabapcli buildmods stop --pipeline <name>`.
2. Import all transports and wait for the imports to complete.
3. Schedule or update the refresh with `slabapcli refresh_links --pipeline <name> --cron "<expression>"`.
4. Wait for the refresh to finish (see [Manage the scheduled task](#manage-the-scheduled-task)), then start Build Modifications — `slabapcli buildmods run --pipeline <name>`.

### Proactive run before a test cycle

Because the CLI schedules rather than directly executes the pipeline:

1. Stop Build Modifications monitoring with `slabapcli buildmods stop --pipeline <name>`.
2. Import all transports and wait for the imports to complete.
3. Register or update the refresh schedule with `slabapcli refresh_links --pipeline <name> --cron "<expression>"`.
4. In Windows Task Scheduler, locate `REFRESH_LINKS_<pipeline>` and select **Run** to trigger the registered task immediately.
5. Wait until the task is no longer running. Confirm a successful Last Run Result and check `RefreshLinks_YYYY-MM-DD.log` when needed.
6. Start Build Modifications monitoring with `slabapcli buildmods run --pipeline <name>`.

{% hint style="warning" %}
**Mutual exclusion:** For a given pipeline, `REFRESH_LINKS`, `INIT_BUILD_MAP`, and `BUILD_MODS` cannot overlap. If they conflict, the watcher exits with code `11`. See [Watcher Exit Codes](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/command-line-interface/monitor-your-pipeline-for-build-modifications.md#watcher-exit-codes) and [Troubleshooting](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/troubleshooting-the-abap-agent.md). Do not start Build Modifications until the refresh has finished.
{% endhint %}

## Manage the scheduled task

* Task name: `REFRESH_LINKS_<pipeline>`
* Re-run `slabapcli refresh_links` with a new `--cron` value to update the existing task’s schedule.
* Use Task Scheduler **Run** for the proactive (immediate) pattern above.
* This command has no CLI `stop` or `status` — use Task Scheduler **Disable** or **Delete** on `REFRESH_LINKS_<pipeline>` when you need to pause or remove the schedule.
* Always wait for the task to finish before starting `BUILD_MODS`.

## Logging

| Log                                       | Location                                                                                                                                                        |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Per-stage server task detail (start here) | `public\logs\{taskType}\{yyyy-MM-dd}\{processId}\` for `generate_cache`, `sync_phd`, `generate_links`, and `generate_graph` (`{processId}.log` and `agent.log`) |
| Pipeline watcher summary (secondary)      | `public\Logs\{pipeline}\RefreshLinks_YYYY-MM-DD.log` (spdlog daily rotation)                                                                                    |

For path layout and log-level settings, see [Configuration settings — Log locations](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/configuration-settings.md#log-locations). For where to look first on a failing server task, see [Troubleshooting — Server task logs](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/troubleshooting-the-abap-agent.md#server-task-logs).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent-2.0/command-line-interface/refresh-links.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
