LinkData#

A dependency between two tasks: which end of the source task drives which end of the target task, and the working time between them. LinkData records go in the links array of ProjectData. Links added or edited on a live project use the links bucket of SchedulingChanges instead.

type LinkData = {
  id: Id;
  source: Id;
  target: Id;
  type?: "fs" | "ss" | "ff" | "sf" | 0 | 1 | 2 | 3 | "0" | "1" | "2" | "3";
  lag?: number | null;
  lag_unit?: TimeUnit | null;
};

Fields#

Field Type Required Default Description
id Id yes Link id, unique among the project's links. Results refer to the link by this id, for example in dropped-link notes, cycles and the critical path.
source Id yes Id of the predecessor task.
target Id yes Id of the successor task.
type string | number, see link type no "fs" Which end of source drives which end of target: "fs" (finish-to-start), "ss" (start-to-start), "ff" (finish-to-finish), "sf" (start-to-finish). Case-insensitive. The numbers 0-3 and the strings "0"-"3" are accepted in the same order.
lag number | null no 0 Working time between the source end and the target end, in lag_unit. Fractions are allowed. A negative value lets the target overlap the source. null reads as 0.
lag_unit TimeUnit | null no config.duration_unit Unit of lag: "minute", "hour" or "day". Omitted or null uses duration_unit of the project config.

The wire name of the link type is type. Unknown fields are ignored. Shared rules for ids, numbers and null are on Wire format.

A source or target that names no task, or an unscheduled task, doesn't fail the call. The scheduler drops the link and reports a dropped-link note. See Links that get dropped for every case.

Note

A link without lag_unit reads lag in config.duration_unit.

Validation#

A link record fails the whole call with an error envelope when:

Error When
validation, path links[i].id id repeats the id of an earlier link. With validation: "repair" in ProjectOptions, the duplicate is removed instead (the last record wins) and reported as a repaired note.
validation, path null type isn't a known link type, or lag_unit isn't a known unit.
parse id, source or target is missing; lag isn't a number or null (for example, the string "2"); the record isn't a JSON object.

Used by#

Example#

Task 2 starts when task 1 finishes. Task 3 starts four working hours after task 2 starts, while the project counts durations in days:

{
  "links": [
    { "id": "a", "source": 1, "target": 2 },
    { "id": "b", "source": 2, "target": 3, "type": "ss", "lag": 4, "lag_unit": "hour" }
  ]
}