DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Sync Contacts Across Gmail and Outlook with OpenClaw

You use Gmail for personal stuff and Outlook for work. Someone emails your personal address about a project. You know their name but not their work email. You open Outlook contacts — they're not there. You open Gmail contacts — found them, but now you need to copy the address and switch back.

Your OpenClaw agent can search both accounts at once.

What you'll build

An agent workflow that:

  1. Searches contacts across multiple email accounts simultaneously
  2. Finds the right person regardless of which account knows them
  3. Pulls contact details — email, phone, company, title
  4. Uses that information in follow-up actions (send email, schedule meeting)

No exporting CSVs. No switching between Google Contacts and Outlook People. One question, one answer.

Prerequisites

You need the Nylas plugin with at least two connected accounts. If you followed The Nylas Plugin for OpenClaw, you're most of the way there.

Install (if you haven't already):

openclaw plugins install @nylas/openclaw-nylas-plugin
openclaw config set plugins.entries.nylas.config.apiKey nyl_v0_your_key_here
openclaw gateway restart
Enter fullscreen mode Exit fullscreen mode

Then configure named grants for your accounts:

openclaw config set plugins.entries.nylas.config.grants '{"work":"grant-id-1","personal":"grant-id-2"}'
openclaw gateway restart
Enter fullscreen mode Exit fullscreen mode

Find your grant IDs with openclaw nylas discover.

Full setup: cli.nylas.com/guides/install-openclaw-nylas-plugin. New to the CLI? Start with the getting started guide.

Search contacts across accounts

The simplest case — you need someone's email:

"Find the contact info for Sarah Chen."

The agent calls nylas_list_contacts on your default grant. But with multi-account configured, you can search everywhere:

"Search for Sarah Chen across both my work and personal accounts."

The agent runs nylas_list_contacts twice — once per grant — and merges the results:

Source Name Email Company Phone
Work Sarah Chen s.chen@bigcorp.com BigCorp +1-555-0142
Personal Sarah Chen sarah.chen@gmail.com +1-555-0142

Same person, two different email addresses. Now you know which one to use depending on the context.

Real workflows

Contact lookup is rarely the end goal. It's usually the first step in something bigger. Here's where it gets useful.

Find and email

"Find Bob Martinez's work email and send him a message about the Q3 proposal."

The agent:

  1. Calls nylas_list_contacts with the search query
  2. Finds bob.martinez@company.com
  3. Calls nylas_send_email with the address it just found

No need to look up the email separately. The agent connects the dots. For more on sending email, see the send email guide.

Find and schedule

"Look up everyone from the design team in my contacts and find a time we're all free next week."

The agent:

  1. Calls nylas_list_contacts searching for "design" in company/group fields
  2. Collects the email addresses
  3. Calls nylas_check_availability with all of them
  4. Reports back with open slots

Contact search → calendar availability → meeting creation, all in one conversation. (We covered the scheduling part in Automate Meeting Scheduling.)

Find and push to CRM

"Find all contacts from BigCorp and export them to Salesforce."

The agent searches your contacts, collects the results, and you can pipe them into your CRM. The export email to Salesforce guide walks through the full integration. For HubSpot and Pipedrive workflows, see the CRM email workflows guide.

Find duplicates

"Search for contacts named 'Johnson' across both accounts. Are there any duplicates?"

The agent searches both grants, compares results by name and email, and flags matches:

"Found 3 contacts named Johnson. Mike Johnson appears in both accounts — mike.j@work.com (work) and mikej@gmail.com (personal). The other two are different people."

Not a full dedup tool, but enough to spot the obvious overlaps.

What contacts data is available?

The Nylas Contacts API returns structured fields for each contact:

Field Example
Name Sarah Chen
Email(s) s.chen@bigcorp.com, sarah@personal.com
Phone(s) +1-555-0142 (mobile), +1-555-0100 (work)
Company BigCorp
Title Engineering Manager
Address 123 Main St, San Francisco, CA
Groups Design Team, Project Alpha
Notes Met at KubeCon 2025

The agent can access all of these. Ask for exactly what you need:

"What company does raj@example.com work for?"

"Give me the phone numbers for everyone in the 'Sales' group."

When contacts aren't enough

Sometimes the person you're looking for isn't in your contacts. They emailed you once, six months ago, and you never saved them.

The agent can fall back to email search:

"I need to reach someone named Park who emailed me about the API migration. Check my contacts first, then search my email if you don't find them."

The agent:

  1. Searches nylas_list_contacts — no results
  2. Falls back to nylas_list_emails searching for "Park" + "API migration"
  3. Finds the email thread and extracts the address: j.park@vendor.io

Contacts and email working together. One tool picks up where the other leaves off. We covered email search workflows in more detail in the email triage post.

Prefer the terminal?

If you'd rather search contacts from the command line without an agent, the Nylas CLI has you covered. The guides walk through contact management and other workflows.

Links


Two accounts, one search, zero tab-switching. Your agent knows everyone you know.

Top comments (0)