# Link task

A Link calls another job from inside a job. The other job's tasks do their work, and this job goes on behind the Link. It is how steps that several jobs need are kept in one place: one job "Deliver to partner" that ten others call.

A Link can also start the other job as a run of its own, and it can send a job to run somewhere else: on a DMZ server, on the other servers of a cluster, or on a certain [job engine](Jobs-Engines.md).

## Fields

| Field | What it does | On a new task |
|---|---|---|
| **Link To** | the job to call, chosen from the list of jobs | |
| **Continue on and skip linked job when there are no items.** | with an empty list the other job is not called, and this job goes on | off |
| **Run as external job (same as clicking test and run on that job).** | the other job gets a **run of its own**, with its own entry under Active Jobs, its own log and its own authority | off |
| **Pass current filtered items to linked job.** | with an external run: the run starts with this job's items. Unticked, it starts with an empty list. | off |
| **Run job async and don't wait for it.** | with an external run: this job goes on at once and does not learn how the other one ended | off |
| **Route connection through DMZ when possible** | where the other job runs: here, on a DMZ server, on the servers of the cluster, or on an engine by name or label | here |

## The two ways to call

| | Inside this run (nothing ticked) | As an external job |
|---|---|---|
| The other job's tasks | run as part of this run | run in a run of their own |
| Items | this job's items go in, and what the other job leaves comes back | go in only when ticked; nothing comes back |
| Variables | shared: what the other job sets, this one sees | not shared |
| Under Active Jobs | one run | two runs |
| A failure in the other job | is a failure of the Link | is a failure of the Link when it waits; unnoticed when it does not |
| Its **Max runtime** | this job's | its own |

Use the first for shared steps. Use the second to start something long that this job need not wait for, or a job whose runs you want to see by themselves.

## What it hands on

Called inside this run: the list as the other job left it. As an external job: the items it was given, unchanged.

## Linked jobs without a task

**Link after start** and **Link before end** in a job's [Setup](Jobs-Schedules.md#linked-jobs) put a Link at the beginning and the end of a job without drawing one. The link before the end is taken on every way to End, after a failure too. That makes it the place for "always report how the job ended", once for all jobs.

## Running somewhere else

| Chosen | The other job runs |
|---|---|
| a DMZ server's name | on that DMZ server, with the items sent there and its results sent back. For work that must happen from outside the internal network. |
| the cluster's other servers | once on each other server of the cluster: "Ran … on 2 other servers of the cluster" |
| an engine's name or label | on that [engine](Jobs-Engines-Other-Machines.md#labels). The Link fails if the job could not be started there, or did not end as completed. |

## Things to know

- **The job must exist.** "Unable to find the given link" when the name is wrong or the job was renamed. A renamed job is not followed by the Links that name it.
- **Authority.** A job that is called inside a run is checked like the run's own tasks. An external job runs with the authority it was saved with. An admin with limited rights can link only to jobs within their own scope: see [Who may see, change and run a job](Jobs-Access.md).
- **Loops.** A job that links to itself, or two that link to each other, go round until a time limit stops them. Give jobs that are linked a **Max runtime**.
- **A Jump to another job**, as CrushFTP 11 had it, is a Link in CrushMFT 27.
