# Task Dependencies (https://yapl.app/en/docs/user-guides/tasks/task-dependencies)

# Task Dependencies

Dependencies define relationships between tasks, controlling when tasks can start or finish based on other tasks.

## Understanding Dependencies

Dependencies provide:

- **Sequence Control** - Define task order
- **Schedule Calculation** - Automatic date updates
- **Critical Path** - Identify important sequences
- **Realistic Planning** - Model real constraints

## Dependency Types

### Finish-to-Start (FS)

The most common type. Successor starts after predecessor finishes.

```
Task A ────────┐
              └─→ Task B
```

**Example:** "Excavation must finish before Foundation can start"

### Start-to-Start (SS)

Successor can start when predecessor starts.

```
Task A ────────
  └─→ Task B ────────
```

**Example:** "Inspection can start when Construction starts"

### Finish-to-Finish (FF)

Successor finishes when predecessor finishes.

```
Task A ────────
Task B ──────┘
```

**Example:** "Documentation finishes when Development finishes"

### Start-to-Finish (SF)

Successor finishes when predecessor starts. (Rare)

```
      Task A ────────
Task B ──────┘
```

**Example:** "Old system shutdown finishes when new system starts"

## Dependency Summary

| Type | Abbreviation | Relationship |
|------|--------------|--------------|
| Finish-to-Start | FS | Successor starts after predecessor finishes |
| Start-to-Start | SS | Both can start together |
| Finish-to-Finish | FF | Both must finish together |
| Start-to-Finish | SF | Successor finishes when predecessor starts |

## Creating Dependencies

### From Task Details

1. Open task detail view
2. Find dependencies section
3. Click **Add Dependency**
4. Select predecessor task
5. Choose dependency type
6. Set lag (optional)
7. Save

### From Gantt View

1. Open timeline view
2. Hover over task bar
3. Drag from connection point
4. Drop on successor task
5. Dependency created (FS default)

### From Task List

1. Select task
2. Open dependencies panel
3. Add predecessor(s)
4. Configure type and lag

## Editing Dependencies

### Change Dependency Type

1. Find dependency in task details
2. Click type dropdown
3. Select new type
4. Save changes

### Change Lag Time

1. Find dependency
2. Edit lag value
3. Positive = delay after
4. Negative = overlap allowed

### Remove Dependency

1. Find dependency
2. Click delete/remove
3. Confirm removal

## Lag and Lead Time

### Positive Lag (Delay)

Wait time between linked tasks.

```
Task A ────────┐
              ╌╌╌ (2 day lag)
                 └─→ Task B
```

**Example:** "Concrete pour + 7 day lag (cure time) + Framing"

### Negative Lag (Lead/Overlap)

Start successor before predecessor finishes.

```
Task A ────────┐
          └─→ Task B ────
         (2 day lead)
```

**Example:** "Rough plumbing can start 2 days before framing completes"

## Viewing Dependencies

### In Gantt Chart

- Lines connect related tasks
- Arrow shows direction
- Line style may indicate type
- Critical dependencies highlighted

### In Task Details

- List of predecessors
- List of successors
- Type and lag for each

### In Task List

- Dependency column (if shown)
- Predecessor/successor counts

## Dependency Chains

### Simple Chain

```
A → B → C → D
```

Sequential tasks in order.

### Parallel Chains

```
A → B → C
A → D → E
    B → E
```

Multiple paths through project.

### Critical Path

Longest chain determines project duration. See [Critical Path](/docs/user-guides/gantt/critical-path).

## Dependency Validation

### Circular Dependencies

Not allowed - tasks cannot depend on themselves (directly or indirectly).

```
A → B → C → A  (INVALID)
```

YAPL prevents circular dependencies.

### Constraint Conflicts

Dependencies may conflict with constraints:
- "Must Start On" date conflicts with predecessor
- System warns or prevents invalid configurations

## Impact of Dependencies

### Date Calculation

When dependencies exist:
- Successor dates calculate from predecessor
- Changes to predecessor affect successor
- Chain reaction through network

### Schedule Changes

| When Predecessor Changes | Successor Effect |
|-------------------------|------------------|
| Finishes later | Starts later |
| Finishes earlier | Can start earlier |
| Duration increases | May delay successor |

## Best Practices

### Only Necessary Dependencies

- Don't over-constrain schedule
- Only add real dependencies
- Avoid "just in case" links

### Prefer FS Dependencies

- Most intuitive
- Easiest to maintain
- Use other types only when needed

### Document Why

- Note reason for unusual dependencies
- Explain business logic
- Help future editors understand

### Review Regularly

- Check dependencies still valid
- Remove outdated links
- Update lag times as needed

## Bulk Dependency Management

### Adding Multiple

1. Select multiple tasks (if supported)
2. Add common predecessors
3. Apply to all selected

### Dependency Matrix

Some views show dependency matrix:
- All tasks in rows and columns
- Marks show relationships
- Quick overview of network

## Troubleshooting

### Cannot Add Dependency

**"Circular dependency detected"**
- Task already depends on successor
- Review dependency chain
- Remove conflicting link

**"Invalid dependency"**
- Check task exists
- Verify same plan

### Dates Not Updating

- Check scheduling mode
- Verify dependency saved
- Review constraint conflicts

### Dependencies Not Showing

- Check view settings
- Verify Gantt lines enabled
- Refresh the view

### Unexpected Schedule Impact

- Trace dependency chain
- Check lag values
- Review critical path

## Related Topics

- [Task Properties](/docs/user-guides/tasks/task-properties) - Task configuration
- [Critical Path](/docs/user-guides/gantt/critical-path) - Schedule analysis
- [Gantt Charts](/docs/user-guides/gantt) - Timeline visualization