# Notion Team Directory Sync

> Keep your team directory in Notion automatically in sync with your actual workspace. New hires appear, role changes update, and departed team members get archived without anyone touching a spreadsheet.

Source: https://cotera.co/solutions/ops/notion-team-directory-sync

---

- **Team:** Operations
- **Tools:** Notion
- **Difficulty:** easy
- **Setup time:** 5 min
- **Time saved:** 1-2 hrs/month

## How it works
1. **Fetch Users** — Lists all current workspace users with their details
2. **Compare Directory** — Searches for existing directory entries to find gaps and stale data
3. **Add New Members** — Creates directory pages for users not yet listed
4. **Update Existing** — Updates properties for users whose info has changed

## Example requests
- Sync our Team Directory database with the current Notion workspace users
- Add any new workspace members to the People database and flag anyone who left
- Audit the team directory for outdated entries and missing team members

## Prompt

```markdown
## Task

Use @Notion/List Users to fetch all current workspace users with their details. Then use @Notion/Search Content to find your team directory database and existing entries. Compare the two lists to identify new team members, changed information, and potentially departed users. Use @Notion/Create Page to add directory entries for new members and @Notion/Update Page to refresh entries where information has changed.

**Example:** "Sync our team directory in Notion with the current workspace user list."

## Input

The user will provide:
1. The name of the team directory database in Notion (e.g., "Team Directory," "People," "Company Directory")
2. Optional: specific departments or teams to sync
3. Optional: additional properties to set for new entries (department, role, location)
4. Optional: whether to archive entries for users no longer in the workspace

## Context

### Sync Strategy

1. Use @Notion/List Users to get all workspace users — each user has an id, name, email, and avatar URL
2. Use @Notion/Search Content to find the team directory database
3. Search for each workspace user in the directory by name or email
4. For users found in the workspace but not in the directory — create new entries
5. For users found in both — compare properties and update if anything has changed
6. For directory entries with no matching workspace user — flag as potentially departed

### Properties for New Entries

When creating a new directory page with @Notion/Create Page, set:
- **Name:** Full name from the workspace user
- **Email:** Email address from the workspace user
- **Status:** Active
- **Added Date:** Today's date
- **Role:** If provided by the user, otherwise leave blank for manual entry
- **Department:** If provided by the user, otherwise leave blank
- **Notion User ID:** Store the workspace user ID for future syncs

### Properties to Check on Updates

When comparing existing entries with @Notion/Update Page:
- **Name:** Has it changed?
- **Email:** Has it changed?
- **Status:** Should it still be Active?
- **Avatar:** Has the profile photo been updated?

## Output

**Team Directory Sync Report:**

*Workspace Users Found:* [X]
*Directory Entries Found:* [X]

**New Members Added:**
For each new entry:
- [Name] — [Email]
  - Created in directory with status: Active

**Entries Updated:**
For each updated entry:
- [Name] — Updated: [list of changed fields]

**Needs Review:**
For each unmatched directory entry:
- [Name] — No matching workspace user found
  - Recommended action: Verify if this person has left or uses a different email

**Duplicates Found:**
- [Name] — [X] directory entries found for the same user

**Summary:**
- Added: [X] new members
- Updated: [X] existing entries
- Flagged for review: [X] entries
- No changes needed: [X] entries
```

## Related reading
- [I Spent a Month Automating Our Notion Databases](https://cotera.co/articles/notion-database-automation-guide.md)
- [We Automated Our Notion Workspace and Cut 9 Hours a Week](https://cotera.co/articles/notion-automation-workflows-guide.md)
- [The 7 Notion Integrations Our Team Actually Uses](https://cotera.co/articles/notion-integrations-business-teams-guide.md)

